Skip to content

Commit

Permalink
[PluginBrowser]
Browse files Browse the repository at this point in the history
* refresh screen after layout change
  • Loading branch information
jbleyel committed Aug 25, 2024
1 parent 10bbca0 commit 28e1369
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/python/Screens/PluginBrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,8 @@ def __init__(self, session):
self.opkgComponent.addCallback(self.keyResetFeedsCallback)
self.cleanError = False
self.refreshIncomplete = 0
self.addSaveNotifier(self.onUpdateSettings)
self.onClose.append(self.clearSaveNotifiers)

def keyResetFeeds(self):
self.suspendAllActionMaps()
Expand Down Expand Up @@ -727,6 +729,22 @@ def swapGitHubDNS(self):
lines += ["%s raw.githubusercontent.com" % ip for ip in ("185.199.108.133", "185.199.109.133", "185.199.110.133", "185.199.111.133", "2606:50c0:8000::154", "2606:50c0:8001::154", "2606:50c0:8002::154", "2606:50c0:8003::154")]
fileWriteLines("/etc/hosts", lines, source=MODULE_NAME)

def onUpdateSettings(self):
if config.usage.pluginListLayout.isChanged():
oldDialogIndex = None
oldSummarys = (-1, None)
for index, dialog in enumerate(self.session.dialog_stack):
if isinstance(dialog[0], PluginBrowser):
oldDialogIndex = (index, dialog[1])
oldSummarys = dialog[0].summaries[:]
break
if oldDialogIndex[0] != -1:
newDialog = self.session.instantiateDialog(PluginBrowser)
newDialog.summaries = oldSummarys
newDialog.isTmp = False
newDialog.callback = None
self.session.dialog_stack[oldDialogIndex[0]] = (newDialog, oldDialogIndex[1])


class PluginBrowserSummary(ScreenSummary):
def __init__(self, session, parent):
Expand Down

0 comments on commit 28e1369

Please sign in to comment.