aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorFraxinas <andreas.frisch@multimedia-labs.de>2008-11-14 16:32:13 +0100
committerFraxinas <andreas.frisch@multimedia-labs.de>2008-11-14 16:32:13 +0100
commit06aa9b9569bdaf23d2d73f75dd7658d7721f4574 (patch)
tree8465c67d209990069810fdfcca474e316a2db493 /lib/python
parent7cd404df03f85b78738c2650b45479e74e093d0b (diff)
parentd2c353af6c84de0958ed56ef817e67f21934f59c (diff)
downloadenigma2-06aa9b9569bdaf23d2d73f75dd7658d7721f4574.tar.gz
enigma2-06aa9b9569bdaf23d2d73f75dd7658d7721f4574.zip
Merge branch 'master' of fraxinas@git.opendreambox.org:/git/enigma2
Diffstat (limited to 'lib/python')
-rwxr-xr-xlib/python/Components/Network.py21
-rwxr-xr-xlib/python/Screens/NetworkSetup.py20
2 files changed, 20 insertions, 21 deletions
diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py
index 7cc61d84..f32a648c 100755
--- a/lib/python/Components/Network.py
+++ b/lib/python/Components/Network.py
@@ -63,6 +63,8 @@ class Network:
def getDataForInterface(self, iface,callback):
#get ip out of ip addr, as avahi sometimes overrides it in ifconfig.
+ if not self.Console:
+ self.Console = Console()
cmd = "ip -o addr"
self.Console.ePopen(cmd, self.IPaddrFinished, [iface,callback])
@@ -212,15 +214,16 @@ class Network:
for ifacename, iface in ifaces.items():
if self.ifaces.has_key(ifacename):
self.ifaces[ifacename]["dhcp"] = iface["dhcp"]
- if len(self.Console.appContainers) == 0:
- # save configured interfacelist
- self.configuredNetworkAdapters = self.configuredInterfaces
- # load ns only once
- self.loadNameserverConfig()
- print "read configured interfac:", ifaces
- print "self.ifaces after loading:", self.ifaces
- if callback is not None:
- callback(True)
+ if self.Console:
+ if len(self.Console.appContainers) == 0:
+ # save configured interfacelist
+ self.configuredNetworkAdapters = self.configuredInterfaces
+ # load ns only once
+ self.loadNameserverConfig()
+ print "read configured interfac:", ifaces
+ print "self.ifaces after loading:", self.ifaces
+ if callback is not None:
+ callback(True)
def loadNameserverConfig(self):
ipRegexp = "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
diff --git a/lib/python/Screens/NetworkSetup.py b/lib/python/Screens/NetworkSetup.py
index 588a46ff..ea2d17e6 100755
--- a/lib/python/Screens/NetworkSetup.py
+++ b/lib/python/Screens/NetworkSetup.py
@@ -88,7 +88,8 @@ class NetworkAdapterSelection(Screen,HelpableScreen):
if len(self.adapters) == 1:
self.onFirstExecBegin.append(self.okbuttonClick)
self.onClose.append(self.cleanup)
-
+
+
def updateList(self):
self.list = []
default_gw = None
@@ -174,6 +175,7 @@ class NetworkAdapterSelection(Screen,HelpableScreen):
def cleanup(self):
iNetwork.stopLinkStateConsole()
iNetwork.stopRestartConsole()
+ iNetwork.stopGetInterfacesConsole()
def restartLan(self):
iNetwork.restartNetwork(self.restartLanDataAvail)
@@ -425,10 +427,10 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen):
if a['active']:
if a['essid'] == "":
a['essid'] = a['bssid']
- self.nwlist.append( a['essid'])
+ self.nwlist.append((a['essid'],a['essid']))
self.nwlist.sort(key = lambda x: x[0])
except:
- self.nwlist.append("No Networks found")
+ self.nwlist.append(("No Networks found",_("No Networks found")))
self.wsconfig = self.ws.loadConfig()
if self.essid is not None: # ssid from wlan scan
@@ -437,10 +439,9 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen):
self.default = self.wsconfig['ssid']
if "hidden..." not in self.nwlist:
- self.nwlist.append("hidden...")
+ self.nwlist.append(("hidden...",_("hidden network")))
if self.default not in self.nwlist:
- self.nwlist.append(self.default)
-
+ self.nwlist.append((self.default,self.default))
config.plugins.wlan.essid = NoSave(ConfigSelection(self.nwlist, default = self.default ))
config.plugins.wlan.hiddenessid = NoSave(ConfigText(default = self.wsconfig['hiddenessid'], visible_width = 50, fixed_size = False))
@@ -650,15 +651,10 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen):
def cancel(self):
if self.oldInterfaceState is False:
- iNetwork.deactivateInterface(self.iface,self.deactivateInterfaceCB)
+ iNetwork.deactivateInterface(self.iface,self.cancelCB)
else:
self.close('cancel')
- def deactivateInterfaceCB(self,data):
- if data is not None:
- if data is True:
- iNetwork.getInterfaces(self.cancelCB)
-
def cancelCB(self,data):
if data is not None:
if data is True: