|
@@ -1,5 +1,5 @@
|
|
|
# -*- coding: utf-8 -*-
|
|
|
-import platform
|
|
|
+
|
|
|
import dbus
|
|
|
import dbus.service
|
|
|
import sys
|
|
@@ -24,7 +24,7 @@ import pygame
|
|
|
from sys import exit
|
|
|
import os
|
|
|
|
|
|
-from beeprint import pp
|
|
|
+#from beeprint import pp
|
|
|
########
|
|
|
if getattr(dbus, 'version', (0, 0, 0)) < (0, 80, 0):
|
|
|
import dbus.glib
|
|
@@ -32,10 +32,10 @@ else:
|
|
|
from dbus.mainloop.glib import DBusGMainLoop
|
|
|
DBusGMainLoop(set_as_default=True)
|
|
|
|
|
|
-
|
|
|
+import config
|
|
|
#local UI import
|
|
|
-from UI.constants import Width,Height,bg_color,icon_width,icon_height,DT,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.constants import Width,Height,icon_width,icon_height,DT,RUNEVT,RUNSYS,ICON_TYPES,POWEROPT,RESTARTUI,RUNSH
|
|
|
+from UI.util_funcs import ReplaceSuffix,FileExists, ReadTheFileContent,midRect,color_surface,SwapAndShow,GetExePath,X_center_mouse,ArmSystem
|
|
|
from UI.page import PageStack,PageSelector,Page
|
|
|
from UI.label import Label
|
|
|
from UI.icon_item import IconItem
|
|
@@ -46,10 +46,9 @@ from UI.main_screen import MainScreen
|
|
|
from UI.above_all_patch import SoundPatch
|
|
|
from UI.icon_pool import MyIconPool
|
|
|
from UI.createby_screen import CreateByScreen
|
|
|
-
|
|
|
+from UI.skin_manager import MySkinManager
|
|
|
from libs.DBUS import setup_dbus
|
|
|
|
|
|
-import config
|
|
|
|
|
|
if not pygame.display.get_init():
|
|
|
pygame.display.init()
|
|
@@ -555,7 +554,7 @@ def big_loop():
|
|
|
sound_patch.Init()
|
|
|
#pp(main_screen._Pages[0],True,6)
|
|
|
|
|
|
- screen.fill(bg_color)
|
|
|
+ screen.fill(MySkinManager.GiveColor("White"))
|
|
|
main_screen.Draw()
|
|
|
main_screen.SwapAndShow()
|
|
|
|
|
@@ -571,34 +570,6 @@ def big_loop():
|
|
|
gobject_loop()
|
|
|
|
|
|
|
|
|
-def PreparationInAdv():
|
|
|
-
|
|
|
- if "arm" not in platform.machine():
|
|
|
- return
|
|
|
-
|
|
|
- if FileExists("%s/.gameshell_skin" % os.path.expanduser('~')) == True:
|
|
|
- with open("%s/.gameshell_skin" % os.path.expanduser('~'),"r") as f:
|
|
|
- gameshell_skin = f.read()
|
|
|
-
|
|
|
- gameshell_skin = gameshell_skin.strip()
|
|
|
- config.SKIN= gameshell_skin
|
|
|
-
|
|
|
- if FileExists(".powerlevel") == False:
|
|
|
- os.system("touch .powerlevel")
|
|
|
-
|
|
|
- with open(".powerlevel","r") as f:
|
|
|
- powerlevel = f.read()
|
|
|
-
|
|
|
- powerlevel = powerlevel.strip()
|
|
|
- if powerlevel != "":
|
|
|
- config.PowerLevel = powerlevel
|
|
|
- if powerlevel != "supersaving":
|
|
|
- os.system("sudo iw wlan0 set power_save off >/dev/null")
|
|
|
- else:
|
|
|
- os.system("sudo iw wlan0 set power_save on > /dev/null")
|
|
|
- else:
|
|
|
- os.system("sudo iw wlan0 set power_save off >/dev/null")
|
|
|
-
|
|
|
###MAIN()###
|
|
|
if __name__ == '__main__':
|
|
|
|
|
@@ -614,8 +585,7 @@ if __name__ == '__main__':
|
|
|
pygame.event.set_allowed([pygame.KEYDOWN,pygame.KEYUP,RUNEVT,RUNSYS,POWEROPT,RESTARTUI,RUNSH])
|
|
|
|
|
|
pygame.key.set_repeat(DT+DT*6+DT/2, DT+DT*3+DT/2)
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
MyIconPool.Init()
|
|
|
|
|
|
setup_dbus()
|
|
@@ -632,8 +602,6 @@ if __name__ == '__main__':
|
|
|
exit()
|
|
|
|
|
|
|
|
|
- PreparationInAdv()
|
|
|
-
|
|
|
crt_screen = CreateByScreen()
|
|
|
crt_screen.Init()
|
|
|
crt_screen._HWND = screen
|