Skip to content

Commit

Permalink
[Hotkey]
Browse files Browse the repository at this point in the history
* add reload skin
  • Loading branch information
jbleyel committed Nov 20, 2024
1 parent 7461597 commit 0f03775
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/python/Screens/ButtonSetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ def getButtonSetupFunctions():
ButtonSetupFunctions.append((_("Bluetooth Setup"), "Bluetooth/", textPlugins))
if isPluginInstalled("Chromium"):
ButtonSetupFunctions.append((_("Youtube TV"), "YoutubeTV/", textPlugins))
ButtonSetupFunctions.append((_("Reload Skin"), "ReloadSkin/", textSetup))
return ButtonSetupFunctions


Expand Down Expand Up @@ -710,6 +711,10 @@ def execButtonSetup(self, selected):
if isPluginInstalled("Chromium"):
from Plugins.Extensions.Chromium.plugin import start_youtubetv_main
start_youtubetv_main(self.session)
elif selected[0] == "ReloadSkin":
from skin import reloadSkins
reloadSkins()
self.session.reloadDialogs()

def showServiceListOrMovies(self):
if hasattr(self, "openServiceList"):
Expand Down
14 changes: 12 additions & 2 deletions lib/python/StartEnigma.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def __init__(self, desktop=None, summaryDesktop=None, navigation=None):
self.shutdown = False
from Components.FrontPanelLed import frontPanelLed
frontPanelLed.init(self)
self.allDialogs = []

for plugin in plugins.getPlugins(PluginDescriptor.WHERE_SESSIONSTART):
try:
Expand Down Expand Up @@ -110,12 +111,13 @@ def instantiateDialog(self, screen, *arguments, **kwargs):
return self.doInstantiateDialog(screen, arguments, kwargs, self.desktop)

def deleteDialog(self, screen):
if screen in self.allDialogs:
self.allDialogs.remove(screen)
screen.hide()
screen.doClose()

def deleteDialogWithCallback(self, callback, screen, *retVal):
screen.hide()
screen.doClose()
self.deleteDialog(screen)
if callback is not None:
callback(*retVal)

Expand All @@ -135,6 +137,7 @@ def doInstantiateDialog(self, screen, arguments, kwargs, desktop):
readSkin(dialog, None, dialog.skinName, desktop) # Read skin data.
dialog.setDesktop(desktop) # Create GUI view of this dialog.
dialog.applySkin()
self.allDialogs.append(dialog)
return dialog

def pushCurrent(self):
Expand Down Expand Up @@ -218,6 +221,13 @@ def doShutdown(self):
if callable(function):
function()

def reloadDialogs(self):
for dialog in self.allDialogs:
if hasattr(dialog, "desktop"):
oldDesktop = dialog.desktop
readSkin(dialog, None, dialog.skinName, oldDesktop)
dialog.applySkin()


class PowerKey:
"""PowerKey code - Handles the powerkey press and powerkey release actions."""
Expand Down

0 comments on commit 0f03775

Please sign in to comment.