add option to show change user dialog on screen saver activation

This commit is contained in:
Shaun
2018-04-21 20:57:06 +10:00
parent 41e3545635
commit ef70ec389d
5 changed files with 26 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.embycon"
name="EmbyCon"
version="1.5.2"
version="1.5.3"
provider-name="Team B">
<requires>
<import addon="xbmc.python" version="2.25.0"/>

View File

@@ -718,3 +718,10 @@ msgctxt "#30328"
msgid "Show Empty Folders (Shows, Seasons, Boxsets)"
msgstr ""
msgctxt "#30329"
msgid "Screensaver"
msgstr ""
msgctxt "#30330"
msgid "Show change user dialog"
msgstr ""

View File

@@ -848,6 +848,12 @@ class PlaybackService(xbmc.Monitor):
def onNotification(self, sender, method, data):
log.debug("PlaybackService:onNotification:{0}:{1}:{2}", sender, method, data)
#if method == 'GUI.OnScreensaverDeactivated':
if method == 'GUI.OnScreensaverActivated':
self.screensaver_deactivated()
return
if sender[-7:] != '.SIGNAL':
return
@@ -861,3 +867,11 @@ class PlaybackService(xbmc.Monitor):
decoded_data = binascii.unhexlify(hex_data)
play_info = json.loads(decoded_data)
playFile(play_info, self.monitor)
def screensaver_deactivated(self):
log.debug("Screen Saver Deactivated")
settings = xbmcaddon.Addon()
show_change_user = settings.getSetting('changeUserOnScreenSaver') == 'true'
if show_change_user:
xbmc.executebuiltin("RunScript(plugin.video.embycon,0,?mode=CHANGE_USER)")

View File

@@ -235,5 +235,6 @@ def checkServer(force=False, change_user=False, notify=False):
download_utils = DownloadUtils()
download_utils.authenticate()
download_utils.getUserId()
xbmc.executebuiltin("ActivateWindow(Home)")
xbmc.executebuiltin("ReloadSkin()")

View File

@@ -38,6 +38,9 @@
<setting type="sep" />
<setting id="forceAutoResume" type="bool" label="30322" default="true" visible="true" enable="true" />
<setting id="jump_back_amount" type="slider" label="30114" default="15" range="0,1,60" option="int" visible="true"/>
<setting label="30329" type="lsep"/>
<setting type="sep" />
<setting id="changeUserOnScreenSaver" type="bool" label="30330" default="true" visible="true" enable="true" />
</category>
<category label="30110">
<setting id="addCounts" type="bool" label="30116" default="false" visible="true" enable="true" />