mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-16 11:48:50 +01:00
Merge pull request #45 from cuu/master
bug fix in count down screen and music player
This commit is contained in:
commit
9cb2e08343
@ -137,6 +137,7 @@ class MainScreen(object):
|
|||||||
_IconFont = fonts["varela15"]
|
_IconFont = fonts["varela15"]
|
||||||
_SkinManager = None
|
_SkinManager = None
|
||||||
|
|
||||||
|
_Closed = False
|
||||||
_CounterScreen = None
|
_CounterScreen = None
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -349,6 +350,8 @@ class MainScreen(object):
|
|||||||
self._CanvasHWND.fill((255,255,255))
|
self._CanvasHWND.fill((255,255,255))
|
||||||
|
|
||||||
def SwapAndShow(self):
|
def SwapAndShow(self):
|
||||||
|
if self._Closed == True:
|
||||||
|
return
|
||||||
if self._HWND != None:
|
if self._HWND != None:
|
||||||
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width,self._Height))
|
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width,self._Height))
|
||||||
pygame.display.update()
|
pygame.display.update()
|
||||||
@ -363,6 +366,15 @@ class MainScreen(object):
|
|||||||
else:
|
else:
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
def IsExecPackage(self,dirname):
|
||||||
|
files = os.listdir(dirname)
|
||||||
|
bname = os.path.basename(dirname)
|
||||||
|
bname = self.ExtraName(bname)
|
||||||
|
for i in sorted(files):
|
||||||
|
if i == bname+".sh":
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def IsEmulatorPackage(self,dirname):
|
def IsEmulatorPackage(self,dirname):
|
||||||
files = os.listdir(dirname)
|
files = os.listdir(dirname)
|
||||||
for i in sorted(files):
|
for i in sorted(files):
|
||||||
@ -396,7 +408,9 @@ class MainScreen(object):
|
|||||||
iconitem = IconItem()
|
iconitem = IconItem()
|
||||||
iconitem._CmdPath = ""
|
iconitem._CmdPath = ""
|
||||||
iconitem.AddLabel(i2,self._IconFont)
|
iconitem.AddLabel(i2,self._IconFont)
|
||||||
if FileExists( SkinMap(_dir+"/"+i2+".png") ):
|
if FileExists( _dir+"/"+i+"/"+i2+".png"): ### 20_Prog/Prog.png , cut 20_
|
||||||
|
iconitem._ImageName = _dir+"/"+i+"/"+i2+".png"
|
||||||
|
elif FileExists( SkinMap(_dir+"/"+i2+".png") ):
|
||||||
iconitem._ImageName = SkinMap(_dir+"/"+i2+".png")
|
iconitem._ImageName = SkinMap(_dir+"/"+i2+".png")
|
||||||
else:
|
else:
|
||||||
untitled = UntitledIcon()
|
untitled = UntitledIcon()
|
||||||
@ -456,6 +470,11 @@ class MainScreen(object):
|
|||||||
iconitem._MyType = ICON_TYPES["Emulator"]
|
iconitem._MyType = ICON_TYPES["Emulator"]
|
||||||
cur_page._Icons.append(iconitem)
|
cur_page._Icons.append(iconitem)
|
||||||
|
|
||||||
|
elif self.IsExecPackage(_dir+"/"+i):
|
||||||
|
iconitem._MyType = ICON_TYPES["EXE"]
|
||||||
|
iconitem._CmdPath = _dir+"/"+i+"/"+i2+".sh"
|
||||||
|
MakeExecutable(iconitem._CmdPath)
|
||||||
|
cur_page._Icons.append(iconitem)
|
||||||
else:
|
else:
|
||||||
iconitem._MyType = ICON_TYPES["DIR"]
|
iconitem._MyType = ICON_TYPES["DIR"]
|
||||||
iconitem._LinkPage = Page()
|
iconitem._LinkPage = Page()
|
||||||
@ -541,6 +560,9 @@ class MainScreen(object):
|
|||||||
self._MsgBox.Draw()
|
self._MsgBox.Draw()
|
||||||
|
|
||||||
def Draw(self):
|
def Draw(self):
|
||||||
|
if self._Closed == True:
|
||||||
|
return
|
||||||
|
|
||||||
self._CurrentPage.Draw()
|
self._CurrentPage.Draw()
|
||||||
#if self._HWND != None:
|
#if self._HWND != None:
|
||||||
# self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width,self._Height))
|
# self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width,self._Height))
|
||||||
|
|||||||
@ -12,7 +12,7 @@ MPD_socket = "/tmp/mpd.socket"
|
|||||||
|
|
||||||
UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/CPI/master/launcher_ver.json"
|
UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/CPI/master/launcher_ver.json"
|
||||||
|
|
||||||
VERSION="stable 1.0"
|
VERSION="stable 1.1"
|
||||||
|
|
||||||
SKIN="default"
|
SKIN="default"
|
||||||
|
|
||||||
|
|||||||
@ -119,6 +119,7 @@ def RestoreLastBackLightBrightness(main_screen):
|
|||||||
|
|
||||||
passout_time_stage = 0
|
passout_time_stage = 0
|
||||||
main_screen._TitleBar._InLowBackLight = -1
|
main_screen._TitleBar._InLowBackLight = -1
|
||||||
|
main_screen._Closed = False
|
||||||
|
|
||||||
if gobject_flash_led1 != -1:
|
if gobject_flash_led1 != -1:
|
||||||
gobject.source_remove(gobject_flash_led1)
|
gobject.source_remove(gobject_flash_led1)
|
||||||
@ -220,7 +221,7 @@ def InspectionTeam(main_screen):
|
|||||||
|
|
||||||
|
|
||||||
main_screen._TitleBar._InLowBackLight = 0
|
main_screen._TitleBar._InLowBackLight = 0
|
||||||
|
main_screen._Closed = True
|
||||||
if time_3 != 0:
|
if time_3 != 0:
|
||||||
passout_time_stage = 2 # next
|
passout_time_stage = 2 # next
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user