Merge commit 'dm/experimental' into vuplus_experimental
authorikseong <ikseong@vuplus>
Wed, 28 Jul 2010 06:24:51 +0000 (15:24 +0900)
committerikseong <ikseong@vuplus>
Wed, 28 Jul 2010 06:24:51 +0000 (15:24 +0900)
1  2 
lib/python/Screens/NetworkSetup.py

@@@ -702,7 -702,7 +702,7 @@@ class AdapterSetupConfiguration(Screen
                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["WizardActions"] = HelpableActionMap(self, "WizardActions",
                        if self.iface in iNetwork.wlan_interfaces:
                                try:
                                        from Plugins.SystemPlugins.WirelessLan.plugin import WlanScan
-                                       from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless
+                                       from pythonwifi.iwlibs import Wireless
                                except ImportError:
                                        self.session.open(MessageBox, _("The wireless LAN plugin is not installed!\nPlease install it."), type = MessageBox.TYPE_INFO,timeout = 10 )
                                else:
                                        ifobj = Wireless(self.iface) # a Wireless NIC Object
-                                       self.wlanresponse = ifobj.getStatistics()
-                                       if self.wlanresponse[0] != 19: # Wlan Interface found.
-                                               self.session.openWithCallback(self.AdapterSetupClosed, AdapterSetup,self.iface)
+                                       try:
+                                               self.wlanresponse = ifobj.getAPaddr()
+                                       except IOError:
+                                               self.wlanresponse = ifobj.getStatistics()
+                                       if self.wlanresponse:
+                                               if self.wlanresponse[0] not in (19,95): # 19 = 'No such device', 95 = 'Operation not supported'
+                                                       self.session.openWithCallback(self.AdapterSetupClosed, AdapterSetup,self.iface)
+                                               else:
+                                                       # Display Wlan not available Message
+                                                       self.showErrorMessage()
                                        else:
                                                # Display Wlan not available Message
                                                self.showErrorMessage()
                if self["menulist"].getCurrent()[1] == 'scanwlan':
                        try:
                                from Plugins.SystemPlugins.WirelessLan.plugin import WlanScan
-                               from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless
+                               from pythonwifi.iwlibs import Wireless
                        except ImportError:
                                self.session.open(MessageBox, _("The wireless LAN plugin is not installed!\nPlease install it."), type = MessageBox.TYPE_INFO,timeout = 10 )
                        else:
                                ifobj = Wireless(self.iface) # a Wireless NIC Object
-                               self.wlanresponse = ifobj.getStatistics()
-                               if self.wlanresponse[0] != 19:
-                                       self.session.openWithCallback(self.WlanScanClosed, WlanScan, self.iface)
+                               try:
+                                       self.wlanresponse = ifobj.getAPaddr()
+                               except IOError:
+                                       self.wlanresponse = ifobj.getStatistics()
+                               if self.wlanresponse:
+                                       if self.wlanresponse[0] not in (19,95): # 19 = 'No such device', 95 = 'Operation not supported'
+                                               self.session.openWithCallback(self.WlanScanClosed, WlanScan, self.iface)
+                                       else:
+                                               # Display Wlan not available Message
+                                               self.showErrorMessage()
                                else:
                                        # Display Wlan not available Message
                                        self.showErrorMessage()
                if self["menulist"].getCurrent()[1] == 'wlanstatus':
                        try:
                                from Plugins.SystemPlugins.WirelessLan.plugin import WlanStatus
-                               from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless
+                               from pythonwifi.iwlibs import Wireless
                        except ImportError:
                                self.session.open(MessageBox, _("The wireless LAN plugin is not installed!\nPlease install it."), type = MessageBox.TYPE_INFO,timeout = 10 )
                        else:   
                                ifobj = Wireless(self.iface) # a Wireless NIC Object
-                               self.wlanresponse = ifobj.getStatistics()
-                               if self.wlanresponse[0] != 19:
-                                       self.session.openWithCallback(self.WlanStatusClosed, WlanStatus,self.iface)
+                               try:
+                                       self.wlanresponse = ifobj.getAPaddr()
+                               except IOError:
+                                       self.wlanresponse = ifobj.getStatistics()
+                               if self.wlanresponse:
+                                       if self.wlanresponse[0] not in (19,95): # 19 = 'No such device', 95 = 'Operation not supported'
+                                               self.session.openWithCallback(self.WlanStatusClosed, WlanStatus,self.iface)
+                                       else:
+                                               # Display Wlan not available Message
+                                               self.showErrorMessage()
                                else:
                                        # Display Wlan not available Message
                                        self.showErrorMessage()
  
        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':
                        if ret[0] == 'ok' and (self.iface in iNetwork.wlan_interfaces) and iNetwork.getAdapterAttribute(self.iface, "up") is True:
                                try:
                                        from Plugins.SystemPlugins.WirelessLan.plugin import WlanStatus
-                                       from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless
+                                       from pythonwifi.iwlibs import Wireless
                                except ImportError:
                                        self.session.open(MessageBox, _("The wireless LAN plugin is not installed!\nPlease install it."), type = MessageBox.TYPE_INFO,timeout = 10 )
                                else:   
                                        ifobj = Wireless(self.iface) # a Wireless NIC Object
-                                       self.wlanresponse = ifobj.getStatistics()
-                                       if self.wlanresponse[0] != 19:
-                                               self.session.openWithCallback(self.WlanStatusClosed, WlanStatus,self.iface)
+                                       try:
+                                               self.wlanresponse = ifobj.getAPaddr()
+                                       except IOError:
+                                               self.wlanresponse = ifobj.getStatistics()
+                                       if self.wlanresponse:
+                                               if self.wlanresponse[0] not in (19,95): # 19 = 'No such device', 95 = 'Operation not supported'
+                                                       self.session.openWithCallback(self.WlanStatusClosed, WlanStatus,self.iface)
+                                               else:
+                                                       # Display Wlan not available Message
+                                                       self.showErrorMessage()
                                        else:
                                                # Display Wlan not available Message
                                                self.showErrorMessage()
  
        def WlanStatusClosed(self, *ret):
                if ret is not None and len(ret):
-                       from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus,Status
+                       from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus
                        iStatus.stopWlanConsole()
                        self.updateStatusbar()
  
                if ret[0] is not None:
                        self.session.openWithCallback(self.AdapterSetupClosed, AdapterSetup, self.iface,ret[0],ret[1])
                else:
-                       from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus,Status
+                       from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus
                        iStatus.stopWlanConsole()
                        self.updateStatusbar()
                        
@@@ -1335,7 -1363,7 +1363,7 @@@ class NetworkAdapterTest(Screen)
        def getLinkState(self,iface):
                if iface in iNetwork.wlan_interfaces:
                        try:
-                               from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus,Status
+                               from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus
                        except:
                                        self["Network"].setForegroundColorNum(1)
                                        self["Network"].setText(_("disconnected"))
                iNetwork.stopLinkStateConsole()
                iNetwork.stopDNSConsole()
                try:
-                       from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus,Status
+                       from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus
                except ImportError:
                        pass
                else: