[libvupl] example updated.
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-vuplus / enigma2 / enigma2 / enigma2_vuplus_networksetup_update_ifaces.patch
1 diff --git a/lib/python/Screens/NetworkSetup.py b/lib/python/Screens/NetworkSetup.py
2 index 53301ae..5ceaedd 100755
3 --- a/lib/python/Screens/NetworkSetup.py
4 +++ b/lib/python/Screens/NetworkSetup.py
5 @@ -327,8 +327,6 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen):
6                 self.oktext = _("Press OK on your remote control to continue.")
7                 self.oldInterfaceState = iNetwork.getAdapterAttribute(self.iface, "up")
8  
9 -               self.createConfig()
10 -
11                 self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
12                         {
13                         "cancel": (self.keyCancel, _("exit network adapter configuration")),
14 @@ -347,7 +345,6 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen):
15  
16                 self.list = []
17                 ConfigListScreen.__init__(self, self.list,session = self.session)
18 -               self.createSetup()
19                 self.onLayoutFinish.append(self.layoutFinished)
20                 self.onClose.append(self.cleanup)
21  
22 @@ -375,7 +372,14 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen):
23                 self["HelpWindow"] = Pixmap()
24                 self["HelpWindow"].hide()
25                 
26 -       def layoutFinished(self):
27 +       def updateInterfaces(self,callback = None):
28 +               iNetwork.config_ready = False
29 +               iNetwork.msgPlugins()
30 +               iNetwork.getInterfaces(callback)
31 +
32 +       def updateInterfaceCB(self, ret=None):
33 +               self.createConfig()
34 +               self.createSetup()
35                 self["DNS1"].setText(self.primaryDNS.getText())
36                 self["DNS2"].setText(self.secondaryDNS.getText())
37                 if self.ipConfigEntry.getText() is not None:
38 @@ -404,6 +408,9 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen):
39                         self["Gatewaytext"].setText("")
40                 self["Adapter"].setText(iNetwork.getFriendlyAdapterName(self.iface))
41  
42 +       def layoutFinished(self):
43 +               self.updateInterfaces(self.updateInterfaceCB)
44 +
45         def createConfig(self):
46                 self.InterfaceEntry = None
47                 self.dhcpEntry = None