mirror of
https://github.com/clockworkpi/launcher.git
synced 2026-03-19 02:12:38 +01:00
TitleBar show airplane mode icon
This commit is contained in:
@@ -88,8 +88,6 @@ class AirplanePage(Page):
|
||||
|
||||
_DrawOnce = False
|
||||
_Scroller = None
|
||||
|
||||
_InAirPlaneMode = False
|
||||
|
||||
def __init__(self):
|
||||
Page.__init__(self)
|
||||
@@ -143,22 +141,20 @@ class AirplanePage(Page):
|
||||
self._Scrolled += dis
|
||||
|
||||
def ToggleMode(self):
|
||||
print("ToggleMode")
|
||||
out = commands.getstatusoutput('rfkill list | grep yes | cut -d " " -f3')
|
||||
print out
|
||||
if out[1] == "yes":
|
||||
self._InAirPlaneMode = True
|
||||
|
||||
self._Screen._MsgBox.SetText("Turning On")
|
||||
self._Screen._MsgBox.Draw()
|
||||
commands.getstatusoutput("rfkill unblock all")
|
||||
self._Screen._TitleBar._InAirPlaneMode = False
|
||||
|
||||
else:
|
||||
self._InAirPlaneMode = False
|
||||
self._Screen._MsgBox.SetText("Turning Off")
|
||||
self._Screen._MsgBox.Draw()
|
||||
commands.getstatusoutput("rfkill block all")
|
||||
|
||||
self._Screen._TitleBar._InAirPlaneMode = True
|
||||
|
||||
|
||||
def OnLoadCb(self):
|
||||
self._Scrolled = 0
|
||||
@@ -166,9 +162,9 @@ class AirplanePage(Page):
|
||||
self._DrawOnce = False
|
||||
out = commands.getstatusoutput('rfkill list | grep yes | cut -d " " -f3')
|
||||
if out[1] == "yes":
|
||||
self._InAirPlaneMode = True
|
||||
self._Screen._TitleBar._InAirPlaneMode = True
|
||||
else:
|
||||
self._InAirPlaneMode = False
|
||||
self._Screen._TitleBar._InAirPlaneMode = False
|
||||
|
||||
|
||||
def OnReturnBackCb(self):
|
||||
|
||||
Reference in New Issue
Block a user