mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-12 17:58:50 +01:00
Merge pull request #229 from cuu/master
wifi list, FootMsg changes for the buttons layout,bug fix
This commit is contained in:
commit
638f23a8b8
@ -569,7 +569,21 @@ class WifiList(Page):
|
||||
if is_wifi_connected_now() == False:
|
||||
self.ConfigWireless(password_inputed)
|
||||
else:
|
||||
self.ShowBox(MyLangManager.Tr("Disconnect first"))
|
||||
for i in range(0,10):
|
||||
if is_wifi_connected_now() == True:
|
||||
self.ShowBox(MyLangManager.Tr("Launching"))
|
||||
self._Daemon.Disconnect()
|
||||
self._Daemon.SetForcedDisconnect(True)
|
||||
self._Connecting = False
|
||||
else:
|
||||
break
|
||||
|
||||
pygame.time.delay(100)
|
||||
|
||||
if is_wifi_connected_now() == False:
|
||||
self.ConfigWireless(password_inputed)
|
||||
else:
|
||||
self.ShowBox(MyLangManager.Tr("Disconnect first"))
|
||||
|
||||
def OnReturnBackCb(self):
|
||||
pass
|
||||
|
||||
@ -15,6 +15,8 @@ from lang_manager import MyLangManager
|
||||
from widget import Widget
|
||||
from skin_manager import MySkinManager
|
||||
|
||||
import config
|
||||
|
||||
icon_base_path = MySkinManager.GiveIcon("gameshell/footbar_icons/")
|
||||
|
||||
class FootBarIcon(MultiIconItem):
|
||||
@ -134,7 +136,10 @@ class FootBar(Widget):
|
||||
self.Draw()
|
||||
|
||||
def SetLabelTexts(self,texts):
|
||||
barr = ["nav","y","x","b","a","select"]
|
||||
if config.ButtonsLayout == "xbox":
|
||||
barr = ["nav","y","x","b","a","select"]
|
||||
else:
|
||||
barr = ["nav","x","y","a","b","select"]
|
||||
texts2 = texts + [""] if len(texts) == 5 else texts
|
||||
|
||||
for idx,x in enumerate(barr):
|
||||
|
||||
@ -6,9 +6,8 @@ from sys import exit
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
from config import CurKeySet
|
||||
|
||||
import config
|
||||
from config import CurKeySet ## read only
|
||||
|
||||
def GetButtonsLayoutMode():
|
||||
lm = "xbox"
|
||||
@ -25,6 +24,7 @@ def SetButtonsLayoutMode(mode):
|
||||
SetXYABButtons(mode)
|
||||
with open(".buttonslayout", "w") as f:
|
||||
f.write(mode)
|
||||
config.ButtonsLayout = mode
|
||||
|
||||
def SetXYABButtons(mode):
|
||||
if mode == "snes":
|
||||
|
||||
@ -19,6 +19,8 @@ VERSION="stable 1.25"
|
||||
|
||||
SKIN=None
|
||||
|
||||
ButtonsLayout="xbox"
|
||||
|
||||
## three timer values in seconds: dim screen, close screen,PowerOff
|
||||
## zero means no action
|
||||
PowerLevels = {}
|
||||
@ -30,7 +32,7 @@ PowerLevels["balance_saving"] = [40,0,0]
|
||||
PowerLevel = "balance_saving"
|
||||
|
||||
def PreparationInAdv():
|
||||
global SKIN
|
||||
global SKIN,ButtonsLayout
|
||||
global PowerLevel
|
||||
|
||||
if SKIN != None:
|
||||
@ -44,7 +46,16 @@ def PreparationInAdv():
|
||||
|
||||
gameshell_skin = gameshell_skin.strip()
|
||||
SKIN= gameshell_skin
|
||||
|
||||
|
||||
if FileExists(".buttonslayout") == True:
|
||||
with open(".buttonslayout") as f:
|
||||
btnlayout = f.read()
|
||||
|
||||
btnlayout = btnlayout.strip()
|
||||
ButtonsLayout = btnlayout
|
||||
if ButtonsLayout != "xbox" and ButtonsLayout != "snes":
|
||||
ButtonsLayout = "xbox"
|
||||
|
||||
if FileExists(".powerlevel") == False:
|
||||
os.system("touch .powerlevel")
|
||||
|
||||
|
||||
@ -344,7 +344,14 @@ def event_process(event,main_screen):
|
||||
gobject_main_loop.quit()
|
||||
os.chdir( GetExePath())
|
||||
|
||||
exec_app_cmd = "cd "+os.path.dirname(event.message.strip().split(" ")[0])+";"
|
||||
endpos = len(event.message)
|
||||
space_break_pos = endpos
|
||||
for i in range(0,endpos):
|
||||
if event.message[i] == "/" and event.message[i-1] == " " and i > 6:
|
||||
space_break_pos = i-1
|
||||
break
|
||||
|
||||
exec_app_cmd = "cd "+os.path.dirname(event.message[:space_break_pos])+";"
|
||||
exec_app_cmd += event.message
|
||||
exec_app_cmd += "; sync & cd "+GetExePath()+"; exec python "+myscriptname
|
||||
print(exec_app_cmd)
|
||||
@ -363,7 +370,14 @@ def event_process(event,main_screen):
|
||||
pygame.quit()
|
||||
gobject_main_loop.quit()
|
||||
os.chdir( GetExePath())
|
||||
exec_app_cmd = "cd "+os.path.dirname(event.message.strip().split(" ")[0])+";"
|
||||
endpos = len(event.message)
|
||||
space_break_pos = endpos
|
||||
for i in range(0,endpos):
|
||||
if event.message[i] == "/" and event.message[i-1] == " " and i > 6:
|
||||
space_break_pos = i-1
|
||||
break
|
||||
|
||||
exec_app_cmd = "cd "+os.path.dirname(event.message[:space_break_pos])+";"
|
||||
exec_app_cmd += event.message
|
||||
exec_app_cmd += "; sync & cd "+GetExePath()+"; exec python "+myscriptname
|
||||
print(exec_app_cmd)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user