mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-16 03:38:50 +01:00
commit
b82cffd837
@ -122,12 +122,20 @@ class SoundPage(Page):
|
|||||||
|
|
||||||
self._MySlider.Init()
|
self._MySlider.Init()
|
||||||
|
|
||||||
m = alsaaudio.Mixer()
|
try:
|
||||||
self._MySlider.SetValue(m.getvolume()[0])
|
m = alsaaudio.Mixer()
|
||||||
|
self._MySlider.SetValue(m.getvolume()[0])
|
||||||
|
except Exception,e:
|
||||||
|
print(str(e))
|
||||||
|
self._MySlider.SetValue(0)
|
||||||
|
|
||||||
|
|
||||||
def OnLoadCb(self):
|
def OnLoadCb(self):
|
||||||
m = alsaaudio.Mixer()
|
try:
|
||||||
self._MySlider.SetValue(m.getvolume()[0])
|
m = alsaaudio.Mixer()
|
||||||
|
self._MySlider.SetValue(m.getvolume()[0])
|
||||||
|
except Exception,e:
|
||||||
|
print(str(e))
|
||||||
|
|
||||||
def WhenSliderDrag(self,value): ##value 0-100
|
def WhenSliderDrag(self,value): ##value 0-100
|
||||||
if value < 0 or value > 100:
|
if value < 0 or value > 100:
|
||||||
|
|||||||
@ -472,7 +472,7 @@ class MainScreen(object):
|
|||||||
|
|
||||||
elif self.IsExecPackage(_dir+"/"+i):
|
elif self.IsExecPackage(_dir+"/"+i):
|
||||||
iconitem._MyType = ICON_TYPES["EXE"]
|
iconitem._MyType = ICON_TYPES["EXE"]
|
||||||
iconitem._CmdPath = _dir+"/"+i+"/"+i2+".sh"
|
iconitem._CmdPath = os.path.realpath(_dir+"/"+i+"/"+i2+".sh")
|
||||||
MakeExecutable(iconitem._CmdPath)
|
MakeExecutable(iconitem._CmdPath)
|
||||||
cur_page._Icons.append(iconitem)
|
cur_page._Icons.append(iconitem)
|
||||||
else:
|
else:
|
||||||
@ -488,7 +488,7 @@ class MainScreen(object):
|
|||||||
|
|
||||||
#cmd = ReadTheFileContent(_dir+"/"+i)
|
#cmd = ReadTheFileContent(_dir+"/"+i)
|
||||||
iconitem = IconItem()
|
iconitem = IconItem()
|
||||||
iconitem._CmdPath = _dir+"/"+i
|
iconitem._CmdPath = os.path.realpath(_dir+"/"+i)
|
||||||
MakeExecutable(iconitem._CmdPath)
|
MakeExecutable(iconitem._CmdPath)
|
||||||
iconitem._MyType = ICON_TYPES["EXE"]
|
iconitem._MyType = ICON_TYPES["EXE"]
|
||||||
if FileExists( SkinMap( _dir+"/"+ReplaceSuffix(i2,"png"))):
|
if FileExists( SkinMap( _dir+"/"+ReplaceSuffix(i2,"png"))):
|
||||||
@ -517,7 +517,6 @@ class MainScreen(object):
|
|||||||
pygame.time.delay(1000)
|
pygame.time.delay(1000)
|
||||||
cmdpath = cmdpath.strip()
|
cmdpath = cmdpath.strip()
|
||||||
cmdpath = CmdClean(cmdpath)
|
cmdpath = CmdClean(cmdpath)
|
||||||
|
|
||||||
pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
|
pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
|
||||||
|
|
||||||
def OnExitCb(self,event):
|
def OnExitCb(self,event):
|
||||||
|
|||||||
@ -95,8 +95,12 @@ class TitleBar:
|
|||||||
return ge
|
return ge
|
||||||
|
|
||||||
def SyncSoundVolume(self):
|
def SyncSoundVolume(self):
|
||||||
m = alsaaudio.Mixer()
|
try:
|
||||||
vol = m.getvolume()[0]
|
m = alsaaudio.Mixer()
|
||||||
|
vol = m.getvolume()[0]
|
||||||
|
except Exception,e:
|
||||||
|
print(str(e))
|
||||||
|
vol = 0
|
||||||
|
|
||||||
snd_segs = [ [0,10],[10,30],[30,70],[70,100] ]
|
snd_segs = [ [0,10],[10,30],[30,70],[70,100] ]
|
||||||
|
|
||||||
|
|||||||
@ -189,8 +189,9 @@ def InspectionTeam(main_screen):
|
|||||||
content = f.readlines()
|
content = f.readlines()
|
||||||
content = [x.strip() for x in content]
|
content = [x.strip() for x in content]
|
||||||
brt=int(content[0])
|
brt=int(content[0])
|
||||||
if brt != 1 and brt > 0:
|
if brt > 0:
|
||||||
last_brt = brt ## remember brt for restore
|
if last_brt < 0:
|
||||||
|
last_brt = brt ## remember brt for restore
|
||||||
|
|
||||||
brt = 1
|
brt = 1
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
@ -283,7 +284,8 @@ def event_process(event,main_screen):
|
|||||||
pygame.quit()
|
pygame.quit()
|
||||||
gobject_main_loop.quit()
|
gobject_main_loop.quit()
|
||||||
os.chdir( GetExePath())
|
os.chdir( GetExePath())
|
||||||
exec_app_cmd = event.message
|
exec_app_cmd = "cd "+os.path.dirname(event.message)+";"
|
||||||
|
exec_app_cmd += event.message
|
||||||
exec_app_cmd += "; sync & cd "+GetExePath()+"; exec python "+myscriptname
|
exec_app_cmd += "; sync & cd "+GetExePath()+"; exec python "+myscriptname
|
||||||
print(exec_app_cmd)
|
print(exec_app_cmd)
|
||||||
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)
|
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)
|
||||||
@ -300,7 +302,8 @@ def event_process(event,main_screen):
|
|||||||
pygame.quit()
|
pygame.quit()
|
||||||
gobject_main_loop.quit()
|
gobject_main_loop.quit()
|
||||||
os.chdir( GetExePath())
|
os.chdir( GetExePath())
|
||||||
exec_app_cmd = event.message
|
exec_app_cmd = "cd "+os.path.dirname(event.message)+";"
|
||||||
|
exec_app_cmd += event.message
|
||||||
exec_app_cmd += "; sync & cd "+GetExePath()+"; exec python "+myscriptname
|
exec_app_cmd += "; sync & cd "+GetExePath()+"; exec python "+myscriptname
|
||||||
print(exec_app_cmd)
|
print(exec_app_cmd)
|
||||||
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)
|
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user