NetworkSetup.py : fix checkNetworkCB function to prevent crash error.
[vuplus_dvbapp] / lib / python / Screens / NetworkSetup.py
index 4b15ee0..c2f818b 100755 (executable)
@@ -667,7 +667,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen):
                self["statuspic"].hide()
                
                self.oktext = _("Press OK on your remote control to continue.")
-               self.reboottext = _("Your Dreambox will restart after pressing OK on your remote control.")
+               self.reboottext = _("Your STB will restart after pressing OK on your remote control.")
                self.errortext = _("No working wireless network interface found.\n Please verify that you have attached a compatible WLAN device or enable your local network interface.")
                self.missingwlanplugintxt = _("The wireless LAN plugin is not installed!\nPlease install it.")
                
@@ -796,11 +796,11 @@ class AdapterSetupConfiguration(Screen, HelpableScreen):
 
        def loadDescription(self):
                if self["menulist"].getCurrent()[1] == 'edit':
-                       self["description"].setText(_("Edit the network configuration of your Dreambox.\n" ) + self.oktext )
+                       self["description"].setText(_("Edit the network configuration of your STB.\n" ) + self.oktext )
                if self["menulist"].getCurrent()[1] == 'test':
-                       self["description"].setText(_("Test the network configuration of your Dreambox.\n" ) + self.oktext )
+                       self["description"].setText(_("Test the network configuration of your STB.\n" ) + self.oktext )
                if self["menulist"].getCurrent()[1] == 'dns':
-                       self["description"].setText(_("Edit the Nameserver configuration of your Dreambox.\n" ) + self.oktext )
+                       self["description"].setText(_("Edit the Nameserver configuration of your STB.\n" ) + self.oktext )
                if self["menulist"].getCurrent()[1] == 'scanwlan':
                        self["description"].setText(_("Scan your network for wireless access points and connect to them using your selected wireless device.\n" ) + self.oktext )
                if self["menulist"].getCurrent()[1] == 'wlanstatus':
@@ -960,20 +960,22 @@ class AdapterSetupConfiguration(Screen, HelpableScreen):
                                                iNetwork.checkNetworkState(self.checkNetworkCB)
 
        def checkNetworkCB(self,data):
-               if iNetwork.getAdapterAttribute(self.iface, "up") is True:
-                       if self.LinkState is True:
-                               if data <= 2:
-                                       self["statuspic"].setPixmapNum(0)
+               try:
+                       if iNetwork.getAdapterAttribute(self.iface, "up") is True:
+                               if self.LinkState is True:
+                                       if data <= 2:
+                                               self["statuspic"].setPixmapNum(0)
+                                       else:
+                                               self["statuspic"].setPixmapNum(1)
+                                       self["statuspic"].show()
                                else:
                                        self["statuspic"].setPixmapNum(1)
-                               self["statuspic"].show()        
+                                       self["statuspic"].show()
                        else:
                                self["statuspic"].setPixmapNum(1)
                                self["statuspic"].show()
-               else:
-                       self["statuspic"].setPixmapNum(1)
-                       self["statuspic"].show()
-
+               except:
+                       pass
 
 class NetworkAdapterTest(Screen):      
        def __init__(self, session,iface):