From 2ef912d96078fa6978bfa8d0d082a4b9e746b672 Mon Sep 17 00:00:00 2001 From: dkanada Date: Fri, 20 Mar 2020 02:54:12 +0900 Subject: [PATCH 1/2] add method to open client settings --- src/controllers/user/menu.js | 10 ++++++++++ src/mypreferencesmenu.html | 9 +++++++++ src/strings/en-us.json | 1 + 3 files changed, 20 insertions(+) diff --git a/src/controllers/user/menu.js b/src/controllers/user/menu.js index 6087beadf..b1e2b7b51 100644 --- a/src/controllers/user/menu.js +++ b/src/controllers/user/menu.js @@ -10,6 +10,10 @@ define(["apphost", "connectionManager", "listViewStyle", "emby-button"], functio Dashboard.selectServer(); }); + view.querySelector(".clientSettings").addEventListener("click", function () { + window.NativeShell.openClientSettings(); + }); + view.addEventListener("viewshow", function() { // this page can also be used by admins to change user preferences from the user edit page var userId = params.userId || Dashboard.getCurrentUserId(); @@ -21,6 +25,12 @@ define(["apphost", "connectionManager", "listViewStyle", "emby-button"], functio page.querySelector(".lnkPlaybackPreferences").setAttribute("href", "mypreferencesplayback.html?userId=" + userId); page.querySelector(".lnkSubtitlePreferences").setAttribute("href", "mypreferencessubtitles.html?userId=" + userId); + if (window.NativeShell && window.NativeShell.AppHost.supports("clientsettings")) { + page.querySelector(".clientSettings").classList.remove("hide"); + } else { + page.querySelector(".clientSettings").classList.add("hide"); + } + if (appHost.supports("multiserver")) { page.querySelector(".selectServer").classList.remove("hide"); } else { diff --git a/src/mypreferencesmenu.html b/src/mypreferencesmenu.html index 41fcd1b75..4219059dd 100644 --- a/src/mypreferencesmenu.html +++ b/src/mypreferencesmenu.html @@ -47,6 +47,15 @@ + + +
+ +
+
${ClientSettings}
+
+
+

${HeaderAdmin}

diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 62e8fa3f8..f08de6b46 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -147,6 +147,7 @@ "ChannelNumber": "Channel number", "Channels": "Channels", "CinemaModeConfigurationHelp": "Cinema mode brings the theater experience straight to your living room with the ability to play trailers and custom intros before the main feature.", + "ClientSettings": "Client Settings", "Collections": "Collections", "ColorPrimaries": "Color primaries", "ColorSpace": "Color space", From e8bc839d0babd2c1a63e3eb4ff253ce43c948a9c Mon Sep 17 00:00:00 2001 From: dkanada Date: Fri, 20 Mar 2020 17:49:32 +0900 Subject: [PATCH 2/2] update methods for native shell --- src/components/shell.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/components/shell.js b/src/components/shell.js index f82f5eea3..4f1aa0c8d 100644 --- a/src/components/shell.js +++ b/src/components/shell.js @@ -10,12 +10,6 @@ define([], function () { } }, - canExec: false, - exec: function (options) { - // options.path - // options.arguments - return Promise.reject(); - }, enableFullscreen: function () { if (window.NativeShell) { window.NativeShell.enableFullscreen();