mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-16 19:58:51 +01:00
update 10_Settings/Update
This commit is contained in:
parent
f7976d4406
commit
fc099786fe
@ -9,7 +9,7 @@ import gobject
|
|||||||
|
|
||||||
## local UI import
|
## local UI import
|
||||||
from UI.page import Page
|
from UI.page import Page
|
||||||
from UI.constants import ICON_TYPES,Width,Height,RUNEVT
|
from UI.constants import ICON_TYPES,Width,Height,RUNEVT,RUNSH
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
@ -118,8 +118,8 @@ class UpdateConfirmPage(ConfirmPage):
|
|||||||
|
|
||||||
if event.key == CurKeys["B"]:
|
if event.key == CurKeys["B"]:
|
||||||
if self._GIT == True:
|
if self._GIT == True:
|
||||||
cmdpath = "feh --bg-center %s/sys.py/gameshell/wallpaper/updating.png; cd %s ;git pull; git reset --hard %s ; feh --bg-center %s/sys.py/gameshell/wallpaper/loading.png " % (LauncherLoc,LauncherLoc,self._Version,LauncherLoc)
|
cmdpath = "%s/update.sh %s" % (LauncherLoc,self._Version)
|
||||||
pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
|
pygame.event.post( pygame.event.Event(RUNSH, message=cmdpath))
|
||||||
self._GIT = False
|
self._GIT = False
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@ -37,10 +37,10 @@ DT = pygame.time.Clock().tick(30) # fps in ms,eg:50
|
|||||||
GMEVT = pygame.USEREVENT+1
|
GMEVT = pygame.USEREVENT+1
|
||||||
update_titlebar_event = pygame.event.Event(GMEVT, message="titlebar")
|
update_titlebar_event = pygame.event.Event(GMEVT, message="titlebar")
|
||||||
|
|
||||||
RUNEVT = pygame.USEREVENT+2
|
RUNEVT = pygame.USEREVENT+2
|
||||||
RUNSYS = pygame.USEREVENT+3
|
RUNSYS = pygame.USEREVENT+3
|
||||||
LOWLIGHT = pygame.USEREVENT+4 ## when dim screen backlight
|
LOWLIGHT = pygame.USEREVENT+4 ## when dim screen backlight
|
||||||
FOOTMSG = pygame.USEREVENT+5 ##
|
FOOTMSG = pygame.USEREVENT+5 ##
|
||||||
POWEROPT = pygame.USEREVENT+6
|
POWEROPT = pygame.USEREVENT+6
|
||||||
RESTARTUI = pygame.USEREVENT+7 ##restart launcher
|
RESTARTUI = pygame.USEREVENT+7 ##restart launcher
|
||||||
|
RUNSH = pygame.USEREVENT+8
|
||||||
|
|||||||
@ -31,7 +31,7 @@ else:
|
|||||||
|
|
||||||
|
|
||||||
#local UI import
|
#local UI import
|
||||||
from UI.constants import Width,Height,bg_color,icon_width,icon_height,DT,GMEVT,RUNEVT,RUNSYS,ICON_TYPES,POWEROPT,RESTARTUI
|
from UI.constants import Width,Height,bg_color,icon_width,icon_height,DT,GMEVT,RUNEVT,RUNSYS,ICON_TYPES,POWEROPT,RESTARTUI,RUNSH
|
||||||
from UI.util_funcs import ReplaceSuffix,FileExists, ReadTheFileContent,midRect,color_surface,SwapAndShow,GetExePath,X_center_mouse
|
from UI.util_funcs import ReplaceSuffix,FileExists, ReadTheFileContent,midRect,color_surface,SwapAndShow,GetExePath,X_center_mouse
|
||||||
from UI.page import PageStack,PageSelector,Page
|
from UI.page import PageStack,PageSelector,Page
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
@ -353,6 +353,13 @@ def event_process(event,main_screen):
|
|||||||
os.chdir( GetExePath())
|
os.chdir( GetExePath())
|
||||||
os.exelp("python","python"," "+myscriptname)
|
os.exelp("python","python"," "+myscriptname)
|
||||||
return
|
return
|
||||||
|
if event.type == RUNSH:
|
||||||
|
pygame.quit()
|
||||||
|
gobject_main_loop.quit()
|
||||||
|
exec_app_cmd = event.message +";"
|
||||||
|
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)
|
||||||
|
sys.exit(-1)
|
||||||
|
return
|
||||||
if event.type == POWEROPT:
|
if event.type == POWEROPT:
|
||||||
everytime_keydown = time.time()
|
everytime_keydown = time.time()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user