mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-12 17:58:50 +01:00
Merge pull request #183 from cuu/master
fix fds leak and remove SkinMap,fonts.py
This commit is contained in:
commit
a5b10b16be
@ -12,15 +12,14 @@ 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.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
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
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.multilabel import MultiLabel
|
from UI.multilabel import MultiLabel
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
class InfoPageListItem(object):
|
class InfoPageListItem(object):
|
||||||
_PosX = 0
|
_PosX = 0
|
||||||
@ -79,7 +78,7 @@ class InfoPageListItem(object):
|
|||||||
class AboutPage(Page):
|
class AboutPage(Page):
|
||||||
_FootMsg = ["Nav.","","","Back",""]
|
_FootMsg = ["Nav.","","","Back",""]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFontObj = fonts["varela13"]
|
_ListFontObj = MyLangManager.TrFont("varela13")
|
||||||
|
|
||||||
_AList = {}
|
_AList = {}
|
||||||
|
|
||||||
@ -229,7 +228,7 @@ class AboutPage(Page):
|
|||||||
li._PosY = start_y + last_height
|
li._PosY = start_y + last_height
|
||||||
li._Width = Width
|
li._Width = Width
|
||||||
li._Fonts["normal"] = self._ListFontObj
|
li._Fonts["normal"] = self._ListFontObj
|
||||||
li._Fonts["small"] = fonts["varela12"]
|
li._Fonts["small"] = MySkinManager.GiveFont("varela12")
|
||||||
|
|
||||||
if self._AList[u]["label"] != "":
|
if self._AList[u]["label"] != "":
|
||||||
li.Init( self._AList[u]["label"] )
|
li.Init( self._AList[u]["label"] )
|
||||||
|
|||||||
@ -12,7 +12,6 @@ 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.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
|
|||||||
@ -15,7 +15,6 @@ from libs.DBUS import bus, adapter,devices
|
|||||||
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.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
@ -100,8 +99,8 @@ class BleInfoPage(Page):
|
|||||||
_FootMsg = ["Nav","Forget","Disconnect","Back",""]
|
_FootMsg = ["Nav","Forget","Disconnect","Back",""]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFontObj = MyLangManager.TrFont("varela15")
|
_ListFontObj = MyLangManager.TrFont("varela15")
|
||||||
_ListSmFontObj = fonts["varela12"] # small font
|
_ListSmFontObj = MySkinManager.GiveFont("varela12") # small font
|
||||||
_ListSm2FontObj= fonts["varela11"]
|
_ListSm2FontObj= MySkinManager.GiveFont("varela11")
|
||||||
|
|
||||||
_AList = {}
|
_AList = {}
|
||||||
_Path = ""
|
_Path = ""
|
||||||
@ -380,7 +379,7 @@ class BluetoothPage(Page):
|
|||||||
_LastStatusMsg = ""
|
_LastStatusMsg = ""
|
||||||
_FootMsg = ["Nav","Info","Scan","Back","TryConnect"]
|
_FootMsg = ["Nav","Info","Scan","Back","TryConnect"]
|
||||||
_Scroller = None
|
_Scroller = None
|
||||||
_ListFontObj = fonts["notosanscjk15"]
|
_ListFontObj = MyLangManager.TrFont("notosanscjk15")
|
||||||
|
|
||||||
_InfoPage = None
|
_InfoPage = None
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import pygame
|
|||||||
## local UI import
|
## local UI import
|
||||||
from UI.page import Page
|
from UI.page import Page
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.multi_icon_item import MultiIconItem
|
from UI.multi_icon_item import MultiIconItem
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
|
|||||||
@ -10,7 +10,6 @@ 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.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||||
from UI.slider import Slider
|
from UI.slider import Slider
|
||||||
|
|||||||
@ -9,7 +9,6 @@ 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.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, GetButtonsLayoutMode, SetButtonsLayoutMode, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, GetButtonsLayoutMode, SetButtonsLayoutMode, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
@ -117,7 +116,6 @@ class UpdateConfirmPage(ConfirmPage):
|
|||||||
class ButtonsLayoutPage(Page):
|
class ButtonsLayoutPage(Page):
|
||||||
_FootMsg = ["Nav.","","UpdateRetroArch","Back","Toggle"]
|
_FootMsg = ["Nav.","","UpdateRetroArch","Back","Toggle"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFontObj = fonts["varela13"]
|
|
||||||
|
|
||||||
_AList = {}
|
_AList = {}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ from libs.roundrects import aa_round_rect
|
|||||||
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
|
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
|
||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect,FileExists
|
from UI.util_funcs import midRect,FileExists
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
@ -78,7 +77,7 @@ class PageListItem(InfoPageListItem):
|
|||||||
class GateWayPage(Page):
|
class GateWayPage(Page):
|
||||||
_FootMsg = ["Nav","Clear All","","Back","Select"]
|
_FootMsg = ["Nav","Clear All","","Back","Select"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFont = fonts["notosanscjk15"]
|
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||||
|
|
||||||
_AList = {}
|
_AList = {}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ from libs.roundrects import aa_round_rect
|
|||||||
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
|
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
|
||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
@ -77,7 +76,7 @@ class PageListItem(InfoPageListItem):
|
|||||||
class LanguagesPage(Page):
|
class LanguagesPage(Page):
|
||||||
_FootMsg = ["Nav","","","Back","Select"]
|
_FootMsg = ["Nav","","","Back","Select"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFont = fonts["notosanscjk15"]
|
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||||
|
|
||||||
_AList = {}
|
_AList = {}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ from libs.roundrects import aa_round_rect
|
|||||||
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
|
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
|
||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect,FileExists
|
from UI.util_funcs import midRect,FileExists
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
@ -77,7 +76,7 @@ class PageListItem(InfoPageListItem):
|
|||||||
class GPUDriverPage(Page):
|
class GPUDriverPage(Page):
|
||||||
_FootMsg = ["Nav","","","Back","Select"]
|
_FootMsg = ["Nav","","","Back","Select"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFont = fonts["notosanscjk15"]
|
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||||
|
|
||||||
_AList = {}
|
_AList = {}
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,6 @@ 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.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect,FileExists,IsExecutable
|
from UI.util_funcs import midRect,FileExists,IsExecutable
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
@ -126,7 +125,7 @@ class NotificationPage(Page):
|
|||||||
li._PosY = start_y + counter*InfoPageListItem._Height
|
li._PosY = start_y + counter*InfoPageListItem._Height
|
||||||
li._Width = Width-10
|
li._Width = Width-10
|
||||||
li._Fonts["normal"] = self._ListFontObj
|
li._Fonts["normal"] = self._ListFontObj
|
||||||
li._Fonts["small"] = fonts["varela12"]
|
li._Fonts["small"] = MySkinManager.GiveFont("varela12")
|
||||||
|
|
||||||
if IsExecutable(v):
|
if IsExecutable(v):
|
||||||
li._ReadOnly = True
|
li._ReadOnly = True
|
||||||
|
|||||||
@ -12,7 +12,6 @@ from libs.roundrects import aa_round_rect
|
|||||||
from UI.constants import Width,Height,ICON_TYPES,POWEROPT
|
from UI.constants import Width,Height,ICON_TYPES,POWEROPT
|
||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
@ -292,7 +291,7 @@ class InfoPage(Page):
|
|||||||
class PowerOptionsPage(Page):
|
class PowerOptionsPage(Page):
|
||||||
_FootMsg = ["Nav","Detail","","Back","Select"]
|
_FootMsg = ["Nav","Detail","","Back","Select"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFont = fonts["notosanscjk15"]
|
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||||
|
|
||||||
_AList = {}
|
_AList = {}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ from UI.constants import Width,Height,ICON_TYPES
|
|||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||||
from UI.slider import Slider
|
from UI.slider import Slider
|
||||||
|
|||||||
@ -11,7 +11,6 @@ from UI.constants import ICON_TYPES,Width,Height
|
|||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
|
|
||||||
from libs.roundrects import aa_round_rect
|
from libs.roundrects import aa_round_rect
|
||||||
@ -59,7 +58,7 @@ class StoragePage(Page):
|
|||||||
self._BGpng._MyType = ICON_TYPES["STAT"]
|
self._BGpng._MyType = ICON_TYPES["STAT"]
|
||||||
self._BGpng._Parent = self
|
self._BGpng._Parent = self
|
||||||
|
|
||||||
self._BGpng.AddLabel(self._BGmsg % (self._DskUsg[1]-self._DskUsg[0], self._DskUsg[1]), fonts["varela15"])
|
self._BGpng.AddLabel(self._BGmsg % (self._DskUsg[1]-self._DskUsg[0], self._DskUsg[1]), MySkinManager.GiveFont("varela15"))
|
||||||
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||||
|
|
||||||
|
|
||||||
@ -68,12 +67,12 @@ class StoragePage(Page):
|
|||||||
|
|
||||||
usage_percent = (self._DskUsg[0]/self._DskUsg[1] )*100.0
|
usage_percent = (self._DskUsg[0]/self._DskUsg[1] )*100.0
|
||||||
|
|
||||||
self._BGlabel.Init("%d%%"% int(usage_percent),fonts["varela25"])
|
self._BGlabel.Init("%d%%"% int(usage_percent),MySkinManager.GiveFont("varela25"))
|
||||||
self._BGlabel.SetColor( self._HighColor )
|
self._BGlabel.SetColor( self._HighColor )
|
||||||
|
|
||||||
self._FreeLabel = Label()
|
self._FreeLabel = Label()
|
||||||
self._FreeLabel.SetCanvasHWND(self._CanvasHWND)
|
self._FreeLabel.SetCanvasHWND(self._CanvasHWND)
|
||||||
self._FreeLabel.Init("Free",fonts["varela13"])
|
self._FreeLabel.Init("Free",MySkinManager.GiveFont("varela13"))
|
||||||
self._FreeLabel.SetColor(self._BGlabel._Color)
|
self._FreeLabel.SetColor(self._BGlabel._Color)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,6 @@ from libs.roundrects import aa_round_rect
|
|||||||
from UI.constants import ICON_TYPES
|
from UI.constants import ICON_TYPES
|
||||||
from UI.page import Page
|
from UI.page import Page
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.skin_manager import MySkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|||||||
@ -10,7 +10,6 @@ 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.fonts import fonts
|
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
@ -18,7 +17,7 @@ from UI.multi_icon_item import MultiIconItem
|
|||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
from UI.skin_manager import MySkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
from list_item import ListItem
|
from list_item import ListItem
|
||||||
|
|
||||||
|
|
||||||
@ -86,7 +85,7 @@ class TimezoneListPage(Page):
|
|||||||
_FootMsg = ["Nav","","","Back","Select"]
|
_FootMsg = ["Nav","","","Back","Select"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_SwapMyList = []
|
_SwapMyList = []
|
||||||
_ListFont = fonts["notosanscjk15"]
|
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||||
_MyStack = None
|
_MyStack = None
|
||||||
|
|
||||||
_Scroller = None
|
_Scroller = None
|
||||||
@ -189,7 +188,7 @@ class TimezoneListPage(Page):
|
|||||||
self._BGpng._ImgSurf = MyIconPool._Icons["empty"]
|
self._BGpng._ImgSurf = MyIconPool._Icons["empty"]
|
||||||
self._BGpng._MyType = ICON_TYPES["STAT"]
|
self._BGpng._MyType = ICON_TYPES["STAT"]
|
||||||
self._BGpng._Parent = self
|
self._BGpng._Parent = self
|
||||||
self._BGpng.AddLabel("No timezones found on system!", fonts["varela22"])
|
self._BGpng.AddLabel("No timezones found on system!", MyLangManager.TrFont("varela22"))
|
||||||
self._BGpng.SetLableColor(MySkinManager.GiveColor('Disabled'))
|
self._BGpng.SetLableColor(MySkinManager.GiveColor('Disabled'))
|
||||||
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,6 @@ from UI.constants import ICON_TYPES,Width,Height,RUNEVT,RUNSH
|
|||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect,CmdClean,get_git_revision_short_hash
|
from UI.util_funcs import midRect,CmdClean,get_git_revision_short_hash
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.confirm_page import ConfirmPage
|
from UI.confirm_page import ConfirmPage
|
||||||
@ -157,7 +156,7 @@ class UpdatePage(Page):
|
|||||||
_Icons = {}
|
_Icons = {}
|
||||||
_FootMsg = ["Nav","","Check Update","Back",""]
|
_FootMsg = ["Nav","","Check Update","Back",""]
|
||||||
|
|
||||||
_ListFontObj = fonts["varela15"]
|
_ListFontObj = MyLangManager.TrFont("varela15")
|
||||||
_ConfirmPage = None
|
_ConfirmPage = None
|
||||||
_AList = {}
|
_AList = {}
|
||||||
_MyList = []
|
_MyList = []
|
||||||
@ -177,7 +176,7 @@ class UpdatePage(Page):
|
|||||||
li._PosY = start_y + i*InfoPageListItem._Height
|
li._PosY = start_y + i*InfoPageListItem._Height
|
||||||
li._Width = Width
|
li._Width = Width
|
||||||
li._Fonts["normal"] = self._ListFontObj
|
li._Fonts["normal"] = self._ListFontObj
|
||||||
li._Fonts["small"] = fonts["varela12"]
|
li._Fonts["small"] = MySkinManager.GiveFont("varela12")
|
||||||
|
|
||||||
if self._AList[v]["label"] != "":
|
if self._AList[v]["label"] != "":
|
||||||
li.Init( self._AList[v]["label"] )
|
li.Init( self._AList[v]["label"] )
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import pygame
|
|||||||
## local UI import
|
## local UI import
|
||||||
from UI.page import Page
|
from UI.page import Page
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.multi_icon_item import MultiIconItem
|
from UI.multi_icon_item import MultiIconItem
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
|
|||||||
@ -10,7 +10,6 @@ from wicd import misc
|
|||||||
from UI.constants import Width,Height
|
from UI.constants import Width,Height
|
||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect,SwapAndShow
|
from UI.util_funcs import midRect,SwapAndShow
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
@ -94,7 +93,7 @@ class WifiInfoPage(Page):
|
|||||||
li._PosY = start_y + i*InfoPageListItem._Height
|
li._PosY = start_y + i*InfoPageListItem._Height
|
||||||
li._Width = Width
|
li._Width = Width
|
||||||
li._Fonts["normal"] = self._ListFontObj
|
li._Fonts["normal"] = self._ListFontObj
|
||||||
li._Fonts["small"] = fonts["varela12"]
|
li._Fonts["small"] = MyLangManager.TrFont("varela12")
|
||||||
|
|
||||||
if self._AList[v]["label"] != "":
|
if self._AList[v]["label"] != "":
|
||||||
li.Init( self._AList[v]["label"] )
|
li.Init( self._AList[v]["label"] )
|
||||||
@ -267,7 +266,7 @@ class WifiList(Page):
|
|||||||
_FootMsg = ["Nav","Info","Scan","Back","Enter"]
|
_FootMsg = ["Nav","Info","Scan","Back","Enter"]
|
||||||
_EncMethods = None
|
_EncMethods = None
|
||||||
_Scroller = None
|
_Scroller = None
|
||||||
_ListFontObj = fonts["notosanscjk15"]
|
_ListFontObj = MyLangManager.TrFont("notosanscjk15")
|
||||||
|
|
||||||
_InfoPage = None
|
_InfoPage = None
|
||||||
_CurBssid = ""
|
_CurBssid = ""
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import pygame
|
|||||||
## local UI import
|
## local UI import
|
||||||
from UI.page import Page
|
from UI.page import Page
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.lang_manager import MyLangManager
|
from UI.lang_manager import MyLangManager
|
||||||
# a item for List
|
# a item for List
|
||||||
# - - - - - - - - - - - --
|
# - - - - - - - - - - - --
|
||||||
|
|||||||
@ -9,7 +9,6 @@ from libs.roundrects import aa_round_rect
|
|||||||
from UI.constants import Width,Height
|
from UI.constants import Width,Height
|
||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect,FileExists
|
from UI.util_funcs import midRect,FileExists
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
|
|||||||
@ -7,7 +7,6 @@ from libs.roundrects import aa_round_rect
|
|||||||
from UI.constants import ICON_TYPES
|
from UI.constants import ICON_TYPES
|
||||||
from UI.page import Page
|
from UI.page import Page
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.skin_manager import MySkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|||||||
@ -15,12 +15,12 @@ from beeprint import pp
|
|||||||
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.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
from UI.skin_manager import MySkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
@ -79,8 +79,8 @@ class MPDSpectrumPage(Page):
|
|||||||
_Selector=None
|
_Selector=None
|
||||||
_FootMsg = ["Nav","","","Back",""]
|
_FootMsg = ["Nav","","","Back",""]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFont = fonts["veramono12"]
|
_ListFont = MyLangManager.TrFont("veramono12")
|
||||||
_SongFont = fonts["notosanscjk12"]
|
_SongFont = MyLangManager.TrFont("notosanscjk12")
|
||||||
_PIFI = None
|
_PIFI = None
|
||||||
_FIFO = None
|
_FIFO = None
|
||||||
_Color = MySkinManager.GiveColor('Front')
|
_Color = MySkinManager.GiveColor('Front')
|
||||||
|
|||||||
@ -8,7 +8,6 @@ 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.fonts import fonts
|
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
@ -85,7 +84,7 @@ class MusicLibListPage(Page):
|
|||||||
_FootMsg = ["Nav","","Scan","Back","Add to Playlist"]
|
_FootMsg = ["Nav","","Scan","Back","Add to Playlist"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_SwapMyList = []
|
_SwapMyList = []
|
||||||
_ListFont = fonts["notosanscjk15"]
|
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||||
_MyStack = None
|
_MyStack = None
|
||||||
|
|
||||||
_Scroller = None
|
_Scroller = None
|
||||||
|
|||||||
@ -10,7 +10,6 @@ from UI.constants import Width,Height,ICON_TYPES
|
|||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
@ -63,7 +62,7 @@ class PlayListPage(Page):
|
|||||||
_Selector=None
|
_Selector=None
|
||||||
_FootMsg = ["Nav","Remove","RTA","Back","Play/Pause"]
|
_FootMsg = ["Nav","Remove","RTA","Back","Play/Pause"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFont = fonts["notosanscjk15"]
|
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||||
|
|
||||||
_Scroller = None
|
_Scroller = None
|
||||||
_CurSongTime="0:0"
|
_CurSongTime="0:0"
|
||||||
|
|||||||
@ -6,7 +6,6 @@ from UI.constants import Width,Height,ICON_TYPES
|
|||||||
from UI.simple_name_space import SimpleNamespace
|
from UI.simple_name_space import SimpleNamespace
|
||||||
from UI.page import Page
|
from UI.page import Page
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||||
@ -19,7 +18,7 @@ class TinyCloudPage(Page):
|
|||||||
_FootMsg = ["Nav","","","Back",""]
|
_FootMsg = ["Nav","","","Back",""]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
|
|
||||||
_ListFontObj = fonts["varela13"]
|
_ListFontObj = MyLangManager.TrFont("varela13")
|
||||||
|
|
||||||
_AList = {}
|
_AList = {}
|
||||||
_Labels = {}
|
_Labels = {}
|
||||||
|
|||||||
@ -27,7 +27,6 @@ from UI.constants import Width,Height,ICON_TYPES,RUNEVT,RESTARTUI
|
|||||||
#from UI.simple_name_space import SimpleNamespace
|
#from UI.simple_name_space import SimpleNamespace
|
||||||
from UI.page import Page
|
from UI.page import Page
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
from UI.keys_def import CurKeys
|
from UI.keys_def import CurKeys
|
||||||
|
|||||||
@ -11,7 +11,6 @@ from UI.constants import Width,Height,ICON_TYPES,RUNEVT
|
|||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect,CmdClean,FileExists
|
from UI.util_funcs import midRect,CmdClean,FileExists
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.multi_icon_item import MultiIconItem
|
from UI.multi_icon_item import MultiIconItem
|
||||||
@ -94,7 +93,7 @@ class FavListPage(Page):
|
|||||||
_Selector=None
|
_Selector=None
|
||||||
_FootMsg = ["Nav","Remove","Scan","","Run"]
|
_FootMsg = ["Nav","Remove","Scan","","Run"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFont = fonts["notosanscjk15"]
|
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||||
_MyStack = None
|
_MyStack = None
|
||||||
_Emulator = None
|
_Emulator = None
|
||||||
_Parent = None
|
_Parent = None
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import os
|
|||||||
from UI.constants import ICON_TYPES
|
from UI.constants import ICON_TYPES
|
||||||
from UI.page import Page
|
from UI.page import Page
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.skin_manager import MySkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|||||||
@ -18,7 +18,6 @@ from UI.constants import Width,Height,ICON_TYPES,RUNEVT
|
|||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect,CmdClean,FileExists
|
from UI.util_funcs import midRect,CmdClean,FileExists
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.multi_icon_item import MultiIconItem
|
from UI.multi_icon_item import MultiIconItem
|
||||||
@ -101,7 +100,7 @@ class RomListPage(Page):
|
|||||||
_Selector=None
|
_Selector=None
|
||||||
_FootMsg = ["Nav","Del","Scan","Back","Run","AddFav"]
|
_FootMsg = ["Nav","Del","Scan","Back","Run","AddFav"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFont = fonts["notosanscjk15"]
|
_ListFont = MyLangManager.Tr("notosanscjk15")
|
||||||
_MyStack = None
|
_MyStack = None
|
||||||
_Emulator = None
|
_Emulator = None
|
||||||
_Parent = None
|
_Parent = None
|
||||||
|
|||||||
@ -15,7 +15,6 @@ from libs.roundrects import aa_round_rect
|
|||||||
from UI.confirm_page import ConfirmPage
|
from UI.confirm_page import ConfirmPage
|
||||||
from UI.download_process_page import DownloadProcessPage
|
from UI.download_process_page import DownloadProcessPage
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.multilabel import MultiLabel
|
from UI.multilabel import MultiLabel
|
||||||
from UI.lang_manager import MyLangManager
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
|
|||||||
@ -14,10 +14,10 @@ from title_bar import TitleBar
|
|||||||
from foot_bar import FootBar
|
from foot_bar import FootBar
|
||||||
from constants import Width,Height,bg_color
|
from constants import Width,Height,bg_color
|
||||||
from util_funcs import midRect
|
from util_funcs import midRect
|
||||||
from fonts import fonts
|
|
||||||
from keys_def import CurKeys
|
from keys_def import CurKeys
|
||||||
from label import Label
|
from label import Label
|
||||||
from skin_manager import MySkinManager
|
from skin_manager import MySkinManager
|
||||||
|
from lang_manager import MyLangManager
|
||||||
from widget import Widget
|
from widget import Widget
|
||||||
|
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ class AboveAllPatch(Widget):
|
|||||||
_Height=120
|
_Height=120
|
||||||
|
|
||||||
_Text =""
|
_Text =""
|
||||||
_FontObj=fonts["veramono20"]
|
_FontObj= MyLangManager.TrFont("veramono20")
|
||||||
_Parent =None
|
_Parent =None
|
||||||
_Color = MySkinManager.GiveColor('Text')
|
_Color = MySkinManager.GiveColor('Text')
|
||||||
_ValColor = MySkinManager.GiveColor('URL')
|
_ValColor = MySkinManager.GiveColor('URL')
|
||||||
|
|||||||
@ -9,7 +9,6 @@ from libs.roundrects import aa_round_rect
|
|||||||
from constants import Width,Height,ICON_TYPES
|
from constants import Width,Height,ICON_TYPES
|
||||||
from page import Page,PageSelector
|
from page import Page,PageSelector
|
||||||
from label import Label
|
from label import Label
|
||||||
from fonts import fonts
|
|
||||||
from util_funcs import midRect
|
from util_funcs import midRect
|
||||||
from keys_def import CurKeys
|
from keys_def import CurKeys
|
||||||
from skin_manager import MySkinManager
|
from skin_manager import MySkinManager
|
||||||
|
|||||||
@ -6,17 +6,18 @@ import commands
|
|||||||
## local package import
|
## local package import
|
||||||
from constants import Width,Height,RUNSYS
|
from constants import Width,Height,RUNSYS
|
||||||
from label import Label
|
from label import Label
|
||||||
from fonts import fonts
|
|
||||||
from full_screen import FullScreen
|
from full_screen import FullScreen
|
||||||
from skin_manager import MySkinManager
|
from skin_manager import MySkinManager
|
||||||
|
from lang_manager import MyLangManager
|
||||||
|
|
||||||
import config
|
import config
|
||||||
|
|
||||||
class CounterScreen(FullScreen):
|
class CounterScreen(FullScreen):
|
||||||
|
|
||||||
_CounterFont = fonts["varela120"]
|
_CounterFont = MyLangManager.TrFont("varela120")
|
||||||
_TextFont1 = fonts["varela15"]
|
_TextFont1 = MyLangManager.TrFont("varela15")
|
||||||
_TextFont2 = fonts["varela12"]
|
_TextFont2 = MyLangManager.TrFont("varela12")
|
||||||
|
|
||||||
_TopLabel = None
|
_TopLabel = None
|
||||||
_BottomLabel = None
|
_BottomLabel = None
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import shutil
|
|||||||
from constants import Width,Height,ICON_TYPES
|
from constants import Width,Height,ICON_TYPES
|
||||||
from page import Page,PageSelector
|
from page import Page,PageSelector
|
||||||
from label import Label
|
from label import Label
|
||||||
from fonts import fonts
|
|
||||||
from util_funcs import midRect
|
from util_funcs import midRect
|
||||||
from keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from confirm_page import ConfirmPage
|
from confirm_page import ConfirmPage
|
||||||
|
|||||||
@ -13,7 +13,6 @@ from UI.constants import Width,Height,ICON_TYPES,RUNEVT
|
|||||||
from UI.page import Page,PageSelector
|
from UI.page import Page,PageSelector
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect,CmdClean,FileExists
|
from UI.util_funcs import midRect,CmdClean,FileExists
|
||||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||||
from UI.multi_icon_item import MultiIconItem
|
from UI.multi_icon_item import MultiIconItem
|
||||||
|
|||||||
@ -1,67 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import pygame
|
|
||||||
from pygame.locals import *
|
|
||||||
from sys import exit
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
import config
|
|
||||||
|
|
||||||
if not pygame.font.get_init():
|
|
||||||
pygame.font.init()
|
|
||||||
|
|
||||||
fonts = {}
|
|
||||||
if not fonts:
|
|
||||||
skinpath = "../skin/"+config.SKIN+"/truetype"
|
|
||||||
fonts_path = {}
|
|
||||||
|
|
||||||
fonts_path["varela"] = "%s/VarelaRound-Regular.ttf" % skinpath
|
|
||||||
fonts_path["veramono"] = "%s/VeraMono.ttf" % skinpath
|
|
||||||
fonts_path["noto"] = "%s/NotoSansMono-Regular.ttf" % skinpath
|
|
||||||
fonts_path["notocjk"] = "%s/NotoSansCJK-Regular.ttf" % skinpath
|
|
||||||
|
|
||||||
fonts["varela10"] = pygame.font.Font(fonts_path["varela"],10)
|
|
||||||
fonts["varela11"] = pygame.font.Font(fonts_path["varela"],11)
|
|
||||||
fonts["varela12"] = pygame.font.Font(fonts_path["varela"],12)
|
|
||||||
fonts["varela13"] = pygame.font.Font(fonts_path["varela"],13)
|
|
||||||
fonts["varela14"] = pygame.font.Font(fonts_path["varela"],14)
|
|
||||||
fonts["varela15"] = pygame.font.Font(fonts_path["varela"],15)
|
|
||||||
|
|
||||||
fonts["varela16"] = pygame.font.Font(fonts_path["varela"],16)
|
|
||||||
fonts["varela18"] = pygame.font.Font(fonts_path["varela"],18)
|
|
||||||
fonts["varela20"] = pygame.font.Font(fonts_path["varela"],20)
|
|
||||||
fonts["varela22"] = pygame.font.Font(fonts_path["varela"],22)
|
|
||||||
fonts["varela23"] = pygame.font.Font(fonts_path["varela"],23)
|
|
||||||
fonts["varela24"] = pygame.font.Font(fonts_path["varela"],24)
|
|
||||||
fonts["varela25"] = pygame.font.Font(fonts_path["varela"],25)
|
|
||||||
fonts["varela26"] = pygame.font.Font(fonts_path["varela"],26)
|
|
||||||
fonts["varela27"] = pygame.font.Font(fonts_path["varela"],27)
|
|
||||||
fonts["varela28"] = pygame.font.Font(fonts_path["varela"],28)
|
|
||||||
fonts["varela34"] = pygame.font.Font(fonts_path["varela"],34)
|
|
||||||
fonts["varela40"] = pygame.font.Font(fonts_path["varela"],40)
|
|
||||||
fonts["varela120"] = pygame.font.Font(fonts_path["varela"],120)
|
|
||||||
|
|
||||||
fonts["veramono25"] = pygame.font.Font(fonts_path["veramono"],25)
|
|
||||||
fonts["veramono24"] = pygame.font.Font(fonts_path["veramono"],24)
|
|
||||||
fonts["veramono23"] = pygame.font.Font(fonts_path["veramono"],23)
|
|
||||||
fonts["veramono22"] = pygame.font.Font(fonts_path["veramono"],22)
|
|
||||||
fonts["veramono21"] = pygame.font.Font(fonts_path["veramono"],21)
|
|
||||||
fonts["veramono20"] = pygame.font.Font(fonts_path["veramono"],20)
|
|
||||||
fonts["veramono18"] = pygame.font.Font(fonts_path["veramono"],18)
|
|
||||||
fonts["veramono16"] = pygame.font.Font(fonts_path["veramono"],16)
|
|
||||||
fonts["veramono15"] = pygame.font.Font(fonts_path["veramono"],15)
|
|
||||||
fonts["veramono14"] = pygame.font.Font(fonts_path["veramono"],14)
|
|
||||||
fonts["veramono13"] = pygame.font.Font(fonts_path["veramono"],13)
|
|
||||||
fonts["veramono12"] = pygame.font.Font(fonts_path["veramono"],12)
|
|
||||||
fonts["veramono11"] = pygame.font.Font(fonts_path["veramono"],11)
|
|
||||||
fonts["veramono10"] = pygame.font.Font(fonts_path["veramono"],10)
|
|
||||||
|
|
||||||
for i in range(10,28):
|
|
||||||
fonts["notosansmono"+str(i)] = pygame.font.Font(fonts_path["noto"],i)
|
|
||||||
|
|
||||||
for i in range(10,28):
|
|
||||||
fonts["notosanscjk"+str(i)] = pygame.font.Font(fonts_path["notocjk"],i)
|
|
||||||
|
|
||||||
fonts["arial"] = pygame.font.SysFont("arial",16)
|
|
||||||
|
|
||||||
@ -6,15 +6,16 @@ import os
|
|||||||
|
|
||||||
##local import
|
##local import
|
||||||
from constants import Width,Height,ICON_TYPES,ALIGN
|
from constants import Width,Height,ICON_TYPES,ALIGN
|
||||||
from util_funcs import FileExists,midRect,SkinMap
|
from util_funcs import FileExists,midRect
|
||||||
from icon_item import IconItem
|
from icon_item import IconItem
|
||||||
from fonts import fonts
|
|
||||||
from multi_icon_item import MultiIconItem
|
from multi_icon_item import MultiIconItem
|
||||||
from icon_pool import MyIconPool
|
from icon_pool import MyIconPool
|
||||||
from libs.roundrects import aa_round_rect
|
from libs.roundrects import aa_round_rect
|
||||||
from lang_manager import MyLangManager
|
from lang_manager import MyLangManager
|
||||||
from widget import Widget
|
from widget import Widget
|
||||||
icon_base_path = SkinMap("gameshell/footbar_icons/")
|
from skin_manager import MySkinManager
|
||||||
|
|
||||||
|
icon_base_path = MySkinManager.GiveIcon("gameshell/footbar_icons/")
|
||||||
|
|
||||||
class FootBarIcon(MultiIconItem):
|
class FootBarIcon(MultiIconItem):
|
||||||
|
|
||||||
|
|||||||
@ -6,12 +6,12 @@ from sys import exit
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from util_funcs import SkinMap
|
from skin_manager import MySkinManager
|
||||||
##pool only store surfaces
|
##pool only store surfaces
|
||||||
|
|
||||||
class IconPool(object):
|
class IconPool(object):
|
||||||
|
|
||||||
_GameShellIconPath = SkinMap("gameshell/icons/")
|
_GameShellIconPath = MySkinManager.GiveIcon("gameshell/icons/")
|
||||||
_Icons = {}
|
_Icons = {}
|
||||||
_Sizes = {}
|
_Sizes = {}
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|||||||
@ -8,7 +8,6 @@ from libs import easing
|
|||||||
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.fonts import fonts
|
|
||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||||
from UI.icon_item import IconItem
|
from UI.icon_item import IconItem
|
||||||
@ -108,7 +107,7 @@ class Keyboard(Page):
|
|||||||
self._Width = self._Screen._Width
|
self._Width = self._Screen._Width
|
||||||
self._Height = self._Screen._Height
|
self._Height = self._Screen._Height
|
||||||
|
|
||||||
fontobj = fonts["veramono24"]
|
fontobj = MySkinManager.GiveFont("veramono24")
|
||||||
word_margin = 15
|
word_margin = 15
|
||||||
|
|
||||||
start_x = (self._Width - fontobj.size( "".join(self._Secs[0][0]))[0]-len(self._Secs[0][0])*word_margin)/2+word_margin/2
|
start_x = (self._Width - fontobj.size( "".join(self._Secs[0][0]))[0]-len(self._Secs[0][0])*word_margin)/2+word_margin/2
|
||||||
@ -141,7 +140,7 @@ class Keyboard(Page):
|
|||||||
else:
|
else:
|
||||||
if val == "_S":
|
if val == "_S":
|
||||||
val = "Space"
|
val = "Space"
|
||||||
ti._FontObj = fonts["veramono15"]
|
ti._FontObj = MySkinManager.GiveFont("veramono15")
|
||||||
ti._Bold = True
|
ti._Bold = True
|
||||||
|
|
||||||
cur_alpha_size = ti._FontObj.size( val)
|
cur_alpha_size = ti._FontObj.size( val)
|
||||||
|
|||||||
@ -3,8 +3,8 @@ import os
|
|||||||
import pygame
|
import pygame
|
||||||
import config
|
import config
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
|
from skin_manager import MySkinManager
|
||||||
from util_funcs import FileExists
|
from util_funcs import FileExists
|
||||||
from fonts import fonts
|
|
||||||
|
|
||||||
class CaseConfigParser(ConfigParser.SafeConfigParser):
|
class CaseConfigParser(ConfigParser.SafeConfigParser):
|
||||||
def optionxform(self, optionstr):
|
def optionxform(self, optionstr):
|
||||||
@ -97,12 +97,12 @@ class LangManager(object):
|
|||||||
raise Exception('font string format error')
|
raise Exception('font string format error')
|
||||||
|
|
||||||
if "English.ini" in self._ConfigFileName:
|
if "English.ini" in self._ConfigFileName:
|
||||||
return fonts[orig_font_str]
|
return MySkinManager.GiveFont(orig_font_str)
|
||||||
else:
|
else:
|
||||||
if font_size_number > 28:
|
if font_size_number > 28:
|
||||||
raise Exception('cjk font string format error '+ str(font_size_number))
|
raise Exception('cjk font string format error '+ str(font_size_number))
|
||||||
|
|
||||||
return fonts["notosanscjk"+str(font_size_number)]
|
return MySkinManager.GiveFont("notosanscjk%d" % font_size_number)
|
||||||
|
|
||||||
##global MyLangManager Handler
|
##global MyLangManager Handler
|
||||||
MyLangManager = None
|
MyLangManager = None
|
||||||
|
|||||||
@ -20,7 +20,7 @@ from page import Page,PageStack
|
|||||||
from title_bar import TitleBar
|
from title_bar import TitleBar
|
||||||
from foot_bar import FootBar
|
from foot_bar import FootBar
|
||||||
from constants import Width,Height,bg_color
|
from constants import Width,Height,bg_color
|
||||||
from util_funcs import midRect,FileExists,ReplaceSuffix,ReadTheFileContent,CmdClean,MakeExecutable,SkinMap
|
from util_funcs import midRect,FileExists,ReplaceSuffix,ReadTheFileContent,CmdClean,MakeExecutable
|
||||||
from keys_def import CurKeys
|
from keys_def import CurKeys
|
||||||
from label import Label
|
from label import Label
|
||||||
from untitled_icon import UntitledIcon
|
from untitled_icon import UntitledIcon
|
||||||
@ -469,8 +469,8 @@ class MainScreen(Widget):
|
|||||||
iconitem.AddLabel(MyLangManager.Tr(i2),self._IconFont)
|
iconitem.AddLabel(MyLangManager.Tr(i2),self._IconFont)
|
||||||
if FileExists( _dir+"/"+i+"/"+i2+".png"): ### 20_Prog/Prog.png , cut 20_
|
if FileExists( _dir+"/"+i+"/"+i2+".png"): ### 20_Prog/Prog.png , cut 20_
|
||||||
iconitem._ImageName = _dir+"/"+i+"/"+i2+".png"
|
iconitem._ImageName = _dir+"/"+i+"/"+i2+".png"
|
||||||
elif FileExists( SkinMap(_dir+"/"+i2+".png") ):
|
elif FileExists( MySkinManager.GiveIcon(_dir+"/"+i2+".png") ):
|
||||||
iconitem._ImageName = SkinMap(_dir+"/"+i2+".png")
|
iconitem._ImageName = MySkinManager.GiveIcon(_dir+"/"+i2+".png")
|
||||||
else:
|
else:
|
||||||
untitled = UntitledIcon()
|
untitled = UntitledIcon()
|
||||||
untitled.Init()
|
untitled.Init()
|
||||||
@ -577,8 +577,8 @@ class MainScreen(Widget):
|
|||||||
iconitem._CmdPath = os.path.realpath(_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( MySkinManager.GiveIcon( _dir+"/"+ReplaceSuffix(i2,"png"))):
|
||||||
iconitem._ImageName = SkinMap(_dir+"/"+ReplaceSuffix(i2,"png"))
|
iconitem._ImageName = MySkinManager.GiveIcon(_dir+"/"+ReplaceSuffix(i2,"png"))
|
||||||
else:
|
else:
|
||||||
untitled = UntitledIcon()
|
untitled = UntitledIcon()
|
||||||
untitled.Init()
|
untitled.Init()
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import pygame
|
|||||||
import config
|
import config
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
|
|
||||||
|
from util_funcs import FileExists
|
||||||
|
|
||||||
class CaseConfigParser(ConfigParser.SafeConfigParser):
|
class CaseConfigParser(ConfigParser.SafeConfigParser):
|
||||||
def optionxform(self, optionstr):
|
def optionxform(self, optionstr):
|
||||||
return optionstr
|
return optionstr
|
||||||
@ -21,6 +23,8 @@ class SkinManager(object):
|
|||||||
|
|
||||||
_Colors = {}
|
_Colors = {}
|
||||||
_Config = None
|
_Config = None
|
||||||
|
_Fonts = {}
|
||||||
|
DefaultSkin = "../skin/default"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.Init()
|
self.Init()
|
||||||
@ -33,6 +37,38 @@ class SkinManager(object):
|
|||||||
def Init(self):
|
def Init(self):
|
||||||
if not SkinManager._Colors:
|
if not SkinManager._Colors:
|
||||||
self.SetColors()
|
self.SetColors()
|
||||||
|
if not SkinManager._Fonts:
|
||||||
|
self.SetFonts()
|
||||||
|
|
||||||
|
def SetFonts(self):
|
||||||
|
if not pygame.font.get_init():
|
||||||
|
pygame.font.init()
|
||||||
|
|
||||||
|
skinpath = config.SKIN+"/truetype"
|
||||||
|
fonts_path = {}
|
||||||
|
fonts_path["varela"] = "%s/VarelaRound-Regular.ttf" % skinpath
|
||||||
|
print(fonts_path["varela"])
|
||||||
|
fonts_path["veramono"] = "%s/VeraMono.ttf" % skinpath
|
||||||
|
fonts_path["noto"] = "%s/NotoSansMono-Regular.ttf" % skinpath
|
||||||
|
fonts_path["notocjk"] = "%s/NotoSansCJK-Regular.ttf" % skinpath
|
||||||
|
|
||||||
|
for i in range(10,29):
|
||||||
|
self._Fonts["varela%d"%i] = pygame.font.Font(fonts_path["varela"],i)
|
||||||
|
|
||||||
|
self._Fonts["varela34"] = pygame.font.Font(fonts_path["varela"],34)
|
||||||
|
self._Fonts["varela40"] = pygame.font.Font(fonts_path["varela"],40)
|
||||||
|
self._Fonts["varela120"] = pygame.font.Font(fonts_path["varela"],120)
|
||||||
|
|
||||||
|
for i in range(10,26):
|
||||||
|
self._Fonts["veramono%d"%i] = pygame.font.Font(fonts_path["veramono"],i)
|
||||||
|
|
||||||
|
for i in range(10,28):
|
||||||
|
self._Fonts["notosansmono%d"%i] = pygame.font.Font(fonts_path["noto"],i)
|
||||||
|
|
||||||
|
for i in range(10,28):
|
||||||
|
self._Fonts["notosanscjk%d"%i] = pygame.font.Font(fonts_path["notocjk"],i)
|
||||||
|
|
||||||
|
self._Fonts["arial"] = pygame.font.SysFont("arial",16)
|
||||||
|
|
||||||
def SetColors(self):
|
def SetColors(self):
|
||||||
Colors = {}
|
Colors = {}
|
||||||
@ -52,7 +88,7 @@ class SkinManager(object):
|
|||||||
|
|
||||||
self._Config = CaseConfigParser()
|
self._Config = CaseConfigParser()
|
||||||
|
|
||||||
fname = "../skin/"+config.SKIN+"/config.cfg"
|
fname = config.SKIN+"/config.ini"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._Config.read(fname)
|
self._Config.read(fname)
|
||||||
@ -72,12 +108,33 @@ class SkinManager(object):
|
|||||||
print("error in ConvertToRGB %s" % str(e))
|
print("error in ConvertToRGB %s" % str(e))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
def GiveFont(self,name):
|
||||||
|
return SkinManager._Fonts[name]
|
||||||
|
|
||||||
def GiveColor(self,name):
|
def GiveColor(self,name):
|
||||||
if name in SkinManager._Colors:
|
if name in SkinManager._Colors:
|
||||||
return SkinManager._Colors[name]
|
return SkinManager._Colors[name]
|
||||||
else:
|
else:
|
||||||
return pygame.Color(255,0,0)
|
return pygame.Color(255,0,0)
|
||||||
|
|
||||||
|
def GiveIcon(self,orig_file_or_dir):
|
||||||
|
#doing a wrapper for items under /home/cpi/apps/Menu/*, to be like Menu/GameShell/*
|
||||||
|
if orig_file_or_dir.startswith("/home/cpi/apps/Menu"):
|
||||||
|
orig_file_or_dir = orig_file_or_dir.replace("/home/cpi/apps/Menu/","../Menu/GameShell/")
|
||||||
|
|
||||||
|
if orig_file_or_dir.startswith(".."):
|
||||||
|
ret = orig_file_or_dir.replace("..",config.SKIN)
|
||||||
|
if FileExists(ret) == False:
|
||||||
|
ret = orig_file_or_dir.replace("..",self.DefaultSkin)
|
||||||
|
else:
|
||||||
|
ret = config.SKIN+"/sys.py/"+orig_file_or_dir
|
||||||
|
if FileExists(ret) == False:
|
||||||
|
ret = self.DefaultSkin+"/sys.py/"+orig_file_or_dir
|
||||||
|
|
||||||
|
if FileExists( ret ):
|
||||||
|
return ret
|
||||||
|
else: ## if not existed both in default or custom skin ,return where it is
|
||||||
|
return orig_file_or_dir
|
||||||
|
|
||||||
##global MySkinManager Handler
|
##global MySkinManager Handler
|
||||||
MySkinManager = None
|
MySkinManager = None
|
||||||
|
|||||||
@ -6,7 +6,6 @@ from libs.roundrects import aa_round_rect
|
|||||||
## local UI import
|
## local UI import
|
||||||
from page import Page,PageStack,PageSelector
|
from page import Page,PageStack,PageSelector
|
||||||
from label import Label
|
from label import Label
|
||||||
from fonts import fonts
|
|
||||||
from skin_manager import MySkinManager
|
from skin_manager import MySkinManager
|
||||||
from lang_manager import MyLangManager
|
from lang_manager import MyLangManager
|
||||||
from widget import Widget
|
from widget import Widget
|
||||||
|
|||||||
@ -6,8 +6,8 @@ from libs.roundrects import aa_round_rect
|
|||||||
## local UI import
|
## local UI import
|
||||||
from UI.page import Page,PageStack,PageSelector
|
from UI.page import Page,PageStack,PageSelector
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
from UI.fonts import fonts
|
|
||||||
from UI.skin_manager import MySkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
from UI.widget import Widget
|
from UI.widget import Widget
|
||||||
|
|
||||||
class Textarea(Widget):
|
class Textarea(Widget):
|
||||||
@ -26,7 +26,7 @@ class Textarea(Widget):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def Init(self):
|
def Init(self):
|
||||||
self._FontObj = fonts["veramono24"]
|
self._FontObj = MyLangManager.TrFont("veramono24")
|
||||||
#pygame.font.Font(fonts_path["veramono"],24)
|
#pygame.font.Font(fonts_path["veramono"],24)
|
||||||
|
|
||||||
def SubTextIndex(self):
|
def SubTextIndex(self):
|
||||||
|
|||||||
@ -13,12 +13,12 @@ import alsaaudio
|
|||||||
|
|
||||||
##local import
|
##local import
|
||||||
from constants import ICON_TYPES,Width,Height
|
from constants import ICON_TYPES,Width,Height
|
||||||
from fonts import fonts
|
|
||||||
from icon_item import IconItem
|
from icon_item import IconItem
|
||||||
from multi_icon_item import MultiIconItem
|
from multi_icon_item import MultiIconItem
|
||||||
from icon_pool import MyIconPool
|
from icon_pool import MyIconPool
|
||||||
from lang_manager import MyLangManager
|
from lang_manager import MyLangManager
|
||||||
from util_funcs import midRect,SwapAndShow,SkinMap
|
from util_funcs import midRect,SwapAndShow
|
||||||
|
from skin_manager import MySkinManager
|
||||||
from widget import Widget
|
from widget import Widget
|
||||||
from config import Battery
|
from config import Battery
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ from libs.roundrects import aa_round_rect
|
|||||||
|
|
||||||
from libs.DBUS import is_wifi_connected_now,wifi_strength
|
from libs.DBUS import is_wifi_connected_now,wifi_strength
|
||||||
|
|
||||||
icon_base_path = SkinMap("gameshell/titlebar_icons/")
|
icon_base_path = MySkinManager.GiveIcon("gameshell/titlebar_icons/")
|
||||||
class TitleBar(Widget):
|
class TitleBar(Widget):
|
||||||
_Width = Width
|
_Width = Width
|
||||||
_Height = 25
|
_Height = 25
|
||||||
@ -299,13 +299,14 @@ class TitleBar(Widget):
|
|||||||
self._Title = title
|
self._Title = title
|
||||||
|
|
||||||
cur_time = datetime.now().strftime("%H:%M")
|
cur_time = datetime.now().strftime("%H:%M")
|
||||||
time_text_size = fonts["varela12"].size(cur_time)
|
time_text_font = MySkinManager.GiveFont("varela12")
|
||||||
|
time_text_size = time_text_font.size(cur_time)
|
||||||
title_text_size = MyLangManager.TrFont("varela16").size(title)
|
title_text_size = MyLangManager.TrFont("varela16").size(title)
|
||||||
|
|
||||||
self._CanvasHWND.blit(MyLangManager.TrFont("varela16").render(title,True,self._SkinManager.GiveColor("Text")),midRect(title_text_size[0]/2+self._LOffset,
|
self._CanvasHWND.blit(MyLangManager.TrFont("varela16").render(title,True,self._SkinManager.GiveColor("Text")),midRect(title_text_size[0]/2+self._LOffset,
|
||||||
title_text_size[1]/2+(self._BarHeight-title_text_size[1])/2,
|
title_text_size[1]/2+(self._BarHeight-title_text_size[1])/2,
|
||||||
title_text_size[0],title_text_size[1],Width,Height))
|
title_text_size[0],title_text_size[1],Width,Height))
|
||||||
self._CanvasHWND.blit( fonts["varela12"].render(cur_time,True,self._SkinManager.GiveColor("Text")),midRect(Width-time_text_size[0]/2-self._ROffset,
|
self._CanvasHWND.blit( time_text_font.render(cur_time,True,self._SkinManager.GiveColor("Text")),midRect(Width-time_text_size[0]/2-self._ROffset,
|
||||||
time_text_size[1]/2+(self._BarHeight-time_text_size[1])/2,
|
time_text_size[1]/2+(self._BarHeight-time_text_size[1])/2,
|
||||||
time_text_size[0],time_text_size[1],Width,Height))
|
time_text_size[0],time_text_size[1],Width,Height))
|
||||||
|
|
||||||
|
|||||||
@ -11,12 +11,11 @@ from datetime import datetime
|
|||||||
import base64
|
import base64
|
||||||
from beeprint import pp
|
from beeprint import pp
|
||||||
|
|
||||||
from util_funcs import midRect, SkinMap
|
from util_funcs import midRect
|
||||||
from fonts import fonts
|
|
||||||
|
|
||||||
from skin_manager import MySkinManager
|
from skin_manager import MySkinManager
|
||||||
|
|
||||||
BlankPng = SkinMap("gameshell/blank.png") # 80x80
|
BlankPng = MySkinManager.GiveIcon("gameshell/blank.png") # 80x80
|
||||||
## use blank circle as bg, Two alpha As Icon Label
|
## use blank circle as bg, Two alpha As Icon Label
|
||||||
#Upper and Lower
|
#Upper and Lower
|
||||||
|
|
||||||
@ -28,7 +27,7 @@ class UntitledIcon(object):
|
|||||||
_Height = 80
|
_Height = 80
|
||||||
|
|
||||||
_Words = ["G", "s"]
|
_Words = ["G", "s"]
|
||||||
_FontObj = fonts["varela40"]
|
_FontObj = MySkinManager.GiveFont("varela40")
|
||||||
|
|
||||||
_BG = None # initial surface
|
_BG = None # initial surface
|
||||||
|
|
||||||
|
|||||||
@ -13,27 +13,6 @@ import string
|
|||||||
from Xlib import X,display
|
from Xlib import X,display
|
||||||
import config
|
import config
|
||||||
|
|
||||||
def SkinMap(orig_file_or_dir):
|
|
||||||
DefaultSkin = "default"
|
|
||||||
|
|
||||||
#doing a wrapper for items under /home/cpi/apps/Menu/*, to be like Menu/GameShell/*
|
|
||||||
if orig_file_or_dir.startswith("/home/cpi/apps/Menu"):
|
|
||||||
orig_file_or_dir = orig_file_or_dir.replace("/home/cpi/apps/Menu/","../Menu/GameShell/")
|
|
||||||
|
|
||||||
if orig_file_or_dir.startswith(".."):
|
|
||||||
ret = orig_file_or_dir.replace("..","../skin/"+config.SKIN)
|
|
||||||
if FileExists(ret) == False:
|
|
||||||
ret = orig_file_or_dir.replace("..","../skin/"+DefaultSkin)
|
|
||||||
else:
|
|
||||||
ret = "../skin/"+config.SKIN+"/sys.py/"+orig_file_or_dir
|
|
||||||
if FileExists(ret) == False:
|
|
||||||
ret = "../skin/"+DefaultSkin+"/sys.py/"+orig_file_or_dir
|
|
||||||
|
|
||||||
if FileExists( ret ):
|
|
||||||
return ret
|
|
||||||
else: ## if not existed both in default or custom skin ,return where it is
|
|
||||||
return orig_file_or_dir
|
|
||||||
|
|
||||||
def get_git_revision_hash():
|
def get_git_revision_hash():
|
||||||
return subprocess.check_output(['git', 'rev-parse', 'HEAD'])
|
return subprocess.check_output(['git', 'rev-parse', 'HEAD'])
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/CPI/master/launcher_ve
|
|||||||
|
|
||||||
VERSION="stable 1.24"
|
VERSION="stable 1.24"
|
||||||
|
|
||||||
SKIN="default"
|
SKIN="../skin/default"
|
||||||
|
|
||||||
## three timer values in seconds: dim screen, close screen,PowerOff
|
## three timer values in seconds: dim screen, close screen,PowerOff
|
||||||
## zero means no action
|
## zero means no action
|
||||||
|
|||||||
@ -4,6 +4,9 @@ import dbus
|
|||||||
import dbus.service
|
import dbus.service
|
||||||
import sys
|
import sys
|
||||||
import commands
|
import commands
|
||||||
|
import logging
|
||||||
|
import errno
|
||||||
|
|
||||||
from wicd import misc
|
from wicd import misc
|
||||||
##misc.to_bool
|
##misc.to_bool
|
||||||
##misc.misc.noneToString
|
##misc.misc.noneToString
|
||||||
@ -289,6 +292,35 @@ def RecordKeyDns(thekey,main_screen):
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def release_self_fds():
|
||||||
|
fds_flags= ["pipe","socket",".ttf"]
|
||||||
|
"""List process currently open FDs and their target """
|
||||||
|
if sys.platform != 'linux2':
|
||||||
|
raise NotImplementedError('Unsupported platform: %s' % sys.platform)
|
||||||
|
|
||||||
|
ret = {}
|
||||||
|
base = '/proc/self/fd'
|
||||||
|
for num in os.listdir(base):
|
||||||
|
path = None
|
||||||
|
try:
|
||||||
|
path = os.readlink(os.path.join(base, num))
|
||||||
|
except OSError as err:
|
||||||
|
# Last FD is always the "listdir" one (which may be closed)
|
||||||
|
if err.errno != errno.ENOENT:
|
||||||
|
raise
|
||||||
|
ret[int(num)] = path
|
||||||
|
|
||||||
|
for key in ret:
|
||||||
|
if ret[key] != None and isinstance(ret[key], str):
|
||||||
|
for i in fds_flags:
|
||||||
|
if i in ret[key]:
|
||||||
|
os.close(key)
|
||||||
|
break
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def event_process(event,main_screen):
|
def event_process(event,main_screen):
|
||||||
global sound_patch
|
global sound_patch
|
||||||
global everytime_keydown
|
global everytime_keydown
|
||||||
@ -316,6 +348,7 @@ def event_process(event,main_screen):
|
|||||||
exec_app_cmd += 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)
|
||||||
|
release_self_fds()
|
||||||
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)
|
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)
|
||||||
os.chdir( GetExePath())
|
os.chdir( GetExePath())
|
||||||
os.exelp("python","python"," "+myscriptname)
|
os.exelp("python","python"," "+myscriptname)
|
||||||
@ -334,6 +367,7 @@ def event_process(event,main_screen):
|
|||||||
exec_app_cmd += 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)
|
||||||
|
release_self_fds()
|
||||||
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)
|
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)
|
||||||
os.chdir( GetExePath())
|
os.chdir( GetExePath())
|
||||||
os.exelp("python","python"," "+myscriptname)
|
os.exelp("python","python"," "+myscriptname)
|
||||||
@ -542,6 +576,13 @@ def PreparationInAdv():
|
|||||||
if "arm" not in platform.machine():
|
if "arm" not in platform.machine():
|
||||||
return
|
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:
|
if FileExists(".powerlevel") == False:
|
||||||
os.system("touch .powerlevel")
|
os.system("touch .powerlevel")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user