remove unneeded (double) close
[enigma2.git] / lib / python / Screens / NetworkSetup.py
index 3d64f522fb822aed3256b01e7115d07b9d6d1b59..0317975851553d6d335884aa4f9ead988d1903b4 100644 (file)
@@ -32,12 +32,13 @@ class NetworkSetup(Screen):
                self["config"] = ConfigList(self.list)
                self.createSetup()
         
                self["config"] = ConfigList(self.list)
                self.createSetup()
         
-               self["introduction"] = Label("Press OK to activate the settings.")
+               self["introduction"] = Label(_("Press OK to activate the settings."))
         
        def createSetup(self):
                self.list = []
         
         
        def createSetup(self):
                self.list = []
         
-               self.list.append(getConfigListEntry(_("Use DHCP"), config.network.dhcp))
+               self.dhcpEntry = getConfigListEntry(_("Use DHCP"), config.network.dhcp)
+               self.list.append(self.dhcpEntry)
                self.list.append(getConfigListEntry(_('IP Address'), config.network.ip))
                if (config.network.dhcp.value == 0):
                        self.list.append(getConfigListEntry(_('Netmask'), config.network.netmask))
                self.list.append(getConfigListEntry(_('IP Address'), config.network.ip))
                if (config.network.dhcp.value == 0):
                        self.list.append(getConfigListEntry(_('Netmask'), config.network.netmask))
@@ -49,7 +50,7 @@ class NetworkSetup(Screen):
         
        def newConfig(self):
                print self["config"].getCurrent()
         
        def newConfig(self):
                print self["config"].getCurrent()
-               if self["config"].getCurrent()[0] == _("Use DHCP"):
+               if self["config"].getCurrent() == self.dhcpEntry:
                        self.createSetup()
 
        def keyLeft(self):
                        self.createSetup()
 
        def keyLeft(self):
@@ -77,4 +78,4 @@ class NetworkSetup(Screen):
                for x in self["config"].list:
                        x[1].cancel()
                iNetwork.loadNetworkConfig()
                for x in self["config"].list:
                        x[1].cancel()
                iNetwork.loadNetworkConfig()
-               self.close()
\ No newline at end of file
+               self.close()