mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-13 10:18:51 +01:00
add launcher and os version in About
This commit is contained in:
parent
4d67c053ff
commit
055ee12867
@ -12,7 +12,7 @@ from libs.roundrects import aa_round_rect
|
|||||||
from UI.constants import Width,Height,ICON_TYPES
|
from UI.constants import Width,Height,ICON_TYPES
|
||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect,FileExists
|
||||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
@ -21,6 +21,8 @@ from UI.multilabel import MultiLabel
|
|||||||
from UI.lang_manager import MyLangManager
|
from UI.lang_manager import MyLangManager
|
||||||
from UI.skin_manager import MySkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
|
from config import VERSION
|
||||||
|
|
||||||
class InfoPageListItem(object):
|
class InfoPageListItem(object):
|
||||||
_PosX = 0
|
_PosX = 0
|
||||||
_PosY = 0
|
_PosY = 0
|
||||||
@ -206,7 +208,32 @@ class AboutPage(Page):
|
|||||||
memory["value"] = str( int(parts[1].strip())/1000.0) +" MB"
|
memory["value"] = str( int(parts[1].strip())/1000.0) +" MB"
|
||||||
self._AList["memory"] = memory
|
self._AList["memory"] = memory
|
||||||
break
|
break
|
||||||
|
|
||||||
|
def LauncherVersion(self):
|
||||||
|
launcher_version = {}
|
||||||
|
launcher_version["key"] = "launcher_ver"
|
||||||
|
launcher_version["label"] = "Launcher:"
|
||||||
|
launcher_version["value"] = VERSION
|
||||||
|
self._AList["launcher_ver"] = launcher_version
|
||||||
|
|
||||||
|
def OsImageVersion(self):
|
||||||
|
if FileExists("/etc/clockworkpi_os_image_version"):
|
||||||
|
try:
|
||||||
|
with open("/etc/clockworkpi_os_image_version") as f:
|
||||||
|
content = f.readlines()
|
||||||
|
content = [x.strip() for x in content]
|
||||||
|
|
||||||
|
except:
|
||||||
|
print("open %s failed" % "/etc/clockworkpi_os_image_version")
|
||||||
|
content = None
|
||||||
|
|
||||||
|
if content != None and len(content) > 0:
|
||||||
|
os_image_ver = {}
|
||||||
|
os_image_ver["key"] = "os_image_ver"
|
||||||
|
os_image_ver["label"] = "OS Image:"
|
||||||
|
os_image_ver["value"] = content[0][:12]
|
||||||
|
self._AList["os_image_ver"] = os_image_ver
|
||||||
|
|
||||||
def GenList(self):
|
def GenList(self):
|
||||||
|
|
||||||
self._MyList = []
|
self._MyList = []
|
||||||
@ -215,7 +242,7 @@ class AboutPage(Page):
|
|||||||
start_y = 10
|
start_y = 10
|
||||||
last_height = 0
|
last_height = 0
|
||||||
|
|
||||||
for i,u in enumerate( ["processor","armcores","cpuscalemhz","features","memory","uname"] ):
|
for i,u in enumerate( ["processor","armcores","cpuscalemhz","features","memory","uname","launcher_ver","os_image_ver"] ):
|
||||||
#for i,u in enumerate( ["processor","cpucores","cpumhz","flags","memory","uname"] ):
|
#for i,u in enumerate( ["processor","cpucores","cpumhz","flags","memory","uname"] ):
|
||||||
if u not in self._AList:
|
if u not in self._AList:
|
||||||
continue
|
continue
|
||||||
@ -266,6 +293,9 @@ class AboutPage(Page):
|
|||||||
self.CpuMhz()
|
self.CpuMhz()
|
||||||
self.Uname()
|
self.Uname()
|
||||||
|
|
||||||
|
self.LauncherVersion()
|
||||||
|
self.OsImageVersion()
|
||||||
|
|
||||||
self.GenList()
|
self.GenList()
|
||||||
|
|
||||||
self._Scroller = ListScroller()
|
self._Scroller = ListScroller()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user