add GiveWallpaper to allow the custom wallpaper from any Theme/skin

This commit is contained in:
cuu
2019-07-01 20:30:07 +08:00
parent 528e79648b
commit 4f354f28c2
3 changed files with 24 additions and 6 deletions

View File

@@ -7,6 +7,8 @@ from UI.constants import RUNSYS
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.confirm_page import ConfirmPage
from UI.lang_manager import MyLangManager
from UI.skin_manager import MySkinManager
import config
class PowerOffConfirmPage(ConfirmPage):
@@ -48,9 +50,9 @@ class PowerOffConfirmPage(ConfirmPage):
if IsKeyStartOrA(event.key):
if self.CheckBattery() < 20:
cmdpath = "feh --bg-center gameshell/wallpaper/gameover.png;"
cmdpath = "feh --bg-center %s;" % MySkinManager.GiveWallpaper("gameover.png")
else:
cmdpath = "feh --bg-center gameshell/wallpaper/seeyou.png;"
cmdpath = "feh --bg-center %s;" % MySkinManager.GiveWallpaper("seeyou.png")
cmdpath += "sleep 3;"

View File

@@ -7,6 +7,7 @@ from UI.constants import RUNSYS
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.confirm_page import ConfirmPage
from UI.lang_manager import MyLangManager
from UI.skin_manager import MySkinManager
import config
@@ -49,9 +50,9 @@ class PowerOffConfirmPage(ConfirmPage):
if IsKeyStartOrA(event.key):
if self.CheckBattery() < 20:
cmdpath = "feh --bg-center gameshell/wallpaper/gameover.png;"
cmdpath = "feh --bg-center %s;" % MySkinManager.GiveWallpaper("gameover.png")
else:
cmdpath = "feh --bg-center gameshell/wallpaper/seeyou.png;"
cmdpath = "feh --bg-center %s;" % MySkinManager.GiveWallpaper("seeyou.png")
cmdpath += "sleep 3;"
@@ -61,7 +62,7 @@ class PowerOffConfirmPage(ConfirmPage):
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
if event.key == CurKeys["X"]:
cmdpath = "feh --bg-center gameshell/wallpaper/seeyou.png;"
cmdpath = "feh --bg-center %s;" % MySkinManager.GiveWallpaper("seeyou.png")
cmdpath += "sleep 3;"
cmdpath += "sudo reboot"
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))