-
Notifications
You must be signed in to change notification settings - Fork 0
/
RestartNetwork.py
27 lines (21 loc) · 1.1 KB
/
RestartNetwork.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from Components.Network import iNetwork
from Screens.MessageBox import MessageBox
from Screens.Screen import Screen
from Components.Label import Label
class RestartNetwork(Screen):
def __init__(self, session):
Screen.__init__(self, session)
skin = '\n <screen name="RestartNetwork" position="center,center" size="600,100" title="Restart Network Adapter">\n <widget name="label" position="10,30" size="500,50" halign="center" font="Regular;20" transparent="1" foregroundColor="white" />\n </screen> '
self.skin = skin
self['label'] = Label(_('Please wait while your network is restarting...'))
self.onShown.append(self.setWindowTitle)
self.onLayoutFinish.append(self.restartLan)
def setWindowTitle(self):
self.setTitle(_('Restart Network Adapter'))
def restartLan(self):
iNetwork.restartNetwork(self.restartLanDataAvail)
def restartLanDataAvail(self, data):
if data is True:
iNetwork.getInterfaces(self.getInterfacesDataAvail)
def getInterfacesDataAvail(self, data):
self.close()