Skip to content

Commit

Permalink
[PluginBrowser] remove toggle between download and delete
Browse files Browse the repository at this point in the history
  • Loading branch information
koivo committed Apr 19, 2024
1 parent 755db8b commit cbc39e1
Showing 1 changed file with 12 additions and 26 deletions.
38 changes: 12 additions & 26 deletions lib/python/Screens/PluginBrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,9 @@ def download(self):
self.session.openWithCallback(self.PluginDownloadBrowserClosed, PluginDownloadBrowser, PluginDownloadBrowser.DOWNLOAD, self.firsttime)
self.firsttime = False

def PluginDownloadBrowserClosed(self, returnValue):
if returnValue == None:
self.updateList()
self.checkWarnings()
elif returnValue == 0:
self.download()
else:
self.delete()
def PluginDownloadBrowserClosed(self):
self.updateList()
self.checkWarnings()

def openExtensionmanager(self):
if isPluginInstalled("SoftwareManager"):
Expand Down Expand Up @@ -281,15 +276,13 @@ def __init__(self, session, type=0, needupdate=True):
self.remove_settings_name = ''
self.onChangedEntry = []
self["list"].onSelectionChanged.append(self.selectionChanged)
self["text"] = Label(_("Downloading plugin information. Please wait...") if self.type == self.DOWNLOAD else _("Getting plugin information. Please wait..."))
self["key_red" if self.type == self.DOWNLOAD else "key_green"] = Label(_("Remove plugins") if self.type == self.DOWNLOAD else _("Download plugins"))

# if self.type == self.DOWNLOAD:
# self["text"] = Label(_("Downloading plugin information. Please wait..."))
# if self.type == self.REMOVE:
# self["text"] = Label(_("Getting plugin information. Please wait..."))
# elif self.type == self.TOOGLE:
# self["key_red" if self.type == self.DOWNLOAD else "key_green"] = Label(_("Remove plugins") if self.type == self.DOWNLOAD else _("Download plugins"))
if self.type == self.DOWNLOAD:
self["text"] = Label(_("Downloading plugin information. Please wait..."))
if self.type == self.REMOVE:
self["text"] = Label(_("Getting plugin information. Please wait..."))
elif self.type == self.TOOGLE:
self["text"] = Label(_("Getting plugin information. Please wait..."))

self.run = 0
self.remainingdata = ""
Expand All @@ -298,7 +291,6 @@ def __init__(self, session, type=0, needupdate=True):
"ok": self.go,
"back": self.requestClose,
})
self["PluginDownloadActions"] = ActionMap(["ColorActions"], {"red": self.delete} if self.type == self.DOWNLOAD else {"green": self.download})
if os_path.isfile('/usr/bin/opkg'):
self.ipkg = '/usr/bin/opkg'
self.ipkg_install = self.ipkg + ' install --force-overwrite'
Expand Down Expand Up @@ -393,13 +385,7 @@ def go(self):
mbox = self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to hold the plugin \"%s\"?") % sel.name, default=False)
mbox.setTitle(_("Hold plugins"))

def delete(self):
self.requestClose(1)

def download(self):
self.requestClose(0)

def requestClose(self, returnValue=None):
def requestClose(self):
if self.plugins_changed:
plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
if self.reload_settings:
Expand All @@ -409,7 +395,7 @@ def requestClose(self, returnValue=None):
plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
self.container.appClosed.remove(self.runFinished)
self.container.dataAvail.remove(self.dataAvail)
self.close(returnValue)
self.close()

def resetPostInstall(self):
try:
Expand Down Expand Up @@ -582,7 +568,7 @@ def runFinished(self, retval):
else:
if len(self.pluginlist) > 0:
self.updateList()
self["text"].setText(_("Use green/red buttons to toggle between download and remove."))
self["text"].setText(_("Please make a selection"))
self["list"].instance.show()
else:
if self.type == self.DOWNLOAD:
Expand Down

0 comments on commit cbc39e1

Please sign in to comment.