Softwaremanager: * notify if updatefeed is not available and also verify HardwarePrer...
[enigma2.git] / lib / python / Plugins / SystemPlugins / SoftwareManager / plugin.py
index 4dbe7f7073283260bda6815e908c2193f5019ffd..1e0ed4d58f419056652287b4b47de3d3afd8364a 100755 (executable)
@@ -307,8 +307,8 @@ class PluginManager(Screen, DreamInfoHandler):
                                <convert type="TemplatedMultiContent">
                                {"templates":
                                        {"default": (51,[
-                                                       MultiContentEntryText(pos = (30, 1), size = (470, 24), font=0, flags = RT_HALIGN_LEFT, text = 0), # index 0 is the name
-                                                       MultiContentEntryText(pos = (30, 25), size = (470, 24), font=1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is the description
+                                                       MultiContentEntryText(pos = (0, 1), size = (470, 24), font=0, flags = RT_HALIGN_LEFT, text = 0), # index 0 is the name
+                                                       MultiContentEntryText(pos = (0, 25), size = (470, 24), font=1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is the description
                                                        MultiContentEntryPixmapAlphaTest(pos = (475, 0), size = (48, 48), png = 5), # index 5 is the status pixmap
                                                        MultiContentEntryPixmapAlphaTest(pos = (0, 49), size = (550, 2), png = 6), # index 6 is the div pixmap
                                                ]),
@@ -405,22 +405,19 @@ class PluginManager(Screen, DreamInfoHandler):
                        if status == 'update':
                                statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/upgrade.png"))
                                self.statuslist.append(( _("Updating software catalog"), '', _("Searching for available updates. Please wait..." ),'', '', statuspng, divpng, None, '' ))
-                               self["list"].style = "default"
-                               self['list'].setList(self.statuslist)
                        elif status == 'sync':
                                statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/upgrade.png"))
                                self.statuslist.append(( _("Package list update"), '', _("Searching for new installed or removed packages. Please wait..." ),'', '', statuspng, divpng, None, '' ))
-                               self["list"].style = "default"
-                               self['list'].setList(self.statuslist)
                        elif status == 'error':
                                statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/remove.png"))
                                self.statuslist.append(( _("Error"), '', _("There was an error downloading the packetlist. Please try again." ),'', '', statuspng, divpng, None, '' ))
-                               self["list"].style = "default"
-                               self['list'].setList(self.statuslist)
+                       self["list"].style = "default"
+                       self['list'].setList(self.statuslist)
+
 
        def getUpdateInfos(self):
                self.setState('update')
-               iSoftwareTools.getUpdates(self.getUpdateInfosCB)
+               iSoftwareTools.startSoftwareTools(self.getUpdateInfosCB)
 
        def getUpdateInfosCB(self, retval = None):
                if retval is not None:
@@ -429,9 +426,13 @@ class PluginManager(Screen, DreamInfoHandler):
                                        self["status"].setText(_("There are at least ") + str(iSoftwareTools.available_updates) + _(" updates available."))
                                else:
                                        self["status"].setText(_("There are no updates available."))
+                               self.rebuildList()
                        elif retval is False:
-                               self["status"].setText(_("No network connection available."))
-                       self.rebuildList()
+                               self.setState('error')
+                               if iSoftwareTools.NetworkConnectionAvailable:
+                                       self["status"].setText(_("Updatefeed not available."))
+                               else:
+                                       self["status"].setText(_("No network connection available."))
 
        def rebuildList(self, retval = None):
                if self.currentSelectedTag is None:
@@ -1701,15 +1702,11 @@ def startSetup(menuid):
                return [ ]
        return [(_("Software management"), UpgradeMain, "software_manager", 50)]
 
-def autostart(reason, **kwargs):
-       if reason is True:
-               iSoftwareTools.startSoftwareTools()
 
 def Plugins(path, **kwargs):
        global plugin_path
        plugin_path = path
        list = [
-               PluginDescriptor(where = [PluginDescriptor.WHERE_NETWORKCONFIG_READ], fnc = autostart),
                PluginDescriptor(name=_("Software management"), description=_("Manage your receiver's software"), where = PluginDescriptor.WHERE_MENU, fnc=startSetup),
                PluginDescriptor(name=_("Ipkg"), where = PluginDescriptor.WHERE_FILESCAN, fnc = filescan)
        ]