|
@@ -1,7 +1,7 @@
|
|
|
# -*- coding: utf-8 -*-
|
|
|
import os
|
|
|
import platform
|
|
|
-from UI.util_funcs import FileExists,ArmSystem
|
|
|
+from UI.util_funcs import FileExists,ArmSystem,ReadTheFileContent
|
|
|
from pyaria2_rpc.pyaria2 import Xmlrpc
|
|
|
|
|
|
CurKeySet = "GameShell" ## >>> PC or GameShell <<<
|
|
@@ -10,6 +10,7 @@ DontLeave = False
|
|
|
|
|
|
BackLight = "/proc/driver/backlight"
|
|
|
Battery = "/sys/class/power_supply/axp20x-battery/uevent"
|
|
|
+FB_Modes = "/sys/class/graphics/fb0/modes"
|
|
|
|
|
|
MPD_socket = "/tmp/mpd.socket"
|
|
|
|
|
@@ -32,8 +33,11 @@ PowerLevels["balance_saving"] = [40,0,0]
|
|
|
|
|
|
PowerLevel = "balance_saving"
|
|
|
|
|
|
+GlobalCanvas=None
|
|
|
+GlobalScale = 1
|
|
|
+
|
|
|
def PreparationInAdv():
|
|
|
- global SKIN,ButtonsLayout
|
|
|
+ global SKIN,ButtonsLayout,FB_Modes,GlobalScale
|
|
|
global PowerLevel
|
|
|
global RPC
|
|
|
if SKIN != None:
|
|
@@ -73,7 +77,16 @@ def PreparationInAdv():
|
|
|
else:
|
|
|
ArmSystem("sudo iw wlan0 set power_save off >/dev/null")
|
|
|
|
|
|
- RPC = Xmlrpc('localhost', 6800)
|
|
|
+ if FileExists(FB_Modes):
|
|
|
+ modes = ReadTheFileContent(FB_Modes)
|
|
|
+ if "320x240" in modes:
|
|
|
+ GlobalScale = 1
|
|
|
+ if "640x480" in modes:
|
|
|
+ GlobalScale = 2
|
|
|
+ if "480x640" in modes:
|
|
|
+ GlobalScale = 2
|
|
|
+
|
|
|
+ RPC = Xmlrpc('localhost', 6800)
|
|
|
PreparationInAdv()
|
|
|
##sys.py/.powerlevel
|
|
|
|