mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-12 17:58:50 +01:00
commit
7d3bb93eb2
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,6 +5,7 @@ retroarch-core-options.cfg
|
|||||||
*.pyc
|
*.pyc
|
||||||
sys.py/.powerlevel
|
sys.py/.powerlevel
|
||||||
sys.py/.buttonslayout
|
sys.py/.buttonslayout
|
||||||
|
sys.py/.lang
|
||||||
*.cfg
|
*.cfg
|
||||||
**/Jobs/*
|
**/Jobs/*
|
||||||
!**/Jobs/.gitkeep
|
!**/Jobs/.gitkeep
|
||||||
|
|||||||
@ -19,6 +19,7 @@ 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.multi_icon_item import MultiIconItem
|
from UI.multi_icon_item import MultiIconItem
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
from UI.multilabel import MultiLabel
|
from UI.multilabel import MultiLabel
|
||||||
|
|
||||||
@ -77,9 +78,9 @@ class InfoPageListItem(object):
|
|||||||
|
|
||||||
|
|
||||||
class AirplanePage(Page):
|
class AirplanePage(Page):
|
||||||
_FootMsg = ["Nav.","Rescue","","Back","Toggle"]
|
_FootMsg = ["Nav","Rescue","","Back","Toggle"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFontObj = fonts["varela13"]
|
_ListFontObj = MyLangManager.TrFont("varela13")
|
||||||
|
|
||||||
_AList = {}
|
_AList = {}
|
||||||
|
|
||||||
@ -206,19 +207,19 @@ class AirplanePage(Page):
|
|||||||
out = commands.getstatusoutput('sudo rfkill list | grep yes | cut -d " " -f3')
|
out = commands.getstatusoutput('sudo rfkill list | grep yes | cut -d " " -f3')
|
||||||
print out
|
print out
|
||||||
if "yes" in out[1]:
|
if "yes" in out[1]:
|
||||||
self._Screen._MsgBox.SetText("Turning On")
|
self._Screen._MsgBox.SetText("TurningOn")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
commands.getstatusoutput("sudo rfkill unblock all")
|
commands.getstatusoutput("sudo rfkill unblock all")
|
||||||
self._Screen._TitleBar._InAirPlaneMode = False
|
self._Screen._TitleBar._InAirPlaneMode = False
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self._Screen._MsgBox.SetText("Turning Off")
|
self._Screen._MsgBox.SetText("TurningOff")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
commands.getstatusoutput("sudo rfkill block all")
|
commands.getstatusoutput("sudo rfkill block all")
|
||||||
self._Screen._TitleBar._InAirPlaneMode = True
|
self._Screen._TitleBar._InAirPlaneMode = True
|
||||||
|
|
||||||
def UnBlockAll(self):
|
def UnBlockAll(self):
|
||||||
self._Screen._MsgBox.SetText("Turning On")
|
self._Screen._MsgBox.SetText("TurningOn")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
commands.getstatusoutput("sudo rfkill unblock all")
|
commands.getstatusoutput("sudo rfkill unblock all")
|
||||||
self._Screen._TitleBar._InAirPlaneMode = False
|
self._Screen._TitleBar._InAirPlaneMode = False
|
||||||
|
|||||||
@ -22,17 +22,18 @@ 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.multi_icon_item import MultiIconItem
|
from UI.multi_icon_item import MultiIconItem
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
from UI.confirm_page import ConfirmPage
|
from UI.confirm_page import ConfirmPage
|
||||||
from UI.info_page_list_item import InfoPageListItem
|
from UI.info_page_list_item import InfoPageListItem
|
||||||
|
|
||||||
from UI.multilabel import MultiLabel
|
from UI.multilabel import MultiLabel
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
from net_item import NetItem
|
from net_item import NetItem
|
||||||
|
|
||||||
class BleForgetConfirmPage(ConfirmPage):
|
class BleForgetConfirmPage(ConfirmPage):
|
||||||
|
|
||||||
_ConfirmText = "Confirm Forget?"
|
_ConfirmText = MyLangManager.Tr("ConfirmForgetQ")
|
||||||
|
|
||||||
def KeyDown(self,event):
|
def KeyDown(self,event):
|
||||||
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
|
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
|
||||||
@ -41,7 +42,7 @@ class BleForgetConfirmPage(ConfirmPage):
|
|||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
if event.key == CurKeys["B"]:
|
if event.key == CurKeys["B"]:
|
||||||
self.SnapMsg("Deleteing...")
|
self.SnapMsg(MyLangManager.Tr("Deleting"))
|
||||||
self._Screen.Draw()
|
self._Screen.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
@ -68,7 +69,7 @@ class BleForgetConfirmPage(ConfirmPage):
|
|||||||
|
|
||||||
|
|
||||||
class BleInfoPageSelector(PageSelector):
|
class BleInfoPageSelector(PageSelector):
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._PosX = 0
|
self._PosX = 0
|
||||||
@ -93,9 +94,9 @@ class BleInfoPageSelector(PageSelector):
|
|||||||
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||||
|
|
||||||
class BleInfoPage(Page):
|
class BleInfoPage(Page):
|
||||||
_FootMsg = ["Nav.","Disconnect","Forget","Back",""]
|
_FootMsg = ["Nav","Disconnect","Forget","Back",""]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFontObj = fonts["varela15"]
|
_ListFontObj = MyLangManager.TrFont("varela15")
|
||||||
_ListSmFontObj = fonts["varela12"] # small font
|
_ListSmFontObj = fonts["varela12"] # small font
|
||||||
_ListSm2FontObj= fonts["varela11"]
|
_ListSm2FontObj= fonts["varela11"]
|
||||||
|
|
||||||
@ -126,7 +127,7 @@ class BleInfoPage(Page):
|
|||||||
|
|
||||||
self._ConfirmPage1 = BleForgetConfirmPage()
|
self._ConfirmPage1 = BleForgetConfirmPage()
|
||||||
self._ConfirmPage1._Screen = self._Screen
|
self._ConfirmPage1._Screen = self._Screen
|
||||||
self._ConfirmPage1._Name = "Confirm Forget"
|
self._ConfirmPage1._Name = "ConfirmForget"
|
||||||
self._ConfirmPage1._Parent = self
|
self._ConfirmPage1._Parent = self
|
||||||
self._ConfirmPage1.Init()
|
self._ConfirmPage1.Init()
|
||||||
|
|
||||||
@ -204,7 +205,7 @@ class BleInfoPage(Page):
|
|||||||
proxy_obj = bus.get_object("org.bluez", self._Path)
|
proxy_obj = bus.get_object("org.bluez", self._Path)
|
||||||
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
|
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
|
||||||
|
|
||||||
self._Screen._MsgBox.SetText("Forgeting...")
|
self._Screen._MsgBox.SetText("Forgeting")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
@ -229,8 +230,8 @@ class BleInfoPage(Page):
|
|||||||
proxy_obj = bus.get_object("org.bluez", self._Path)
|
proxy_obj = bus.get_object("org.bluez", self._Path)
|
||||||
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
|
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
|
||||||
|
|
||||||
self._Screen._FootBar.UpdateNavText("Disconnecting...")
|
self._Screen._FootBar.UpdateNavText("Disconnecting")
|
||||||
self._Screen._MsgBox.SetText("Disconnecting...")
|
self._Screen._MsgBox.SetText("Disconnecting")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
@ -322,7 +323,7 @@ class BleInfoPage(Page):
|
|||||||
|
|
||||||
|
|
||||||
class BleListSelector(PageSelector):
|
class BleListSelector(PageSelector):
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._PosX = 0
|
self._PosX = 0
|
||||||
@ -356,9 +357,9 @@ class BleListMessageBox(Label):
|
|||||||
x = (self._Parent._Width - w)/2
|
x = (self._Parent._Width - w)/2
|
||||||
y = (self._Parent._Height - h)/2
|
y = (self._Parent._Height - h)/2
|
||||||
padding = 10
|
padding = 10
|
||||||
pygame.draw.rect(self._CanvasHWND,SkinManager().GiveColor('White'),(x-padding,y-padding, w+padding*2,h+padding*2))
|
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),(x-padding,y-padding, w+padding*2,h+padding*2))
|
||||||
|
|
||||||
pygame.draw.rect(self._CanvasHWND,SkinManager().GiveColor('Black'),(x-padding,y-padding, w+padding*2,h+padding*2),1)
|
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Black'),(x-padding,y-padding, w+padding*2,h+padding*2),1)
|
||||||
|
|
||||||
self._CanvasHWND.blit(my_text,(x,y,w,h))
|
self._CanvasHWND.blit(my_text,(x,y,w,h))
|
||||||
|
|
||||||
@ -384,7 +385,7 @@ class BluetoothPage(Page):
|
|||||||
_BlockCb = None
|
_BlockCb = None
|
||||||
|
|
||||||
_LastStatusMsg = ""
|
_LastStatusMsg = ""
|
||||||
_FootMsg = ["Nav.","Scan","Info","Back","TryConnect"]
|
_FootMsg = ["Nav","Scan","Info","Back","TryConnect"]
|
||||||
_Scroller = None
|
_Scroller = None
|
||||||
_ListFontObj = fonts["notosanscjk15"]
|
_ListFontObj = fonts["notosanscjk15"]
|
||||||
|
|
||||||
@ -428,7 +429,7 @@ class BluetoothPage(Page):
|
|||||||
|
|
||||||
msgbox = BleListMessageBox()
|
msgbox = BleListMessageBox()
|
||||||
msgbox._CanvasHWND = self._CanvasHWND
|
msgbox._CanvasHWND = self._CanvasHWND
|
||||||
msgbox.Init(" ",fonts["veramono12"])
|
msgbox.Init(" ",MyLangManager.TrFont("veramono12"))
|
||||||
msgbox._Parent = self
|
msgbox._Parent = self
|
||||||
|
|
||||||
self._MsgBox = msgbox
|
self._MsgBox = msgbox
|
||||||
@ -443,7 +444,7 @@ class BluetoothPage(Page):
|
|||||||
|
|
||||||
self._InfoPage = BleInfoPage()
|
self._InfoPage = BleInfoPage()
|
||||||
self._InfoPage._Screen = self._Screen
|
self._InfoPage._Screen = self._Screen
|
||||||
self._InfoPage._Name = "Bluetooth info"
|
self._InfoPage._Name = "BluetoothInfo"
|
||||||
self._InfoPage.Init()
|
self._InfoPage.Init()
|
||||||
|
|
||||||
def print_normal(self,address, properties):
|
def print_normal(self,address, properties):
|
||||||
@ -529,8 +530,8 @@ class BluetoothPage(Page):
|
|||||||
proxy_obj = bus.get_object("org.bluez", cur_li._Path)
|
proxy_obj = bus.get_object("org.bluez", cur_li._Path)
|
||||||
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
|
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
|
||||||
|
|
||||||
self._Screen._FootBar.UpdateNavText("connecting...")
|
self._Screen._FootBar.UpdateNavText("Connecting")
|
||||||
self.ShowBox("connecting...")
|
self.ShowBox(MyLangManager.Tr("Connecting"))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dev.Connect()
|
dev.Connect()
|
||||||
@ -543,12 +544,16 @@ class BluetoothPage(Page):
|
|||||||
def RefreshDevices(self):
|
def RefreshDevices(self):
|
||||||
global devices
|
global devices
|
||||||
devices = {}
|
devices = {}
|
||||||
proxy_obj = bus.get_object("org.bluez", "/")
|
try:
|
||||||
manager = dbus.Interface(proxy_obj,"org.freedesktop.DBus.ObjectManager")
|
proxy_obj = bus.get_object("org.bluez", "/")
|
||||||
objects = manager.GetManagedObjects()
|
manager = dbus.Interface(proxy_obj,"org.freedesktop.DBus.ObjectManager")
|
||||||
for path, interfaces in objects.iteritems():
|
objects = manager.GetManagedObjects()
|
||||||
if "org.bluez.Device1" in interfaces:
|
for path, interfaces in objects.iteritems():
|
||||||
devices[path] = interfaces["org.bluez.Device1"] ## like /org/bluez/hci0/dev_xx_xx_xx_yy_yy_yy
|
if "org.bluez.Device1" in interfaces:
|
||||||
|
devices[path] = interfaces["org.bluez.Device1"] ## like /org/bluez/hci0/dev_xx_xx_xx_yy_yy_yy
|
||||||
|
except Exception,e:
|
||||||
|
print(str(e))
|
||||||
|
devices={}
|
||||||
|
|
||||||
self._Devices = devices
|
self._Devices = devices
|
||||||
|
|
||||||
@ -577,8 +582,8 @@ class BluetoothPage(Page):
|
|||||||
return
|
return
|
||||||
|
|
||||||
self._Scanning = True
|
self._Scanning = True
|
||||||
self.ShowBox("Bluetooth scanning...")
|
self.ShowBox(MyLangManager.Tr("BluetoothScanning"))
|
||||||
self._Screen._FootBar.UpdateNavText("bluetooth scanning")
|
self._Screen._FootBar.UpdateNavText("Scanning")
|
||||||
|
|
||||||
proxy_obj = self._Dbus.get_object("org.bluez", "/org/bluez/" + self._ADAPTER_DEV)
|
proxy_obj = self._Dbus.get_object("org.bluez", "/org/bluez/" + self._ADAPTER_DEV)
|
||||||
adapter_props = dbus.Interface(proxy_obj,"org.freedesktop.DBus.Properties")
|
adapter_props = dbus.Interface(proxy_obj,"org.freedesktop.DBus.Properties")
|
||||||
@ -642,7 +647,7 @@ class BluetoothPage(Page):
|
|||||||
_connecting = self.CheckIfBluetoothConnecting()
|
_connecting = self.CheckIfBluetoothConnecting()
|
||||||
if _connecting:
|
if _connecting:
|
||||||
self.ShutDownConnecting()
|
self.ShutDownConnecting()
|
||||||
self.ShowBox("ShutDownConnecting...")
|
self.ShowBox(MyLangManager.Tr("ShutDownConnecting"))
|
||||||
self.AbortedAndReturnToUpLevel()
|
self.AbortedAndReturnToUpLevel()
|
||||||
else:
|
else:
|
||||||
self.AbortedAndReturnToUpLevel()
|
self.AbortedAndReturnToUpLevel()
|
||||||
|
|||||||
@ -9,7 +9,7 @@ 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
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
|
|
||||||
class NetItemMultiIcon(MultiIconItem):
|
class NetItemMultiIcon(MultiIconItem):
|
||||||
@ -123,5 +123,5 @@ class NetItem(object):
|
|||||||
self._Icons["done"].NewCoord(320-22,self._PosY)
|
self._Icons["done"].NewCoord(320-22,self._PosY)
|
||||||
self._Icons["done"].Draw()
|
self._Icons["done"].Draw()
|
||||||
|
|
||||||
pygame.draw.line(self._Parent._CanvasHWND,SkinManager().GiveColor('Line'),
|
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),
|
||||||
(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
||||||
|
|||||||
310
Menu/GameShell/10_Settings/Languages/__init__.py
Normal file
310
Menu/GameShell/10_Settings/Languages/__init__.py
Normal file
@ -0,0 +1,310 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import os
|
||||||
|
import pygame
|
||||||
|
#import math
|
||||||
|
#mport subprocess
|
||||||
|
import glob
|
||||||
|
#from beeprint import pp
|
||||||
|
from libs.roundrects import aa_round_rect
|
||||||
|
|
||||||
|
## local UI import
|
||||||
|
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
|
||||||
|
from UI.page import Page,PageSelector
|
||||||
|
from UI.label import Label
|
||||||
|
from UI.fonts import fonts
|
||||||
|
from UI.util_funcs import midRect
|
||||||
|
from UI.keys_def import CurKeys
|
||||||
|
from UI.scroller import ListScroller
|
||||||
|
from UI.icon_pool import MyIconPool
|
||||||
|
from UI.icon_item import IconItem
|
||||||
|
from UI.multilabel import MultiLabel
|
||||||
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
from UI.info_page_list_item import InfoPageListItem
|
||||||
|
from UI.info_page_selector import InfoPageSelector
|
||||||
|
|
||||||
|
import config
|
||||||
|
|
||||||
|
class ListPageSelector(InfoPageSelector):
|
||||||
|
def Draw(self):
|
||||||
|
idx = self._Parent._PsIndex
|
||||||
|
|
||||||
|
if idx < len(self._Parent._MyList):
|
||||||
|
x = self._Parent._MyList[idx]._PosX+2 ## ++
|
||||||
|
y = self._Parent._MyList[idx]._PosY+1
|
||||||
|
h = self._Parent._MyList[idx]._Height -3
|
||||||
|
|
||||||
|
self._PosX = x
|
||||||
|
self._PosY = y
|
||||||
|
self._Height = h
|
||||||
|
|
||||||
|
aa_round_rect(self._Parent._CanvasHWND,
|
||||||
|
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||||
|
|
||||||
|
|
||||||
|
class PageListItem(InfoPageListItem):
|
||||||
|
_PosX = 0
|
||||||
|
_PosY = 0
|
||||||
|
_Width = 0
|
||||||
|
_Height = 30
|
||||||
|
|
||||||
|
_Labels = {}
|
||||||
|
_Icons = {}
|
||||||
|
_Fonts = {}
|
||||||
|
|
||||||
|
_LinkObj = None
|
||||||
|
|
||||||
|
_Active = False
|
||||||
|
_Value = ""
|
||||||
|
|
||||||
|
def Draw(self):
|
||||||
|
|
||||||
|
self._Labels["Text"]._PosY = self._PosY+ (self._Height- self._Labels["Text"]._Height)/2
|
||||||
|
|
||||||
|
if self._Active == True:
|
||||||
|
self._Parent._Icons["done"].NewCoord( self._Parent._Width-30,self._PosY+5)
|
||||||
|
self._Parent._Icons["done"].Draw()
|
||||||
|
|
||||||
|
self._Labels["Text"].Draw(self._Active)
|
||||||
|
|
||||||
|
if "Small" in self._Labels:
|
||||||
|
self._Labels["Small"]._PosX = self._Width - self._Labels["Small"]._Width -10
|
||||||
|
self._Labels["Small"]._PosY = self._PosY + (self._Height- self._Labels["Small"]._Height)/2
|
||||||
|
self._Labels["Small"].Draw()
|
||||||
|
|
||||||
|
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
||||||
|
|
||||||
|
class LanguagesPage(Page):
|
||||||
|
_FootMsg = ["Nav","","","Back","Select"]
|
||||||
|
_MyList = []
|
||||||
|
_ListFont = fonts["notosanscjk15"]
|
||||||
|
|
||||||
|
_AList = {}
|
||||||
|
|
||||||
|
_Scrolled = 0
|
||||||
|
|
||||||
|
_BGwidth = 320
|
||||||
|
_BGheight = 240-24-20
|
||||||
|
|
||||||
|
_DrawOnce = False
|
||||||
|
_Scroller = None
|
||||||
|
_InfoPage = None
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
Page.__init__(self)
|
||||||
|
self._Icons = {}
|
||||||
|
|
||||||
|
def GenList(self):
|
||||||
|
|
||||||
|
self._MyList = []
|
||||||
|
|
||||||
|
start_x = 0
|
||||||
|
start_y = 0
|
||||||
|
last_height = 0
|
||||||
|
|
||||||
|
files_path = [os.path.basename(x) for x in sorted(glob.glob('langs/*.ini'))]
|
||||||
|
|
||||||
|
for i,u in enumerate( files_path ):
|
||||||
|
#print(i,u)
|
||||||
|
li = PageListItem()
|
||||||
|
li._Parent = self
|
||||||
|
li._PosX = start_x
|
||||||
|
li._PosY = start_y + last_height
|
||||||
|
li._Width = Width
|
||||||
|
li._Fonts["normal"] = self._ListFont
|
||||||
|
li._Active = False
|
||||||
|
li._Value = u.decode("utf8")
|
||||||
|
lang_name = u.split("_")[1]
|
||||||
|
lang_name = lang_name.split(".")[0]
|
||||||
|
|
||||||
|
li.Init( lang_name.decode("utf8") )
|
||||||
|
|
||||||
|
last_height += li._Height
|
||||||
|
|
||||||
|
self._MyList.append(li)
|
||||||
|
|
||||||
|
def Init(self):
|
||||||
|
if self._Screen != None:
|
||||||
|
if self._Screen._CanvasHWND != None and self._CanvasHWND == None:
|
||||||
|
self._HWND = self._Screen._CanvasHWND
|
||||||
|
self._CanvasHWND = pygame.Surface( (self._Screen._Width,self._BGheight) )
|
||||||
|
|
||||||
|
self._PosX = self._Index*self._Screen._Width
|
||||||
|
self._Width = self._Screen._Width ## equal to screen width
|
||||||
|
self._Height = self._Screen._Height
|
||||||
|
|
||||||
|
done = IconItem()
|
||||||
|
done._ImgSurf = MyIconPool._Icons["done"]
|
||||||
|
done._MyType = ICON_TYPES["STAT"]
|
||||||
|
done._Parent = self
|
||||||
|
self._Icons["done"] = done
|
||||||
|
|
||||||
|
ps = ListPageSelector()
|
||||||
|
ps._Parent = self
|
||||||
|
self._Ps = ps
|
||||||
|
self._PsIndex = 0
|
||||||
|
|
||||||
|
self.GenList()
|
||||||
|
|
||||||
|
self._Scroller = ListScroller()
|
||||||
|
self._Scroller._Parent = self
|
||||||
|
self._Scroller._PosX = self._Width - 10
|
||||||
|
self._Scroller._PosY = 2
|
||||||
|
self._Scroller.Init()
|
||||||
|
self._Scroller.SetCanvasHWND(self._HWND)
|
||||||
|
|
||||||
|
|
||||||
|
def ScrollDown(self):
|
||||||
|
if len(self._MyList) == 0:
|
||||||
|
return
|
||||||
|
self._PsIndex +=1
|
||||||
|
if self._PsIndex >= len(self._MyList):
|
||||||
|
self._PsIndex = len(self._MyList) -1
|
||||||
|
|
||||||
|
cur_li = self._MyList[self._PsIndex]
|
||||||
|
if cur_li._PosY +cur_li._Height > self._Height:
|
||||||
|
for i in range(0,len(self._MyList)):
|
||||||
|
self._MyList[i]._PosY -= self._MyList[i]._Height
|
||||||
|
|
||||||
|
def ScrollUp(self):
|
||||||
|
if len(self._MyList) == 0:
|
||||||
|
return
|
||||||
|
self._PsIndex -= 1
|
||||||
|
if self._PsIndex < 0:
|
||||||
|
self._PsIndex = 0
|
||||||
|
cur_li = self._MyList[self._PsIndex]
|
||||||
|
if cur_li._PosY < 0:
|
||||||
|
for i in range(0, len(self._MyList)):
|
||||||
|
self._MyList[i]._PosY += self._MyList[i]._Height
|
||||||
|
|
||||||
|
|
||||||
|
def Click(self):
|
||||||
|
if len(self._MyList) == 0:
|
||||||
|
return
|
||||||
|
|
||||||
|
cur_li = self._MyList[self._PsIndex]
|
||||||
|
if cur_li._Active == True:
|
||||||
|
return
|
||||||
|
|
||||||
|
for i in self._MyList:
|
||||||
|
i._Active = False
|
||||||
|
|
||||||
|
cur_li._Active = True
|
||||||
|
print(cur_li._Value)
|
||||||
|
with open(".lang","w") as f:
|
||||||
|
f.write(cur_li._Value)
|
||||||
|
|
||||||
|
self._Screen._MsgBox.SetText("Applying")
|
||||||
|
self._Screen._MsgBox.Draw()
|
||||||
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
|
MyLangManager.UpdateLang()
|
||||||
|
|
||||||
|
pygame.event.post( pygame.event.Event(RESTARTUI, message="")) ##Restart Launcher
|
||||||
|
|
||||||
|
pygame.time.delay(1000)
|
||||||
|
|
||||||
|
self._Screen.Draw()
|
||||||
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
|
def OnLoadCb(self):
|
||||||
|
self._Scrolled = 0
|
||||||
|
self._PosY = 0
|
||||||
|
self._DrawOnce = False
|
||||||
|
with open(".lang", "r") as f:
|
||||||
|
thelang = f.read()
|
||||||
|
|
||||||
|
thelang = thelang.strip()
|
||||||
|
|
||||||
|
if thelang == "":
|
||||||
|
thelang = "English"
|
||||||
|
|
||||||
|
for i in self._MyList:
|
||||||
|
if thelang in i._Value:
|
||||||
|
i._Active = True
|
||||||
|
|
||||||
|
def OnReturnBackCb(self):
|
||||||
|
pass
|
||||||
|
"""
|
||||||
|
self.ReturnToUpLevelPage()
|
||||||
|
self._Screen.Draw()
|
||||||
|
self._Screen.SwapAndShow()
|
||||||
|
"""
|
||||||
|
def KeyDown(self,event):
|
||||||
|
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
|
||||||
|
self.ReturnToUpLevelPage()
|
||||||
|
self._Screen.Draw()
|
||||||
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
|
if event.key == CurKeys["B"]:
|
||||||
|
self.Click()
|
||||||
|
|
||||||
|
if event.key == CurKeys["Up"]:
|
||||||
|
self.ScrollUp()
|
||||||
|
self._Screen.Draw()
|
||||||
|
self._Screen.SwapAndShow()
|
||||||
|
if event.key == CurKeys["Down"]:
|
||||||
|
self.ScrollDown()
|
||||||
|
self._Screen.Draw()
|
||||||
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
|
|
||||||
|
def Draw(self):
|
||||||
|
|
||||||
|
self.ClearCanvas()
|
||||||
|
if len(self._MyList) == 0:
|
||||||
|
return
|
||||||
|
|
||||||
|
else:
|
||||||
|
if len(self._MyList) * PageListItem._Height > self._Height:
|
||||||
|
self._Ps._Width = self._Width - 11
|
||||||
|
self._Ps.Draw()
|
||||||
|
for i in self._MyList:
|
||||||
|
if i._PosY > self._Height + self._Height/2:
|
||||||
|
break
|
||||||
|
if i._PosY < 0:
|
||||||
|
continue
|
||||||
|
i.Draw()
|
||||||
|
self._Scroller.UpdateSize( len(self._MyList)*PageListItem._Height, self._PsIndex*PageListItem._Height)
|
||||||
|
self._Scroller.Draw()
|
||||||
|
|
||||||
|
else:
|
||||||
|
self._Ps._Width = self._Width
|
||||||
|
self._Ps.Draw()
|
||||||
|
for i in self._MyList:
|
||||||
|
if i._PosY > self._Height + self._Height/2:
|
||||||
|
break
|
||||||
|
if i._PosY < 0:
|
||||||
|
continue
|
||||||
|
i.Draw()
|
||||||
|
|
||||||
|
if self._HWND != None:
|
||||||
|
self._HWND.fill((255,255,255))
|
||||||
|
|
||||||
|
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )
|
||||||
|
|
||||||
|
|
||||||
|
class APIOBJ(object):
|
||||||
|
|
||||||
|
_Page = None
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
def Init(self,main_screen):
|
||||||
|
self._Page = LanguagesPage()
|
||||||
|
self._Page._Screen = main_screen
|
||||||
|
self._Page._Name ="Languages"
|
||||||
|
self._Page.Init()
|
||||||
|
|
||||||
|
def API(self,main_screen):
|
||||||
|
if main_screen !=None:
|
||||||
|
main_screen.PushPage(self._Page)
|
||||||
|
main_screen.Draw()
|
||||||
|
main_screen.SwapAndShow()
|
||||||
|
|
||||||
|
OBJ = APIOBJ()
|
||||||
|
def Init(main_screen):
|
||||||
|
OBJ.Init(main_screen)
|
||||||
|
def API(main_screen):
|
||||||
|
OBJ.API(main_screen)
|
||||||
|
|
||||||
|
|
||||||
@ -22,16 +22,16 @@ 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.multi_icon_item import MultiIconItem
|
from UI.multi_icon_item import MultiIconItem
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
from UI.multilabel import MultiLabel
|
from UI.multilabel import MultiLabel
|
||||||
from UI.info_page_list_item import InfoPageListItem
|
from UI.info_page_list_item import InfoPageListItem
|
||||||
from UI.info_page_selector import InfoPageSelector
|
from UI.info_page_selector import InfoPageSelector
|
||||||
|
|
||||||
|
|
||||||
class NotificationPage(Page):
|
class NotificationPage(Page):
|
||||||
_FootMsg = ["Nav.","","","Back","Toggle"]
|
_FootMsg = ["Nav","","","Back","Toggle"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFontObj = fonts["varela13"]
|
_ListFontObj = MyLangManager.TrFont("varela13")
|
||||||
|
|
||||||
_AList = {}
|
_AList = {}
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ class NotificationPage(Page):
|
|||||||
|
|
||||||
if event.key == CurKeys["B"]:
|
if event.key == CurKeys["B"]:
|
||||||
self.ToggleEnable()
|
self.ToggleEnable()
|
||||||
self._Screen._MsgBox.SetText("Applying...")
|
self._Screen._MsgBox.SetText("Applying")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
pygame.time.delay(1000)
|
pygame.time.delay(1000)
|
||||||
|
|||||||
@ -6,14 +6,13 @@ import pygame
|
|||||||
from UI.constants import RUNSYS
|
from UI.constants import RUNSYS
|
||||||
from UI.keys_def import CurKeys
|
from UI.keys_def import CurKeys
|
||||||
from UI.confirm_page import ConfirmPage
|
from UI.confirm_page import ConfirmPage
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
import config
|
import config
|
||||||
|
|
||||||
class PowerOffConfirmPage(ConfirmPage):
|
class PowerOffConfirmPage(ConfirmPage):
|
||||||
|
|
||||||
_ConfirmText = "Confirm Power OFF?"
|
_ConfirmText = MyLangManager.Tr("Confirm Power OFF?")
|
||||||
|
|
||||||
|
|
||||||
def CheckBattery(self):
|
def CheckBattery(self):
|
||||||
try:
|
try:
|
||||||
f = open(config.Battery)
|
f = open(config.Battery)
|
||||||
|
|||||||
@ -19,12 +19,13 @@ 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.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
import config
|
import config
|
||||||
|
|
||||||
class ListPageSelector(PageSelector):
|
class ListPageSelector(PageSelector):
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._PosX = 0
|
self._PosX = 0
|
||||||
@ -84,7 +85,7 @@ class PageListItem(object):
|
|||||||
l = Label()
|
l = Label()
|
||||||
l._PosX = 10
|
l._PosX = 10
|
||||||
l.SetCanvasHWND(self._Parent._CanvasHWND)
|
l.SetCanvasHWND(self._Parent._CanvasHWND)
|
||||||
|
text = MyLangManager.Tr(text)
|
||||||
l.Init(text,self._Fonts["normal"])
|
l.Init(text,self._Fonts["normal"])
|
||||||
self._Labels["Text"] = l
|
self._Labels["Text"] = l
|
||||||
|
|
||||||
@ -103,13 +104,13 @@ class PageListItem(object):
|
|||||||
self._Labels["Small"]._PosY = self._PosY + (self._Height- self._Labels["Small"]._Height)/2
|
self._Labels["Small"]._PosY = self._PosY + (self._Height- self._Labels["Small"]._Height)/2
|
||||||
self._Labels["Small"].Draw()
|
self._Labels["Small"].Draw()
|
||||||
|
|
||||||
pygame.draw.line(self._Parent._CanvasHWND,SkinManager().GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
||||||
|
|
||||||
|
|
||||||
class InfoPage(Page):
|
class InfoPage(Page):
|
||||||
_FootMsg = ["Nav.","","","Back",""]
|
_FootMsg = ["Nav","","","Back",""]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFontObj = fonts["varela15"]
|
_ListFontObj = MyLangManager.TrFont("varela15")
|
||||||
_AList = {}
|
_AList = {}
|
||||||
|
|
||||||
_Time1 = 40
|
_Time1 = 40
|
||||||
@ -123,22 +124,22 @@ class InfoPage(Page):
|
|||||||
m = int(secs/60)
|
m = int(secs/60)
|
||||||
s = secs % 60
|
s = secs % 60
|
||||||
if m > 1:
|
if m > 1:
|
||||||
min_str = "%d minutes " % m
|
min_str = ("%d "+MyLangManager.Tr("minutes")+" ") % m
|
||||||
else:
|
else:
|
||||||
min_str = "%d minute " % m
|
min_str = ("%d "+MyLangManager.Tr("minute")+" ") % m
|
||||||
|
|
||||||
if s == 1:
|
if s == 1:
|
||||||
sec_str = "%d second" % s
|
sec_str = ("%d "+MyLangManager.Tr("second")) % s
|
||||||
elif s > 1:
|
elif s > 1:
|
||||||
sec_str = "%d seconds" % s
|
sec_str = ("%d "+MyLangManager.Tr("seconds")) % s
|
||||||
elif secs > 0:
|
elif secs > 0:
|
||||||
if secs > 1:
|
if secs > 1:
|
||||||
sec_str = "%d seconds" % secs
|
sec_str = ("%d "+MyLangManager.Tr("seconds")) % secs
|
||||||
else:
|
else:
|
||||||
sec_str = "%d second" % secs
|
sec_str = ("%d "+MyLangManager.Tr("second")) % secs
|
||||||
|
|
||||||
elif secs == 0:
|
elif secs == 0:
|
||||||
sec_str = "Never"
|
sec_str = MyLangManager.Tr("Never")
|
||||||
|
|
||||||
return min_str + sec_str
|
return min_str + sec_str
|
||||||
|
|
||||||
@ -156,7 +157,7 @@ class InfoPage(Page):
|
|||||||
time1 = {}
|
time1 = {}
|
||||||
time1["key"] = "time1"
|
time1["key"] = "time1"
|
||||||
if self._Time1 == 0:
|
if self._Time1 == 0:
|
||||||
time1["value"] = "Never"
|
time1["value"] = MyLangManager.Tr("Never")
|
||||||
else:
|
else:
|
||||||
time1["value"] = "%d secs" % self._Time1
|
time1["value"] = "%d secs" % self._Time1
|
||||||
time1["label"] = "Screen dimming"
|
time1["label"] = "Screen dimming"
|
||||||
@ -164,7 +165,7 @@ class InfoPage(Page):
|
|||||||
time2 = {}
|
time2 = {}
|
||||||
time2["key"] = "time2"
|
time2["key"] = "time2"
|
||||||
if self._Time2 == 0:
|
if self._Time2 == 0:
|
||||||
time2["value"] = "Never"
|
time2["value"] = MyLangManager.Tr("Never")
|
||||||
else:
|
else:
|
||||||
time2["value"] = "%d secs" % self._Time2
|
time2["value"] = "%d secs" % self._Time2
|
||||||
|
|
||||||
@ -174,7 +175,7 @@ class InfoPage(Page):
|
|||||||
time3["key"] = "time3"
|
time3["key"] = "time3"
|
||||||
|
|
||||||
if self._Time3 == 0:
|
if self._Time3 == 0:
|
||||||
time3["value"] = "Never"
|
time3["value"] = MyLangManager.Tr("Never")
|
||||||
else:
|
else:
|
||||||
time3["value"] = "%d secs" % self._Time3
|
time3["value"] = "%d secs" % self._Time3
|
||||||
time3["label"] = "Power OFF"
|
time3["label"] = "Power OFF"
|
||||||
@ -189,17 +190,17 @@ class InfoPage(Page):
|
|||||||
start_y = 0
|
start_y = 0
|
||||||
|
|
||||||
for i,v in enumerate( self._AList):
|
for i,v in enumerate( self._AList):
|
||||||
print(v)
|
#print(v)
|
||||||
li = PageListItem()
|
li = PageListItem()
|
||||||
li._Parent = self
|
li._Parent = self
|
||||||
li._PosX = start_x
|
li._PosX = start_x
|
||||||
li._PosY = start_y + i*PageListItem._Height
|
li._PosY = start_y + i*PageListItem._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"] )
|
||||||
else:
|
else:
|
||||||
li.Init( self._AList[v]["key"] )
|
li.Init( self._AList[v]["key"] )
|
||||||
|
|
||||||
@ -289,7 +290,7 @@ class InfoPage(Page):
|
|||||||
i.Draw()
|
i.Draw()
|
||||||
|
|
||||||
class PowerOptionsPage(Page):
|
class PowerOptionsPage(Page):
|
||||||
_FootMsg = ["Nav.","","Detail","Back","Select"]
|
_FootMsg = ["Nav","","Detail","Back","Select"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFont = fonts["notosanscjk15"]
|
_ListFont = fonts["notosanscjk15"]
|
||||||
|
|
||||||
@ -445,11 +446,11 @@ class PowerOptionsPage(Page):
|
|||||||
config.PowerLevel = cur_li._Value
|
config.PowerLevel = cur_li._Value
|
||||||
|
|
||||||
if config.PowerLevel!= "supersaving":
|
if config.PowerLevel!= "supersaving":
|
||||||
os.system("sudo iw wlan0 set power_save off")
|
os.system("sudo iw wlan0 set power_save off > /dev/null")
|
||||||
else:
|
else:
|
||||||
os.system("sudo iw wlan0 set power_save on")
|
os.system("sudo iw wlan0 set power_save on > /dev/null")
|
||||||
|
|
||||||
self._Screen._MsgBox.SetText("Applying...")
|
self._Screen._MsgBox.SetText("Applying")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import os
|
|||||||
|
|
||||||
## local UI import
|
## local UI import
|
||||||
from UI.page import Page
|
from UI.page import Page
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
from UI.constants import ICON_TYPES,Width,Height
|
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
|
||||||
@ -28,7 +28,7 @@ class StoragePage(Page):
|
|||||||
_BGmsg = "%.1fGB of %.1fGB Used"
|
_BGmsg = "%.1fGB of %.1fGB Used"
|
||||||
_DskUsg = None
|
_DskUsg = None
|
||||||
|
|
||||||
_HighColor = SkinManager().GiveColor('High')
|
_HighColor = MySkinManager.GiveColor('High')
|
||||||
_FootMsg = ["Nav.","","","Back",""]
|
_FootMsg = ["Nav.","","","Back",""]
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -99,7 +99,7 @@ class StoragePage(Page):
|
|||||||
|
|
||||||
rect_ = midRect(self._Width/2,self._Height-30,170,17, Width,Height)
|
rect_ = midRect(self._Width/2,self._Height-30,170,17, Width,Height)
|
||||||
|
|
||||||
aa_round_rect(self._CanvasHWND, rect_, SkinManager().GiveColor('Line'), 5, 0, SkinManager().GiveColor('Line'))
|
aa_round_rect(self._CanvasHWND, rect_, MySkinManager.GiveColor('Line'), 5, 0, MySkinManager.GiveColor('Line'))
|
||||||
|
|
||||||
|
|
||||||
rect2 = midRect(self._Width/2,self._Height-30,int(170*(1.0-usage_percent)),17, Width,Height)
|
rect2 = midRect(self._Width/2,self._Height-30,int(170*(1.0-usage_percent)),17, Width,Height)
|
||||||
@ -107,7 +107,7 @@ class StoragePage(Page):
|
|||||||
rect2.left = rect_.left
|
rect2.left = rect_.left
|
||||||
rect2.top = rect_.top
|
rect2.top = rect_.top
|
||||||
|
|
||||||
aa_round_rect(self._CanvasHWND,rect2, SkinManager().GiveColor('Front'),5,0,SkinManager().GiveColor('Front'))
|
aa_round_rect(self._CanvasHWND,rect2, MySkinManager.GiveColor('Front'),5,0,MySkinManager.GiveColor('Front'))
|
||||||
|
|
||||||
class APIOBJ(object):
|
class APIOBJ(object):
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ from UI.label import Label
|
|||||||
from UI.fonts import fonts
|
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 SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
# a item for List
|
# a item for List
|
||||||
# - - - - - - - - - - - --
|
# - - - - - - - - - - - --
|
||||||
@ -32,7 +32,7 @@ class ListItemIcon(IconItem):
|
|||||||
|
|
||||||
class ListItemLabel(Label):
|
class ListItemLabel(Label):
|
||||||
|
|
||||||
_ActiveColor = SkinManager().GiveColor('Active')
|
_ActiveColor = MySkinManager.GiveColor('Active')
|
||||||
_Active = False
|
_Active = False
|
||||||
def Draw(self):
|
def Draw(self):
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ class ListItem(object):
|
|||||||
|
|
||||||
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
|
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
|
||||||
|
|
||||||
pygame.draw.line(self._Parent._CanvasHWND,SkinManager().GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
||||||
|
|
||||||
self._Labels["Text"].Draw()
|
self._Labels["Text"].Draw()
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ from UI.keys_def import CurKeys
|
|||||||
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
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
from list_item import ListItem
|
from list_item import ListItem
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ class TimeLibStack:
|
|||||||
return len(self.stack)
|
return len(self.stack)
|
||||||
|
|
||||||
class ListPageSelector(PageSelector):
|
class ListPageSelector(PageSelector):
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._PosX = 0
|
self._PosX = 0
|
||||||
@ -190,7 +190,7 @@ class TimezoneListPage(Page):
|
|||||||
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!", fonts["varela22"])
|
||||||
self._BGpng.SetLableColor(SkinManager().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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,10 @@ from UI.keys_def import CurKeys
|
|||||||
from UI.confirm_page import ConfirmPage
|
from UI.confirm_page import ConfirmPage
|
||||||
from UI.download import Download
|
from UI.download import Download
|
||||||
from UI.download_process_page import DownloadProcessPage
|
from UI.download_process_page import DownloadProcessPage
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
|
from UI.info_page_list_item import InfoPageListItem
|
||||||
|
|
||||||
from libs.roundrects import aa_round_rect
|
from libs.roundrects import aa_round_rect
|
||||||
from libs.DBUS import is_wifi_connected_now
|
from libs.DBUS import is_wifi_connected_now
|
||||||
@ -60,7 +63,7 @@ class UpdateDownloadPage(DownloadProcessPage):
|
|||||||
print(filename)
|
print(filename)
|
||||||
os.system("rm -rf %s" % CmdClean(filename))
|
os.system("rm -rf %s" % CmdClean(filename))
|
||||||
|
|
||||||
self._Screen._MsgBox.SetText("Download failed")
|
self._Screen._MsgBox.SetText("DownloadFailed")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
return False
|
return False
|
||||||
@ -120,7 +123,7 @@ class UpdateConfirmPage(ConfirmPage):
|
|||||||
if self._DownloadPage == None:
|
if self._DownloadPage == None:
|
||||||
self._DownloadPage = UpdateDownloadPage()
|
self._DownloadPage = UpdateDownloadPage()
|
||||||
self._DownloadPage._Screen = self._Screen
|
self._DownloadPage._Screen = self._Screen
|
||||||
self._DownloadPage._Name = "Downloading..."
|
self._DownloadPage._Name = "Downloading"
|
||||||
self._DownloadPage.Init()
|
self._DownloadPage.Init()
|
||||||
|
|
||||||
self._DownloadPage._MD5 = self._MD5
|
self._DownloadPage._MD5 = self._MD5
|
||||||
@ -148,59 +151,9 @@ class UpdateConfirmPage(ConfirmPage):
|
|||||||
self.Reset()
|
self.Reset()
|
||||||
|
|
||||||
|
|
||||||
class InfoPageListItem(object):
|
|
||||||
_PosX = 0
|
|
||||||
_PosY = 0
|
|
||||||
_Width = 0
|
|
||||||
_Height = 30
|
|
||||||
|
|
||||||
_Labels = {}
|
|
||||||
_Icons = {}
|
|
||||||
_Fonts = {}
|
|
||||||
|
|
||||||
_LinkObj = None
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self._Labels = {}
|
|
||||||
self._Icons = {}
|
|
||||||
self._Fonts = {}
|
|
||||||
|
|
||||||
def SetSmallText(self,text):
|
|
||||||
|
|
||||||
l = Label()
|
|
||||||
l._PosX = 40
|
|
||||||
l.SetCanvasHWND(self._Parent._CanvasHWND)
|
|
||||||
l.Init(text,self._Fonts["small"])
|
|
||||||
self._Labels["Small"] = l
|
|
||||||
|
|
||||||
def Init(self,text):
|
|
||||||
|
|
||||||
#self._Fonts["normal"] = fonts["veramono12"]
|
|
||||||
|
|
||||||
l = Label()
|
|
||||||
l._PosX = 10
|
|
||||||
l.SetCanvasHWND(self._Parent._CanvasHWND)
|
|
||||||
|
|
||||||
l.Init(text,self._Fonts["normal"])
|
|
||||||
self._Labels["Text"] = l
|
|
||||||
|
|
||||||
def Draw(self):
|
|
||||||
|
|
||||||
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
|
|
||||||
self._Labels["Text"].Draw()
|
|
||||||
|
|
||||||
if "Small" in self._Labels:
|
|
||||||
self._Labels["Small"]._PosX = self._Width - self._Labels["Small"]._Width-5
|
|
||||||
|
|
||||||
self._Labels["Small"]._PosY = self._PosY + (self._Height - self._Labels["Small"]._Height)/2
|
|
||||||
self._Labels["Small"].Draw()
|
|
||||||
|
|
||||||
pygame.draw.line(self._Parent._CanvasHWND,SkinManager().GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
|
||||||
|
|
||||||
|
|
||||||
class UpdatePage(Page):
|
class UpdatePage(Page):
|
||||||
_Icons = {}
|
_Icons = {}
|
||||||
_FootMsg = ["Nav.","Check Update","","Back",""]
|
_FootMsg = ["Nav","Check Update","","Back",""]
|
||||||
|
|
||||||
_ListFontObj = fonts["varela15"]
|
_ListFontObj = fonts["varela15"]
|
||||||
_ConfirmPage = None
|
_ConfirmPage = None
|
||||||
@ -256,7 +209,7 @@ class UpdatePage(Page):
|
|||||||
self.GenList()
|
self.GenList()
|
||||||
|
|
||||||
def CheckUpdate(self):
|
def CheckUpdate(self):
|
||||||
self._Screen._MsgBox.SetText("Checking update...")
|
self._Screen._MsgBox.SetText("CheckingUpdate")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
@ -303,7 +256,7 @@ class UpdatePage(Page):
|
|||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
else:
|
else:
|
||||||
self._Screen.Draw()
|
self._Screen.Draw()
|
||||||
self._Screen._MsgBox.SetText("Launcher is up to date")
|
self._Screen._MsgBox.SetText("LauncherIsUpToDate")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
pygame.time.delay(765)
|
pygame.time.delay(765)
|
||||||
@ -334,12 +287,12 @@ class UpdatePage(Page):
|
|||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
else:
|
else:
|
||||||
self._Screen.Draw()
|
self._Screen.Draw()
|
||||||
self._Screen._MsgBox.SetText("Checking update failed")
|
self._Screen._MsgBox.SetText("CheckingUpdateFailed")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
else:
|
else:
|
||||||
self._Screen.Draw()
|
self._Screen.Draw()
|
||||||
self._Screen._MsgBox.SetText("Please Check your Wi-Fi connection")
|
self._Screen._MsgBox.SetText("CheckWifiConnection")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
@ -360,7 +313,7 @@ class APIOBJ(object):
|
|||||||
self._UpdatePage = UpdatePage()
|
self._UpdatePage = UpdatePage()
|
||||||
|
|
||||||
self._UpdatePage._Screen = main_screen
|
self._UpdatePage._Screen = main_screen
|
||||||
self._UpdatePage._Name ="Update"
|
self._UpdatePage._Name = "Update"
|
||||||
self._UpdatePage.Init()
|
self._UpdatePage.Init()
|
||||||
|
|
||||||
def API(self,main_screen):
|
def API(self,main_screen):
|
||||||
|
|||||||
@ -9,7 +9,7 @@ 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
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
|
|
||||||
class NetItemMultiIcon(MultiIconItem):
|
class NetItemMultiIcon(MultiIconItem):
|
||||||
@ -195,6 +195,6 @@ class NetItem(object):
|
|||||||
self._Icons["wifistatus"].NewCoord(self._Width-23,self._PosY)
|
self._Icons["wifistatus"].NewCoord(self._Width-23,self._PosY)
|
||||||
self._Icons["wifistatus"].Draw()
|
self._Icons["wifistatus"].Draw()
|
||||||
|
|
||||||
pygame.draw.line(self._Parent._CanvasHWND,SkinManager().GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,8 @@ from UI.util_funcs import midRect,SwapAndShow
|
|||||||
from UI.keys_def import CurKeys
|
from UI.keys_def import CurKeys
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
from UI.confirm_page import ConfirmPage
|
from UI.confirm_page import ConfirmPage
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
from UI.info_page_list_item import InfoPageListItem
|
from UI.info_page_list_item import InfoPageListItem
|
||||||
from UI.info_page_selector import InfoPageSelector
|
from UI.info_page_selector import InfoPageSelector
|
||||||
@ -26,7 +27,7 @@ import myvars
|
|||||||
|
|
||||||
class WifiDisconnectConfirmPage(ConfirmPage):
|
class WifiDisconnectConfirmPage(ConfirmPage):
|
||||||
|
|
||||||
_ConfirmText = "Confirm Disconnect?"
|
_ConfirmText = MyLangManager.Tr("ConfirmDisconnectQ")
|
||||||
|
|
||||||
def KeyDown(self,event):
|
def KeyDown(self,event):
|
||||||
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
|
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
|
||||||
@ -35,7 +36,7 @@ class WifiDisconnectConfirmPage(ConfirmPage):
|
|||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
if event.key == CurKeys["B"]:
|
if event.key == CurKeys["B"]:
|
||||||
self.SnapMsg("Disconnecting...")
|
self.SnapMsg(MyLangManager.Tr("Disconnecting"))
|
||||||
self._Screen.Draw()
|
self._Screen.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
@ -57,9 +58,9 @@ class WifiDisconnectConfirmPage(ConfirmPage):
|
|||||||
self.Reset()
|
self.Reset()
|
||||||
|
|
||||||
class WifiInfoPage(Page):
|
class WifiInfoPage(Page):
|
||||||
_FootMsg = ["Nav.","Disconnect","","Back",""]
|
_FootMsg = ["Nav","Disconnect","","Back",""]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFontObj = fonts["varela15"]
|
_ListFontObj = MyLangManager.TrFont("varela15")
|
||||||
|
|
||||||
_Wireless = None
|
_Wireless = None
|
||||||
_Daemon = None
|
_Daemon = None
|
||||||
@ -224,7 +225,7 @@ class WifiInfoPage(Page):
|
|||||||
|
|
||||||
|
|
||||||
class WifiListSelector(PageSelector):
|
class WifiListSelector(PageSelector):
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._PosX = 0
|
self._PosX = 0
|
||||||
@ -260,9 +261,9 @@ class WifiListMessageBox(Label):
|
|||||||
x = (self._Parent._Width - w)/2
|
x = (self._Parent._Width - w)/2
|
||||||
y = (self._Parent._Height - h)/2
|
y = (self._Parent._Height - h)/2
|
||||||
padding = 10
|
padding = 10
|
||||||
pygame.draw.rect(self._CanvasHWND,SkinManager().GiveColor('White'),(x-padding,y-padding, w+padding*2,h+padding*2))
|
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),(x-padding,y-padding, w+padding*2,h+padding*2))
|
||||||
|
|
||||||
pygame.draw.rect(self._CanvasHWND,SkinManager().GiveColor('Black'),(x-padding,y-padding, w+padding*2,h+padding*2),1)
|
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Black'),(x-padding,y-padding, w+padding*2,h+padding*2),1)
|
||||||
|
|
||||||
self._CanvasHWND.blit(my_text,(x,y,w,h))
|
self._CanvasHWND.blit(my_text,(x,y,w,h))
|
||||||
|
|
||||||
@ -287,7 +288,7 @@ class WifiList(Page):
|
|||||||
_BlockCb = None
|
_BlockCb = None
|
||||||
|
|
||||||
_LastStatusMsg = ""
|
_LastStatusMsg = ""
|
||||||
_FootMsg = ["Nav.","Scan","Info","Back","Enter"]
|
_FootMsg = ["Nav","Scan","Info","Back","Enter"]
|
||||||
_EncMethods = None
|
_EncMethods = None
|
||||||
_Scroller = None
|
_Scroller = None
|
||||||
_ListFontObj = fonts["notosanscjk15"]
|
_ListFontObj = fonts["notosanscjk15"]
|
||||||
@ -370,7 +371,7 @@ class WifiList(Page):
|
|||||||
return
|
return
|
||||||
|
|
||||||
self._Scanning = True
|
self._Scanning = True
|
||||||
self.ShowBox("Wifi scanning...")
|
self.ShowBox(MyLangManager.Tr("Wifi scanning"))
|
||||||
self._BlockingUI = True
|
self._BlockingUI = True
|
||||||
print("dbus says start scan...")
|
print("dbus says start scan...")
|
||||||
|
|
||||||
@ -537,7 +538,7 @@ class WifiList(Page):
|
|||||||
self._Wireless.SetWirelessProperty(netid,"apsk",password)
|
self._Wireless.SetWirelessProperty(netid,"apsk",password)
|
||||||
self._Wireless.SetWirelessProperty(netid,"automatic",1)
|
self._Wireless.SetWirelessProperty(netid,"automatic",1)
|
||||||
|
|
||||||
self.ShowBox("Connecting...")
|
self.ShowBox(MyLangManager.Tr("Connecting"))
|
||||||
|
|
||||||
self._WirelessList[netid].Connect()
|
self._WirelessList[netid].Connect()
|
||||||
print("after Connect")
|
print("after Connect")
|
||||||
@ -547,7 +548,7 @@ class WifiList(Page):
|
|||||||
results = []
|
results = []
|
||||||
activeID = -1
|
activeID = -1
|
||||||
for x,enc_type in enumerate(self._EncMethods):
|
for x,enc_type in enumerate(self._EncMethods):
|
||||||
if enc_type["type"] == self._Wireless.GetWirelessProperty(network_id,"enctype"):
|
if enc_type["type"] == self._Wireless.GetWirelessProperty(network_id,"encryption_method"):
|
||||||
activeID = x
|
activeID = x
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -620,7 +621,7 @@ class WifiList(Page):
|
|||||||
wireless_connecting = self._Wireless.CheckIfWirelessConnecting()
|
wireless_connecting = self._Wireless.CheckIfWirelessConnecting()
|
||||||
if wireless_connecting:
|
if wireless_connecting:
|
||||||
self.ShutDownConnecting()
|
self.ShutDownConnecting()
|
||||||
self.ShowBox("ShutDownConnecting...")
|
self.ShowBox(MyLangManager.Tr("ShutDownConnecting"))
|
||||||
self._BlockingUI=True
|
self._BlockingUI=True
|
||||||
self._BlockCb = self.AbortedAndReturnToUpLevel
|
self._BlockCb = self.AbortedAndReturnToUpLevel
|
||||||
else:
|
else:
|
||||||
@ -645,7 +646,6 @@ class WifiList(Page):
|
|||||||
return
|
return
|
||||||
|
|
||||||
wicd_wirelss_encrypt_pwd = self.GetWirelessEncrypt(self._PsIndex)
|
wicd_wirelss_encrypt_pwd = self.GetWirelessEncrypt(self._PsIndex)
|
||||||
|
|
||||||
if self._WirelessList[self._PsIndex]._IsActive:
|
if self._WirelessList[self._PsIndex]._IsActive:
|
||||||
self.ShowBox( self._Wireless.GetWirelessIP('') )
|
self.ShowBox( self._Wireless.GetWirelessIP('') )
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import pygame
|
|||||||
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.fonts import fonts
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
# a item for List
|
# a item for List
|
||||||
# - - - - - - - - - - - --
|
# - - - - - - - - - - - --
|
||||||
# | Icon Text..... > |
|
# | Icon Text..... > |
|
||||||
@ -34,9 +34,6 @@ class ListItem(object):
|
|||||||
self._Icons = {}
|
self._Icons = {}
|
||||||
self._Fonts = {}
|
self._Fonts = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def Init(self,text):
|
def Init(self,text):
|
||||||
|
|
||||||
#self._Fonts["normal"] = fonts["veramono12"]
|
#self._Fonts["normal"] = fonts["veramono12"]
|
||||||
@ -44,7 +41,7 @@ class ListItem(object):
|
|||||||
l = Label()
|
l = Label()
|
||||||
l._PosX = 16
|
l._PosX = 16
|
||||||
l.SetCanvasHWND(self._Parent._CanvasHWND)
|
l.SetCanvasHWND(self._Parent._CanvasHWND)
|
||||||
|
text = MyLangManager.Tr(text)
|
||||||
l.Init(text,self._Fonts["normal"])
|
l.Init(text,self._Fonts["normal"])
|
||||||
self._Labels["Text"] = l
|
self._Labels["Text"] = l
|
||||||
|
|
||||||
|
|||||||
@ -13,40 +13,14 @@ 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
|
from UI.keys_def import CurKeys
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
from UI.info_page_selector import InfoPageSelector
|
||||||
|
|
||||||
from list_item import ListItem
|
from list_item import ListItem
|
||||||
|
|
||||||
import myvars
|
import myvars
|
||||||
|
|
||||||
class ListPageSelector(PageSelector):
|
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self._PosX = 0
|
|
||||||
self._PosY = 0
|
|
||||||
self._Height = 0
|
|
||||||
self._Width = Width
|
|
||||||
|
|
||||||
def AnimateDraw(self,x2,y2):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def Draw(self):
|
|
||||||
idx = self._Parent._PsIndex
|
|
||||||
if idx < len(self._Parent._MyList):
|
|
||||||
x = 2
|
|
||||||
y = self._Parent._MyList[idx]._PosY+1
|
|
||||||
h = self._Parent._MyList[idx]._Height -3
|
|
||||||
|
|
||||||
self._PosX = x
|
|
||||||
self._PosY = y
|
|
||||||
self._Height = h
|
|
||||||
|
|
||||||
aa_round_rect(self._Parent._CanvasHWND,
|
|
||||||
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ListPage(Page):
|
class ListPage(Page):
|
||||||
|
|
||||||
_Icons = {}
|
_Icons = {}
|
||||||
@ -54,7 +28,7 @@ class ListPage(Page):
|
|||||||
|
|
||||||
_FootMsg = ["Nav","","","Back","Enter"]
|
_FootMsg = ["Nav","","","Back","Enter"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFontObj = fonts["varela15"]
|
_ListFontObj = MyLangManager.TrFont("varela15")
|
||||||
|
|
||||||
_Scroller = None
|
_Scroller = None
|
||||||
|
|
||||||
@ -71,11 +45,12 @@ class ListPage(Page):
|
|||||||
|
|
||||||
self._CanvasHWND = self._Screen._CanvasHWND
|
self._CanvasHWND = self._Screen._CanvasHWND
|
||||||
|
|
||||||
ps = ListPageSelector()
|
ps = InfoPageSelector()
|
||||||
ps._Parent = self
|
ps._Parent = self
|
||||||
|
ps._PosX = 2
|
||||||
self._Ps = ps
|
self._Ps = ps
|
||||||
self._PsIndex = 0
|
self._PsIndex = 0
|
||||||
|
|
||||||
# "" pkgname, label
|
# "" pkgname, label
|
||||||
alist = [["","Airplane","Airplane Mode"],
|
alist = [["","Airplane","Airplane Mode"],
|
||||||
["","PowerOptions","Power Options"],
|
["","PowerOptions","Power Options"],
|
||||||
@ -85,6 +60,7 @@ class ListPage(Page):
|
|||||||
["","Brightness","BackLight Brightness"],
|
["","Brightness","BackLight Brightness"],
|
||||||
["","Storage",""],
|
["","Storage",""],
|
||||||
["","Time","Timezone"],
|
["","Time","Timezone"],
|
||||||
|
["","Languages","Languages"],
|
||||||
["","Notification","Notification"],
|
["","Notification","Notification"],
|
||||||
["","Update", ""],
|
["","Update", ""],
|
||||||
["","About", "About"],
|
["","About", "About"],
|
||||||
|
|||||||
@ -10,7 +10,7 @@ from UI.label import Label
|
|||||||
from UI.fonts import fonts
|
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 SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
# a item for List
|
# a item for List
|
||||||
# - - - - - - - - - - - --
|
# - - - - - - - - - - - --
|
||||||
@ -32,7 +32,7 @@ class ListItemIcon(IconItem):
|
|||||||
|
|
||||||
class ListItemLabel(Label):
|
class ListItemLabel(Label):
|
||||||
|
|
||||||
_ActiveColor = SkinManager().GiveColor('Active')
|
_ActiveColor = MySkinManager.GiveColor('Active')
|
||||||
_Active = False
|
_Active = False
|
||||||
def Draw(self):
|
def Draw(self):
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ class ListItem(object):
|
|||||||
|
|
||||||
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
|
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
|
||||||
|
|
||||||
pygame.draw.line(self._Parent._CanvasHWND,SkinManager().GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
||||||
|
|
||||||
if self._Playing == True:
|
if self._Playing == True:
|
||||||
self._Labels["Text"]._Active =True
|
self._Labels["Text"]._Active =True
|
||||||
@ -128,7 +128,7 @@ class ListItem(object):
|
|||||||
|
|
||||||
if self._PlayingProcess > 0:
|
if self._PlayingProcess > 0:
|
||||||
seek_posx = int(self._Width * self._PlayingProcess/100.0)
|
seek_posx = int(self._Width * self._PlayingProcess/100.0)
|
||||||
pygame.draw.line(self._Parent._CanvasHWND,SkinManager().GiveColor('Active'),(self._PosX,self._PosY+self._Height-2),(self._PosX+seek_posx,self._PosY+self._Height-2),2)
|
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Active'),(self._PosX,self._PosY+self._Height-2),(self._PosX+seek_posx,self._PosY+self._Height-2),2)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self._Labels["Text"].Draw()
|
self._Labels["Text"].Draw()
|
||||||
|
|||||||
@ -20,7 +20,7 @@ from UI.util_funcs import midRect
|
|||||||
from UI.keys_def import CurKeys
|
from UI.keys_def import CurKeys
|
||||||
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 SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ class MPDSpectrumPage(Page):
|
|||||||
_SongFont = fonts["notosanscjk12"]
|
_SongFont = fonts["notosanscjk12"]
|
||||||
_PIFI = None
|
_PIFI = None
|
||||||
_FIFO = None
|
_FIFO = None
|
||||||
_Color = SkinManager().GiveColor('Front')
|
_Color = MySkinManager.GiveColor('Front')
|
||||||
_GobjectIntervalId = -1
|
_GobjectIntervalId = -1
|
||||||
_Queue = None
|
_Queue = None
|
||||||
_KeepReading = True
|
_KeepReading = True
|
||||||
@ -163,22 +163,22 @@ class MPDSpectrumPage(Page):
|
|||||||
|
|
||||||
self._song_title = Label()
|
self._song_title = Label()
|
||||||
self._song_title.SetCanvasHWND(self._RollCanvas)
|
self._song_title.SetCanvasHWND(self._RollCanvas)
|
||||||
self._song_title.Init("Untitled",self._SongFont,SkinManager().GiveColor('White'))
|
self._song_title.Init("Untitled",self._SongFont,MySkinManager.GiveColor('White'))
|
||||||
|
|
||||||
|
|
||||||
self._title = Label()
|
self._title = Label()
|
||||||
self._title.SetCanvasHWND(self._CanvasHWND)
|
self._title.SetCanvasHWND(self._CanvasHWND)
|
||||||
self._title.Init("Title:",self._ListFont,SkinManager().GiveColor('White'))
|
self._title.Init("Title:",self._ListFont,MySkinManager.GiveColor('White'))
|
||||||
|
|
||||||
self._time = Label()
|
self._time = Label()
|
||||||
self._time.SetCanvasHWND(self._CanvasHWND)
|
self._time.SetCanvasHWND(self._CanvasHWND)
|
||||||
self._time.Init("Time:",self._ListFont,SkinManager().GiveColor('White'))
|
self._time.Init("Time:",self._ListFont,MySkinManager.GiveColor('White'))
|
||||||
|
|
||||||
|
|
||||||
self._time2 = Label()
|
self._time2 = Label()
|
||||||
self._time2.SetCanvasHWND(self._CanvasHWND)
|
self._time2.SetCanvasHWND(self._CanvasHWND)
|
||||||
self._time2.Init("00:00-00:00", self._ListFont,
|
self._time2.Init("00:00-00:00", self._ListFont,
|
||||||
SkinManager().GiveColor('White'))
|
MySkinManager.GiveColor('White'))
|
||||||
|
|
||||||
|
|
||||||
self.Start()
|
self.Start()
|
||||||
@ -229,7 +229,7 @@ class MPDSpectrumPage(Page):
|
|||||||
|
|
||||||
|
|
||||||
def ClearCanvas(self):
|
def ClearCanvas(self):
|
||||||
self._CanvasHWND.fill(SkinManager().GiveColor('Black'))
|
self._CanvasHWND.fill(MySkinManager.GiveColor('Black'))
|
||||||
|
|
||||||
def SgsSmooth(self):
|
def SgsSmooth(self):
|
||||||
passes = 1
|
passes = 1
|
||||||
@ -343,7 +343,7 @@ class MPDSpectrumPage(Page):
|
|||||||
|
|
||||||
if self._RollCanvas != None:
|
if self._RollCanvas != None:
|
||||||
# self._RollCanvas.fill((111,22,33))
|
# self._RollCanvas.fill((111,22,33))
|
||||||
self._RollCanvas.fill(SkinManager().GiveColor('Black'))
|
self._RollCanvas.fill(MySkinManager.GiveColor('Black'))
|
||||||
if self._song_title._Width > self._RollW:
|
if self._song_title._Width > self._RollW:
|
||||||
if (self._song_title._PosX + self._song_title._Width) > self._RollW and self._frames % 30 == 0:
|
if (self._song_title._PosX + self._song_title._Width) > self._RollW and self._frames % 30 == 0:
|
||||||
self._song_title._PosX -= 1
|
self._song_title._PosX -= 1
|
||||||
@ -417,9 +417,9 @@ class MPDSpectrumPage(Page):
|
|||||||
else:
|
else:
|
||||||
self._capYPositionArray[i] = value
|
self._capYPositionArray[i] = value
|
||||||
|
|
||||||
pygame.draw.rect(self._CanvasHWND,SkinManager().GiveColor('White'),(i*(bw+gap)+margin_left,self._Height-gap-self._capYPositionArray[i]-margin_bottom,bw,gap),0)
|
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),(i*(bw+gap)+margin_left,self._Height-gap-self._capYPositionArray[i]-margin_bottom,bw,gap),0)
|
||||||
|
|
||||||
pygame.draw.rect(self._CanvasHWND,SkinManager().GiveColor('White'),(i*(bw+gap)+margin_left,self._Height-value-gap-margin_bottom,bw,value+gap),0)
|
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),(i*(bw+gap)+margin_left,self._Height-value-gap-margin_bottom,bw,value+gap),0)
|
||||||
|
|
||||||
self._vis_values[i] -= 2
|
self._vis_values[i] -= 2
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,8 @@ from UI.keys_def import CurKeys
|
|||||||
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
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
from list_item import ListItem
|
from list_item import ListItem
|
||||||
|
|
||||||
@ -49,7 +50,7 @@ class MusicLibStack:
|
|||||||
return len(self.stack)
|
return len(self.stack)
|
||||||
|
|
||||||
class ListPageSelector(PageSelector):
|
class ListPageSelector(PageSelector):
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._PosX = 0
|
self._PosX = 0
|
||||||
@ -184,8 +185,8 @@ class MusicLibListPage(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("Please upload data over Wi-Fi", fonts["varela22"])
|
self._BGpng.AddLabel(MyLangManager.Tr("Please upload data over Wi-Fi"), MyLangManager.TrFont("varela22"))
|
||||||
self._BGpng.SetLableColor(SkinManager().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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,8 @@ from UI.fonts import fonts
|
|||||||
from UI.util_funcs import midRect
|
from UI.util_funcs import midRect
|
||||||
from UI.keys_def import CurKeys
|
from UI.keys_def import CurKeys
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ from list_item import ListItem
|
|||||||
import myvars
|
import myvars
|
||||||
|
|
||||||
class ListPageSelector(PageSelector):
|
class ListPageSelector(PageSelector):
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._PosX = 0
|
self._PosX = 0
|
||||||
@ -183,8 +184,8 @@ class PlayListPage(Page):
|
|||||||
self._BGpng._ImgSurf = MyIconPool._Icons["heart"]
|
self._BGpng._ImgSurf = MyIconPool._Icons["heart"]
|
||||||
self._BGpng._MyType = ICON_TYPES["STAT"]
|
self._BGpng._MyType = ICON_TYPES["STAT"]
|
||||||
self._BGpng._Parent = self
|
self._BGpng._Parent = self
|
||||||
self._BGpng.AddLabel("my favourites", fonts["varela18"])
|
self._BGpng.AddLabel(MyLangManager.Tr("my favourites"), MyLangManager.TrFont("varela18"))
|
||||||
self._BGpng.SetLableColor(SkinManager().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)
|
||||||
|
|
||||||
self._Scroller = ListScroller()
|
self._Scroller = ListScroller()
|
||||||
|
|||||||
@ -10,12 +10,13 @@ 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
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
from libs.DBUS import is_wifi_connected_now,get_wifi_ip
|
from libs.DBUS import is_wifi_connected_now,get_wifi_ip
|
||||||
|
|
||||||
class TinyCloudPage(Page):
|
class TinyCloudPage(Page):
|
||||||
_FootMsg = ["Nav.","","","Back",""]
|
_FootMsg = ["Nav","","","Back",""]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
|
|
||||||
_ListFontObj = fonts["varela13"]
|
_ListFontObj = fonts["varela13"]
|
||||||
@ -25,8 +26,8 @@ class TinyCloudPage(Page):
|
|||||||
|
|
||||||
_Coords = {}
|
_Coords = {}
|
||||||
|
|
||||||
_URLColor = SkinManager().GiveColor('URL')
|
_URLColor = MySkinManager.GiveColor('URL')
|
||||||
_TextColor = SkinManager().GiveColor('Text')
|
_TextColor = MySkinManager.GiveColor('Text')
|
||||||
_Scrolled = 0
|
_Scrolled = 0
|
||||||
|
|
||||||
_PngSize = {}
|
_PngSize = {}
|
||||||
@ -198,7 +199,7 @@ class TinyCloudPage(Page):
|
|||||||
self._DrawOnce = True
|
self._DrawOnce = True
|
||||||
|
|
||||||
if self._HWND != None:
|
if self._HWND != None:
|
||||||
self._HWND.fill(SkinManager().GiveColor('White'))
|
self._HWND.fill(MySkinManager.GiveColor('White'))
|
||||||
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )
|
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
[Colors]
|
|
||||||
High = #33a6ff
|
|
||||||
White = #ffffff
|
|
||||||
@ -11,6 +11,7 @@ import sys
|
|||||||
from UI.delete_confirm_page import DeleteConfirmPage
|
from UI.delete_confirm_page import DeleteConfirmPage
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
from UI.keys_def import CurKeys
|
from UI.keys_def import CurKeys
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
from rom_list_page import RomListPage
|
from rom_list_page import RomListPage
|
||||||
from fav_list_page import FavListPage
|
from fav_list_page import FavListPage
|
||||||
@ -34,7 +35,7 @@ class FavDeleteConfirmPage(DeleteConfirmPage):
|
|||||||
except:
|
except:
|
||||||
print("error in FavDeleteConfirmPage chown ")
|
print("error in FavDeleteConfirmPage chown ")
|
||||||
|
|
||||||
self.SnapMsg("Deleteing....")
|
self.SnapMsg(MyLangManager.Tr("Deleteing"))
|
||||||
self._Screen.Draw()
|
self._Screen.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
self.Reset()
|
self.Reset()
|
||||||
@ -75,18 +76,18 @@ class MyEmulator(object):
|
|||||||
def InitDeleteConfirmPage(self,main_screen):
|
def InitDeleteConfirmPage(self,main_screen):
|
||||||
self.DeleteConfirmPage = DeleteConfirmPage()
|
self.DeleteConfirmPage = DeleteConfirmPage()
|
||||||
self.DeleteConfirmPage._Screen = main_screen
|
self.DeleteConfirmPage._Screen = main_screen
|
||||||
self.DeleteConfirmPage._Name = "Delete Confirm"
|
self.DeleteConfirmPage._Name = "DeleteConfirm"
|
||||||
self.DeleteConfirmPage.Init()
|
self.DeleteConfirmPage.Init()
|
||||||
|
|
||||||
self.FavDeleteConfirmPage = FavDeleteConfirmPage()
|
self.FavDeleteConfirmPage = FavDeleteConfirmPage()
|
||||||
self.FavDeleteConfirmPage._Screen = main_screen
|
self.FavDeleteConfirmPage._Screen = main_screen
|
||||||
self.FavDeleteConfirmPage._Name = "Delete Confirm"
|
self.FavDeleteConfirmPage._Name = "DeleteConfirm"
|
||||||
self.FavDeleteConfirmPage.Init()
|
self.FavDeleteConfirmPage.Init()
|
||||||
|
|
||||||
def InitFavListPage(self,main_screen):
|
def InitFavListPage(self,main_screen):
|
||||||
self.FavListPage = FavListPage()
|
self.FavListPage = FavListPage()
|
||||||
self.FavListPage._Screen = main_screen
|
self.FavListPage._Screen = main_screen
|
||||||
self.FavListPage._Name = "Favourite Games"
|
self.FavListPage._Name = "FavouriteGames"
|
||||||
self.FavListPage._Emulator = self._Emulator
|
self.FavListPage._Emulator = self._Emulator
|
||||||
self.FavListPage._Parent = self
|
self.FavListPage._Parent = self
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,8 @@ from UI.keys_def import CurKeys
|
|||||||
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
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
from rom_so_confirm_page import RomSoConfirmPage
|
from rom_so_confirm_page import RomSoConfirmPage
|
||||||
|
|
||||||
@ -52,7 +53,7 @@ class FavStack:
|
|||||||
return len(self.stack)
|
return len(self.stack)
|
||||||
|
|
||||||
class ListPageSelector(PageSelector):
|
class ListPageSelector(PageSelector):
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._PosX = 0
|
self._PosX = 0
|
||||||
@ -230,8 +231,8 @@ class FavListPage(Page):
|
|||||||
bgpng._ImgSurf = MyIconPool._Icons["star"]
|
bgpng._ImgSurf = MyIconPool._Icons["star"]
|
||||||
bgpng._MyType = ICON_TYPES["STAT"]
|
bgpng._MyType = ICON_TYPES["STAT"]
|
||||||
bgpng._Parent = self
|
bgpng._Parent = self
|
||||||
bgpng.AddLabel("my favourites games", fonts["varela18"])
|
bgpng.AddLabel(MyLangManager.Tr("MyFavGames"), MyLangManager.TrFont("varela18"))
|
||||||
bgpng.SetLableColor(SkinManager().GiveColor('Disabled'))
|
bgpng.SetLableColor(MySkinManager.GiveColor('Disabled'))
|
||||||
bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||||
|
|
||||||
self._Icons["bg"] = bgpng
|
self._Icons["bg"] = bgpng
|
||||||
@ -307,8 +308,8 @@ class FavListPage(Page):
|
|||||||
if cur_li._MyType == ICON_TYPES["DIR"]:
|
if cur_li._MyType == ICON_TYPES["DIR"]:
|
||||||
return
|
return
|
||||||
|
|
||||||
if cur_li._MyType == ICON_TYPES["FILE"]: ## add to playlist only
|
if cur_li._MyType == ICON_TYPES["FILE"]:
|
||||||
self._Screen._MsgBox.SetText("Launching...")
|
self._Screen._MsgBox.SetText("Launching")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
if self._Emulator["FILETYPE"] == "dir":
|
if self._Emulator["FILETYPE"] == "dir":
|
||||||
@ -418,7 +419,7 @@ class FavListPage(Page):
|
|||||||
#delete directly without confirm dialog
|
#delete directly without confirm dialog
|
||||||
stats = os.stat(cur_li._Path)
|
stats = os.stat(cur_li._Path)
|
||||||
os.chown(cur_li._Path, stats.st_uid,stats.st_uid) ## normally uid and gid should be the same
|
os.chown(cur_li._Path, stats.st_uid,stats.st_uid) ## normally uid and gid should be the same
|
||||||
self._Screen._MsgBox.SetText("Deleting...")
|
self._Screen._MsgBox.SetText("Deleting")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
pygame.time.delay(600)
|
pygame.time.delay(600)
|
||||||
|
|||||||
@ -11,7 +11,7 @@ from UI.label import Label
|
|||||||
from UI.fonts import fonts
|
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 SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
# a item for List
|
# a item for List
|
||||||
# - - - - - - - - - - - --
|
# - - - - - - - - - - - --
|
||||||
@ -113,6 +113,6 @@ class ListItem(object):
|
|||||||
self._Parent._Icons["sys"].NewCoord(self._PosX+12,self._PosY+ (self._Height - self._Parent._Icons["sys"]._Height)/2+self._Parent._Icons["sys"]._Height/2)
|
self._Parent._Icons["sys"].NewCoord(self._PosX+12,self._PosY+ (self._Height - self._Parent._Icons["sys"]._Height)/2+self._Parent._Icons["sys"]._Height/2)
|
||||||
self._Parent._Icons["sys"].Draw()
|
self._Parent._Icons["sys"].Draw()
|
||||||
|
|
||||||
pygame.draw.line(self._Parent._CanvasHWND,SkinManager().GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,8 @@ from UI.keys_def import CurKeys
|
|||||||
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
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
from rom_so_confirm_page import RomSoConfirmPage
|
from rom_so_confirm_page import RomSoConfirmPage
|
||||||
|
|
||||||
@ -59,7 +60,7 @@ class RomStack:
|
|||||||
return len(self.stack)
|
return len(self.stack)
|
||||||
|
|
||||||
class ListPageSelector(PageSelector):
|
class ListPageSelector(PageSelector):
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._PosX = 0
|
self._PosX = 0
|
||||||
@ -98,7 +99,7 @@ class RomListPage(Page):
|
|||||||
|
|
||||||
_Icons = {}
|
_Icons = {}
|
||||||
_Selector=None
|
_Selector=None
|
||||||
_FootMsg = ["Nav","Scan","Del","Add Fav","Run"]
|
_FootMsg = ["Nav","Scan","Del","AddFav","Run"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFont = fonts["notosanscjk15"]
|
_ListFont = fonts["notosanscjk15"]
|
||||||
_MyStack = None
|
_MyStack = None
|
||||||
@ -264,8 +265,8 @@ class RomListPage(Page):
|
|||||||
bgpng._ImgSurf = MyIconPool._Icons["empty"]
|
bgpng._ImgSurf = MyIconPool._Icons["empty"]
|
||||||
bgpng._MyType = ICON_TYPES["STAT"]
|
bgpng._MyType = ICON_TYPES["STAT"]
|
||||||
bgpng._Parent = self
|
bgpng._Parent = self
|
||||||
bgpng.AddLabel("Please upload data over Wi-Fi", fonts["varela22"])
|
bgpng.AddLabel(MyLangManager.Tr("Please upload data over Wi-Fi"), MyLangManager.TrFont("varela22"))
|
||||||
bgpng.SetLableColor(SkinManager().GiveColor('Disabled'))
|
bgpng.SetLableColor(MySkinManager.GiveColor('Disabled'))
|
||||||
bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||||
|
|
||||||
self._Icons["bg"] = bgpng
|
self._Icons["bg"] = bgpng
|
||||||
@ -346,8 +347,8 @@ class RomListPage(Page):
|
|||||||
self.SyncList( self._MyStack.Last() )
|
self.SyncList( self._MyStack.Last() )
|
||||||
self._PsIndex = 0
|
self._PsIndex = 0
|
||||||
|
|
||||||
if cur_li._MyType == ICON_TYPES["FILE"]: ## add to playlist only
|
if cur_li._MyType == ICON_TYPES["FILE"]:
|
||||||
self._Screen._MsgBox.SetText("Launching...")
|
self._Screen._MsgBox.SetText("Launching")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
@ -447,7 +448,7 @@ class RomListPage(Page):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self._Screen._MsgBox.SetText("Adding to Favourite list")
|
self._Screen._MsgBox.SetText("AddFavList")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
|
|||||||
@ -17,13 +17,14 @@ from UI.download_process_page import DownloadProcessPage
|
|||||||
from UI.keys_def import CurKeys
|
from UI.keys_def import CurKeys
|
||||||
from UI.fonts import fonts
|
from UI.fonts import fonts
|
||||||
from UI.multilabel import MultiLabel
|
from UI.multilabel import MultiLabel
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
import config
|
import config
|
||||||
|
|
||||||
class RomSoConfirmPage(ConfirmPage):
|
class RomSoConfirmPage(ConfirmPage):
|
||||||
_ListFont = fonts["veramono18"]
|
_ListFont = MyLangManager.TrFont("veramono18")
|
||||||
|
|
||||||
_ConfirmText = "Do you want to setup this game engine automatically?"
|
_ConfirmText = MyLangManager.Tr("SetupGameEngineAutoQ")
|
||||||
|
|
||||||
_MyDownloadPage = None
|
_MyDownloadPage = None
|
||||||
|
|
||||||
@ -93,12 +94,12 @@ class RomSoConfirmPage(ConfirmPage):
|
|||||||
|
|
||||||
if event.key == CurKeys["B"]:
|
if event.key == CurKeys["B"]:
|
||||||
if self.CheckBattery() < 5:
|
if self.CheckBattery() < 5:
|
||||||
self.SnapMsg("Battery must over 5%")
|
self.SnapMsg(MyLangManager.Tr("BATOver5Pct"))
|
||||||
else:
|
else:
|
||||||
if self._MyDownloadPage == None:
|
if self._MyDownloadPage == None:
|
||||||
self._MyDownloadPage = DownloadProcessPage()
|
self._MyDownloadPage = DownloadProcessPage()
|
||||||
self._MyDownloadPage._Screen = self._Screen
|
self._MyDownloadPage._Screen = self._Screen
|
||||||
self._MyDownloadPage._Name = "Downloading..."
|
self._MyDownloadPage._Name = "Downloading"
|
||||||
self._MyDownloadPage.Init()
|
self._MyDownloadPage.Init()
|
||||||
|
|
||||||
self._Screen.PushPage(self._MyDownloadPage)
|
self._Screen.PushPage(self._MyDownloadPage)
|
||||||
|
|||||||
@ -17,7 +17,7 @@ from util_funcs import midRect
|
|||||||
from fonts import fonts
|
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 SkinManager
|
from skin_manager import MySkinManager
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,8 +30,8 @@ class AboveAllPatch(object):
|
|||||||
_Text =""
|
_Text =""
|
||||||
_FontObj=fonts["veramono20"]
|
_FontObj=fonts["veramono20"]
|
||||||
_Parent =None
|
_Parent =None
|
||||||
_Color = SkinManager().GiveColor('Text')
|
_Color = MySkinManager.GiveColor('Text')
|
||||||
_ValColor = SkinManager().GiveColor('URL')
|
_ValColor = MySkinManager.GiveColor('URL')
|
||||||
_CanvasHWND = None
|
_CanvasHWND = None
|
||||||
_TextSurf = None
|
_TextSurf = None
|
||||||
_Icons = {}
|
_Icons = {}
|
||||||
@ -130,5 +130,5 @@ class SoundPatch(AboveAllPatch):
|
|||||||
#w = 10,h = 40
|
#w = 10,h = 40
|
||||||
vol_rect = pygame.Rect(80+i*20, self._Height/2+20,10, 40)
|
vol_rect = pygame.Rect(80+i*20, self._Height/2+20,10, 40)
|
||||||
|
|
||||||
aa_round_rect(self._CanvasHWND,vol_rect,SkinManager().GiveColor("Front"),3,0,SkinManager().GiveColor("Front"))
|
aa_round_rect(self._CanvasHWND,vol_rect,MySkinManager.GiveColor("Front"),3,0,MySkinManager.GiveColor("Front"))
|
||||||
|
|
||||||
|
|||||||
@ -12,12 +12,12 @@ from label import Label
|
|||||||
from fonts import fonts
|
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 SkinManager
|
from skin_manager import MySkinManager
|
||||||
|
from lang_manager import MyLangManager
|
||||||
|
|
||||||
|
|
||||||
class ListPageSelector(PageSelector):
|
class ListPageSelector(PageSelector):
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._PosX = 0
|
self._PosX = 0
|
||||||
@ -56,11 +56,11 @@ class ConfirmPage(Page):
|
|||||||
_Selector=None
|
_Selector=None
|
||||||
_FootMsg = ["Nav","","","Cancel","Yes"]
|
_FootMsg = ["Nav","","","Cancel","Yes"]
|
||||||
_MyList = []
|
_MyList = []
|
||||||
_ListFont = fonts["veramono20"]
|
_ListFont = MyLangManager.TrFont("veramono20")
|
||||||
_MyStack = None
|
_MyStack = None
|
||||||
_FileName = ""
|
_FileName = ""
|
||||||
_TrashDir = ""
|
_TrashDir = ""
|
||||||
_ConfirmText = "Confirm?"
|
_ConfirmText = MyLangManager.Tr("ConfirmQ")
|
||||||
_BGPosX = 0
|
_BGPosX = 0
|
||||||
_BGPosY = 0
|
_BGPosY = 0
|
||||||
_BGWidth = 0
|
_BGWidth = 0
|
||||||
@ -130,8 +130,8 @@ class ConfirmPage(Page):
|
|||||||
def DrawBG(self):
|
def DrawBG(self):
|
||||||
_rect = pygame.Rect(self._BGPosX,self._BGPosY,self._BGWidth,self._BGHeight)
|
_rect = pygame.Rect(self._BGPosX,self._BGPosY,self._BGWidth,self._BGHeight)
|
||||||
|
|
||||||
pygame.draw.rect(self._CanvasHWND,SkinManager().GiveColor('White'),_rect,0)
|
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),_rect,0)
|
||||||
pygame.draw.rect(self._CanvasHWND,SkinManager().GiveColor('Text'),_rect,1)
|
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),_rect,1)
|
||||||
|
|
||||||
def Draw(self):
|
def Draw(self):
|
||||||
#self.ClearCanvas()
|
#self.ClearCanvas()
|
||||||
|
|||||||
@ -12,12 +12,12 @@ import base64
|
|||||||
from beeprint import pp
|
from beeprint import pp
|
||||||
|
|
||||||
#UI lib
|
#UI lib
|
||||||
from skin_manager import SkinManager
|
from skin_manager import MySkinManager
|
||||||
|
|
||||||
|
|
||||||
Width = 320
|
Width = 320
|
||||||
Height = 240
|
Height = 240
|
||||||
bg_color = SkinManager().GiveColor('White')
|
bg_color = MySkinManager.GiveColor('White')
|
||||||
|
|
||||||
icon_width = 80
|
icon_width = 80
|
||||||
icon_height = 80
|
icon_height = 80
|
||||||
@ -42,5 +42,5 @@ RUNSYS = pygame.USEREVENT+3
|
|||||||
LOWLIGHT = pygame.USEREVENT+4 ## when dim screen backlight
|
LOWLIGHT = pygame.USEREVENT+4 ## when dim screen backlight
|
||||||
FOOTMSG = pygame.USEREVENT+5 ##
|
FOOTMSG = pygame.USEREVENT+5 ##
|
||||||
POWEROPT = pygame.USEREVENT+6
|
POWEROPT = pygame.USEREVENT+6
|
||||||
|
RESTARTUI = pygame.USEREVENT+7 ##restart launcher
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ from constants import Width,Height,RUNSYS
|
|||||||
from label import Label
|
from label import Label
|
||||||
from fonts import fonts
|
from fonts import fonts
|
||||||
from full_screen import FullScreen
|
from full_screen import FullScreen
|
||||||
from skin_manager import SkinManager
|
from skin_manager import MySkinManager
|
||||||
|
|
||||||
import config
|
import config
|
||||||
|
|
||||||
@ -22,8 +22,8 @@ class CounterScreen(FullScreen):
|
|||||||
_BottomLabel = None
|
_BottomLabel = None
|
||||||
_NumberLabel = None
|
_NumberLabel = None
|
||||||
|
|
||||||
_BGColor = SkinManager().GiveColor('Black')
|
_BGColor = MySkinManager.GiveColor('Black')
|
||||||
_FGColor = SkinManager().GiveColor('White')
|
_FGColor = MySkinManager.GiveColor('White')
|
||||||
|
|
||||||
_Counting = False
|
_Counting = False
|
||||||
_Number = 10
|
_Number = 10
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import pygame
|
|||||||
import base64
|
import base64
|
||||||
## local package import
|
## local package import
|
||||||
from full_screen import FullScreen
|
from full_screen import FullScreen
|
||||||
from skin_manager import SkinManager
|
from skin_manager import MySkinManager
|
||||||
from createby_clockworkpi import createby_clockworkpi_b64
|
from createby_clockworkpi import createby_clockworkpi_b64
|
||||||
|
|
||||||
from constants import Width,Height
|
from constants import Width,Height
|
||||||
@ -12,7 +12,7 @@ from constants import Width,Height
|
|||||||
class CreateByScreen(FullScreen):
|
class CreateByScreen(FullScreen):
|
||||||
|
|
||||||
_BG = None
|
_BG = None
|
||||||
_BGColor = SkinManager().GiveColor('Black')
|
_BGColor = MySkinManager.GiveColor('Black')
|
||||||
|
|
||||||
def Init(self):
|
def Init(self):
|
||||||
self._BG = pygame.image.frombuffer(base64.b64decode(createby_clockworkpi_b64 ),(Width,Height),"RGBA")
|
self._BG = pygame.image.frombuffer(base64.b64decode(createby_clockworkpi_b64 ),(Width,Height),"RGBA")
|
||||||
|
|||||||
@ -13,12 +13,13 @@ 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 confirm_page import ConfirmPage
|
from confirm_page import ConfirmPage
|
||||||
|
from lang_manager import MyLangManager
|
||||||
|
|
||||||
class DeleteConfirmPage(ConfirmPage):
|
class DeleteConfirmPage(ConfirmPage):
|
||||||
|
|
||||||
_FileName = ""
|
_FileName = ""
|
||||||
_TrashDir = ""
|
_TrashDir = ""
|
||||||
_ConfirmText = "Confirm delete?"
|
_ConfirmText = MyLangManager.Tr("ConfirmDeleteQ")
|
||||||
|
|
||||||
def SetTrashDir(self,d):
|
def SetTrashDir(self,d):
|
||||||
self._TrashDir = d
|
self._TrashDir = d
|
||||||
@ -48,14 +49,14 @@ class DeleteConfirmPage(ConfirmPage):
|
|||||||
shutil.move(self._FileName, self._TrashDir)
|
shutil.move(self._FileName, self._TrashDir)
|
||||||
except shutil.Error as e:
|
except shutil.Error as e:
|
||||||
if "already exists" in str(e):
|
if "already exists" in str(e):
|
||||||
self._Screen._MsgBox.SetText("Already existed")
|
self._Screen._MsgBox.SetText("AlreadyExisted")
|
||||||
else:
|
else:
|
||||||
self._Screen._MsgBox.SetText("Error")
|
self._Screen._MsgBox.SetText("Error")
|
||||||
|
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
else:
|
else:
|
||||||
self.SnapMsg("Deleting....")
|
self.SnapMsg(MyLangManager.Tr("Deleting"))
|
||||||
self._Screen.Draw()
|
self._Screen.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
self.Reset()
|
self.Reset()
|
||||||
|
|||||||
@ -19,7 +19,8 @@ from UI.keys_def import CurKeys
|
|||||||
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
|
||||||
from UI.download import Download
|
from UI.download import Download
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
from UI.lang_manager import MyLangManager
|
||||||
|
|
||||||
from libs.DBUS import is_wifi_connected_now
|
from libs.DBUS import is_wifi_connected_now
|
||||||
|
|
||||||
@ -39,8 +40,8 @@ class DownloadProcessPage(Page):
|
|||||||
_FileNameLabel = None
|
_FileNameLabel = None
|
||||||
_SizeLabel = None
|
_SizeLabel = None
|
||||||
|
|
||||||
_URLColor = SkinManager().GiveColor('URL')
|
_URLColor = MySkinManager.GiveColor('URL')
|
||||||
_TextColor = SkinManager().GiveColor('Text')
|
_TextColor = MySkinManager.GiveColor('Text')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Page.__init__(self)
|
Page.__init__(self)
|
||||||
@ -130,7 +131,7 @@ class DownloadProcessPage(Page):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self._Screen._MsgBox.SetText("Download failed")
|
self._Screen._MsgBox.SetText("DownloadFailed")
|
||||||
self._Screen._MsgBox.Draw()
|
self._Screen._MsgBox.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
return False
|
return False
|
||||||
@ -206,12 +207,12 @@ class DownloadProcessPage(Page):
|
|||||||
|
|
||||||
|
|
||||||
rect_ = midRect(self._Width/2,self._Height/2+33,170,17, Width,Height)
|
rect_ = midRect(self._Width/2,self._Height/2+33,170,17, Width,Height)
|
||||||
aa_round_rect(self._CanvasHWND,rect_,SkinManager().GiveColor('TitleBg'),5,0,SkinManager().GiveColor('TitleBg'))
|
aa_round_rect(self._CanvasHWND,rect_,MySkinManager.GiveColor('TitleBg'),5,0,MySkinManager.GiveColor('TitleBg'))
|
||||||
|
|
||||||
rect2 = midRect(self._Width/2,self._Height/2+33,int(170*(percent/100.0)),17, Width,Height)
|
rect2 = midRect(self._Width/2,self._Height/2+33,int(170*(percent/100.0)),17, Width,Height)
|
||||||
rect2.left = rect_.left
|
rect2.left = rect_.left
|
||||||
rect2.top = rect_.top
|
rect2.top = rect_.top
|
||||||
aa_round_rect(self._CanvasHWND,rect2,SkinManager().GiveColor('Front'),5,0,SkinManager().GiveColor('Front'))
|
aa_round_rect(self._CanvasHWND,rect2,MySkinManager.GiveColor('Front'),5,0,MySkinManager.GiveColor('Front'))
|
||||||
|
|
||||||
rect3 = midRect(self._Width/2,self._Height/2+53,self._FileNameLabel._Width, self._FileNameLabel._Height,Width,Height)
|
rect3 = midRect(self._Width/2,self._Height/2+53,self._FileNameLabel._Width, self._FileNameLabel._Height,Width,Height)
|
||||||
|
|
||||||
|
|||||||
@ -11,57 +11,57 @@ import config
|
|||||||
if not pygame.font.get_init():
|
if not pygame.font.get_init():
|
||||||
pygame.font.init()
|
pygame.font.init()
|
||||||
|
|
||||||
|
|
||||||
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 = {}
|
fonts = {}
|
||||||
fonts["varela10"] = pygame.font.Font(fonts_path["varela"],10)
|
if not fonts:
|
||||||
fonts["varela11"] = pygame.font.Font(fonts_path["varela"],11)
|
skinpath = "../skin/"+config.SKIN+"/truetype"
|
||||||
fonts["varela12"] = pygame.font.Font(fonts_path["varela"],12)
|
fonts_path = {}
|
||||||
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_path["varela"] = "%s/VarelaRound-Regular.ttf" % skinpath
|
||||||
fonts["varela18"] = pygame.font.Font(fonts_path["varela"],18)
|
fonts_path["veramono"] = "%s/VeraMono.ttf" % skinpath
|
||||||
fonts["varela20"] = pygame.font.Font(fonts_path["varela"],20)
|
fonts_path["noto"] = "%s/NotoSansMono-Regular.ttf" % skinpath
|
||||||
fonts["varela22"] = pygame.font.Font(fonts_path["varela"],22)
|
fonts_path["notocjk"] = "%s/NotoSansCJK-Regular.ttf" % skinpath
|
||||||
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["varela10"] = pygame.font.Font(fonts_path["varela"],10)
|
||||||
fonts["veramono24"] = pygame.font.Font(fonts_path["veramono"],24)
|
fonts["varela11"] = pygame.font.Font(fonts_path["varela"],11)
|
||||||
fonts["veramono23"] = pygame.font.Font(fonts_path["veramono"],23)
|
fonts["varela12"] = pygame.font.Font(fonts_path["varela"],12)
|
||||||
fonts["veramono22"] = pygame.font.Font(fonts_path["veramono"],22)
|
fonts["varela13"] = pygame.font.Font(fonts_path["varela"],13)
|
||||||
fonts["veramono21"] = pygame.font.Font(fonts_path["veramono"],21)
|
fonts["varela14"] = pygame.font.Font(fonts_path["varela"],14)
|
||||||
fonts["veramono20"] = pygame.font.Font(fonts_path["veramono"],20)
|
fonts["varela15"] = pygame.font.Font(fonts_path["varela"],15)
|
||||||
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,18):
|
fonts["varela16"] = pygame.font.Font(fonts_path["varela"],16)
|
||||||
fonts["notosansmono"+str(i)] = pygame.font.Font(fonts_path["noto"],i)
|
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)
|
||||||
|
|
||||||
for i in range(10,18):
|
fonts["veramono25"] = pygame.font.Font(fonts_path["veramono"],25)
|
||||||
fonts["notosanscjk"+str(i)] = pygame.font.Font(fonts_path["notocjk"],i)
|
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)
|
fonts["arial"] = pygame.font.SysFont("arial",16)
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ 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
|
||||||
|
|
||||||
icon_base_path = SkinMap("gameshell/footbar_icons/")
|
icon_base_path = SkinMap("gameshell/footbar_icons/")
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ class FootBar:
|
|||||||
_Icons = {}
|
_Icons = {}
|
||||||
_IconWidth = 18
|
_IconWidth = 18
|
||||||
_IconHeight = 18
|
_IconHeight = 18
|
||||||
_LabelFont = fonts["veramono10"]
|
_LabelFont = MyLangManager.TrFont("veramono10")
|
||||||
_State = "normal"
|
_State = "normal"
|
||||||
|
|
||||||
_SkinManager = None
|
_SkinManager = None
|
||||||
@ -100,13 +101,14 @@ class FootBar:
|
|||||||
self._Icons["round_corners"] = round_corners
|
self._Icons["round_corners"] = round_corners
|
||||||
|
|
||||||
def ResetNavText(self):
|
def ResetNavText(self):
|
||||||
self._Icons["nav"]._Label.SetText("Nav.")
|
self._Icons["nav"]._Label.SetText(MyLangManager.Tr("Nav"))
|
||||||
self._State = "normal"
|
self._State = "normal"
|
||||||
self.Draw()
|
self.Draw()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def UpdateNavText(self,texts):
|
def UpdateNavText(self,texts):
|
||||||
self._State = "tips"
|
self._State = "tips"
|
||||||
|
texts = MyLangManager.Tr(texts)
|
||||||
my_text = self._LabelFont.render(texts,True,self._SkinManager.GiveColor("Text"))
|
my_text = self._LabelFont.render(texts,True,self._SkinManager.GiveColor("Text"))
|
||||||
"""
|
"""
|
||||||
_w = 0
|
_w = 0
|
||||||
@ -151,7 +153,7 @@ class FootBar:
|
|||||||
|
|
||||||
for idx,x in enumerate(barr):
|
for idx,x in enumerate(barr):
|
||||||
try:
|
try:
|
||||||
self._Icons[x]._Label.SetText(texts[idx])
|
self._Icons[x]._Label.SetText(MyLangManager.Tr(texts[idx]))
|
||||||
except IndexError:
|
except IndexError:
|
||||||
print("Index "+x+" doesn't exist!")
|
print("Index "+x+" doesn't exist!")
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import pygame
|
|||||||
from constants import icon_width,icon_height,ICON_TYPES,ALIGN,icon_ext,Width,Height
|
from constants import icon_width,icon_height,ICON_TYPES,ALIGN,icon_ext,Width,Height
|
||||||
from util_funcs import color_surface,midRect
|
from util_funcs import color_surface,midRect
|
||||||
from label import Label
|
from label import Label
|
||||||
|
from lang_manager import MyLangManager
|
||||||
|
|
||||||
class IconItem:
|
class IconItem:
|
||||||
_PosX=0
|
_PosX=0
|
||||||
@ -65,7 +66,7 @@ class IconItem:
|
|||||||
self._LinkPage._Screen = self._Parent._Screen
|
self._LinkPage._Screen = self._Parent._Screen
|
||||||
self._LinkPage._CanvasHWND = self._Parent._Screen._CanvasHWND
|
self._LinkPage._CanvasHWND = self._Parent._Screen._CanvasHWND
|
||||||
|
|
||||||
self._LinkPage._FootMsg = ["Nav.","","","Back","Enter"] ## Default Page Foot info
|
self._LinkPage._FootMsg = ["Nav","","","Back","Enter"] ## Default Page Foot info
|
||||||
|
|
||||||
if self._LinkPage._Align == ALIGN["HLeft"]:
|
if self._LinkPage._Align == ALIGN["HLeft"]:
|
||||||
self._LinkPage.AdjustHLeftAlign()
|
self._LinkPage.AdjustHLeftAlign()
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import pygame
|
import pygame
|
||||||
from label import Label
|
from label import Label
|
||||||
from skin_manager import SkinManager
|
from skin_manager import MySkinManager
|
||||||
|
|
||||||
class InfoPageListItem(object):
|
class InfoPageListItem(object):
|
||||||
_PosX = 0
|
_PosX = 0
|
||||||
@ -43,9 +43,9 @@ class InfoPageListItem(object):
|
|||||||
|
|
||||||
def Draw(self):
|
def Draw(self):
|
||||||
if self._ReadOnly == True:
|
if self._ReadOnly == True:
|
||||||
self._Labels["Text"].SetColor(SkinManager().GiveColor("ReadOnlyText"))
|
self._Labels["Text"].SetColor(MySkinManager.GiveColor("ReadOnlyText"))
|
||||||
else:
|
else:
|
||||||
self._Labels["Text"].SetColor(SkinManager().GiveColor("Text"))
|
self._Labels["Text"].SetColor(MySkinManager.GiveColor("Text"))
|
||||||
|
|
||||||
|
|
||||||
self._Labels["Text"]._PosX = self._Labels["Text"]._PosX + self._PosX
|
self._Labels["Text"]._PosX = self._Labels["Text"]._PosX + self._PosX
|
||||||
@ -59,4 +59,4 @@ class InfoPageListItem(object):
|
|||||||
self._Labels["Small"]._PosY = self._PosY + (self._Height - self._Labels["Small"]._Height)/2
|
self._Labels["Small"]._PosY = self._PosY + (self._Height - self._Labels["Small"]._Height)/2
|
||||||
self._Labels["Small"].Draw()
|
self._Labels["Small"].Draw()
|
||||||
|
|
||||||
pygame.draw.line(self._Parent._CanvasHWND,SkinManager().GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
|
||||||
|
|||||||
@ -5,10 +5,10 @@ from libs.roundrects import aa_round_rect
|
|||||||
## local UI import
|
## local UI import
|
||||||
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.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
class InfoPageSelector(PageSelector):
|
class InfoPageSelector(PageSelector):
|
||||||
_BackgroundColor = SkinManager().GiveColor('Front')
|
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._PosX = 0
|
self._PosX = 0
|
||||||
|
|||||||
@ -13,7 +13,7 @@ from UI.util_funcs import midRect
|
|||||||
from UI.keys_def import CurKeys
|
from UI.keys_def import CurKeys
|
||||||
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 SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
from libs.roundrects import aa_round_rect
|
from libs.roundrects import aa_round_rect
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ class KeyboardIcon(IconItem):
|
|||||||
_PosY = 0
|
_PosY = 0
|
||||||
_Width = 0
|
_Width = 0
|
||||||
_Height = 0
|
_Height = 0
|
||||||
_Color = SkinManager().GiveColor('Text')
|
_Color = MySkinManager.GiveColor('Text')
|
||||||
_MyType = ICON_TYPES["NAV"]
|
_MyType = ICON_TYPES["NAV"]
|
||||||
_Parent = None
|
_Parent = None
|
||||||
_Str = ""
|
_Str = ""
|
||||||
|
|||||||
@ -8,7 +8,8 @@ from constants import Width,Height
|
|||||||
from util_funcs import midRect
|
from util_funcs import midRect
|
||||||
|
|
||||||
#UI lib
|
#UI lib
|
||||||
from skin_manager import SkinManager
|
from skin_manager import MySkinManager
|
||||||
|
from lang_manager import MyLangManager
|
||||||
|
|
||||||
class Label:
|
class Label:
|
||||||
_PosX=0
|
_PosX=0
|
||||||
@ -17,13 +18,13 @@ class Label:
|
|||||||
_Height=0
|
_Height=0
|
||||||
_Text=""
|
_Text=""
|
||||||
_FontObj=None
|
_FontObj=None
|
||||||
_Color = SkinManager().GiveColor('Text')
|
_Color = MySkinManager.GiveColor('Text')
|
||||||
_CanvasHWND = None
|
_CanvasHWND = None
|
||||||
_TextSurf = None
|
_TextSurf = None
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def Init(self, text, font_obj, color=SkinManager().GiveColor('Text')):
|
def Init(self, text, font_obj, color=MySkinManager.GiveColor('Text')):
|
||||||
self._Color = color
|
self._Color = color
|
||||||
self._FontObj = font_obj
|
self._FontObj = font_obj
|
||||||
self._Text = text
|
self._Text = text
|
||||||
|
|||||||
101
sys.py/UI/lang_manager.py
Normal file
101
sys.py/UI/lang_manager.py
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import os
|
||||||
|
import pygame
|
||||||
|
import config
|
||||||
|
import ConfigParser
|
||||||
|
from util_funcs import FileExists
|
||||||
|
from fonts import fonts
|
||||||
|
|
||||||
|
class CaseConfigParser(ConfigParser.SafeConfigParser):
|
||||||
|
def optionxform(self, optionstr):
|
||||||
|
return optionstr
|
||||||
|
|
||||||
|
class LangManager(object):
|
||||||
|
"""
|
||||||
|
"""
|
||||||
|
|
||||||
|
_Langs = {}
|
||||||
|
_Config = None
|
||||||
|
_ConfigFileName = "00_English.ini" ## double % to escape
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.Init()
|
||||||
|
|
||||||
|
def Init(self):
|
||||||
|
if not self._Langs:
|
||||||
|
self.SetLangs()
|
||||||
|
|
||||||
|
def UpdateLang(self):
|
||||||
|
self._Langs = {}
|
||||||
|
self.SetLangs()
|
||||||
|
|
||||||
|
def SetLangs(self):
|
||||||
|
self._Config = CaseConfigParser()
|
||||||
|
#print("SetLangs")
|
||||||
|
fname = ".lang"
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(fname, "r") as f:
|
||||||
|
self._ConfigFileName = f.read()
|
||||||
|
self._ConfigFileName = self._ConfigFileName.strip("\r\n ")
|
||||||
|
#print(self._ConfigFileName)
|
||||||
|
except:
|
||||||
|
os.system("touch .lang")
|
||||||
|
print("read lang failed")
|
||||||
|
None
|
||||||
|
|
||||||
|
|
||||||
|
if self._ConfigFileName == "" or FileExists("langs/"+self._ConfigFileName) == False:
|
||||||
|
#print("miss file")
|
||||||
|
self._ConfigFileName = "00_English.ini"
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
#print("has file",self._ConfigFileName)
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
self._Config.read("langs/"+self._ConfigFileName)
|
||||||
|
except Exception, e:
|
||||||
|
print("read lang ini error %s" % str(e))
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
if "Langs" in self._Config.sections():
|
||||||
|
lang_opts = self._Config.options("Langs")
|
||||||
|
for i in lang_opts:
|
||||||
|
try:
|
||||||
|
self._Langs[i] = self._Config.get("Langs", i)
|
||||||
|
except Exception, e:
|
||||||
|
print("error %s" % str(e))
|
||||||
|
continue
|
||||||
|
|
||||||
|
def Tr(self,english_key_str):
|
||||||
|
#print("english_key_str", english_key_str)
|
||||||
|
if english_key_str in self._Langs:
|
||||||
|
#print( self._Langs[english_key_str] )
|
||||||
|
return self._Langs[english_key_str].decode("utf8")
|
||||||
|
else:
|
||||||
|
return english_key_str
|
||||||
|
|
||||||
|
def TrFont(self,orig_font_str):
|
||||||
|
font_size_number = int(filter(str.isdigit, orig_font_str))
|
||||||
|
if font_size_number > 120:
|
||||||
|
raise Exception('font string format error')
|
||||||
|
|
||||||
|
if "English.ini" in self._ConfigFileName:
|
||||||
|
return fonts[orig_font_str]
|
||||||
|
else:
|
||||||
|
if font_size_number > 28:
|
||||||
|
raise Exception('cjk font string format error '+ str(font_size_number))
|
||||||
|
|
||||||
|
return fonts["notosanscjk"+str(font_size_number)]
|
||||||
|
|
||||||
|
##global MyLangManager Handler
|
||||||
|
MyLangManager = None
|
||||||
|
|
||||||
|
def InitMyLangManager():
|
||||||
|
global MyLangManager
|
||||||
|
if MyLangManager == None:
|
||||||
|
MyLangManager = LangManager()
|
||||||
|
|
||||||
|
|
||||||
|
InitMyLangManager()
|
||||||
@ -21,13 +21,14 @@ 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,SkinMap
|
||||||
from fonts import fonts
|
|
||||||
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
|
||||||
from Emulator import MyEmulator
|
from Emulator import MyEmulator
|
||||||
|
|
||||||
from skin_manager import SkinManager
|
from skin_manager import MySkinManager
|
||||||
|
from lang_manager import MyLangManager
|
||||||
|
|
||||||
from counter_screen import CounterScreen
|
from counter_screen import CounterScreen
|
||||||
|
|
||||||
class MessageBox(Label):
|
class MessageBox(Label):
|
||||||
@ -36,7 +37,7 @@ class MessageBox(Label):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def Init(self,text,font_obj,color=SkinManager().GiveColor('Text')):
|
def Init(self,text,font_obj,color=MySkinManager.GiveColor('Text')):
|
||||||
self._Color = color
|
self._Color = color
|
||||||
self._FontObj = font_obj
|
self._FontObj = font_obj
|
||||||
self._Text = text
|
self._Text = text
|
||||||
@ -47,12 +48,12 @@ class MessageBox(Label):
|
|||||||
self._HWND = self._Parent._CanvasHWND
|
self._HWND = self._Parent._CanvasHWND
|
||||||
|
|
||||||
def SetText(self,text):
|
def SetText(self,text):
|
||||||
self._Text = text
|
self._Text = MyLangManager.Tr(text)
|
||||||
|
|
||||||
def PreDraw(self):
|
def PreDraw(self):
|
||||||
self._Width = 0
|
self._Width = 0
|
||||||
self._Height = 0
|
self._Height = 0
|
||||||
self._CanvasHWND.fill(SkinManager().GiveColor('White'))
|
self._CanvasHWND.fill(MySkinManager.GiveColor('White'))
|
||||||
|
|
||||||
words = self._Text.split(' ')
|
words = self._Text.split(' ')
|
||||||
space = self._FontObj.size(' ')[0]
|
space = self._FontObj.size(' ')[0]
|
||||||
@ -99,7 +100,7 @@ class MessageBox(Label):
|
|||||||
|
|
||||||
padding = 5
|
padding = 5
|
||||||
|
|
||||||
pygame.draw.rect(self._HWND,SkinManager().GiveColor('White'),(x_-padding,y_-padding, self._Width+padding*2,self._Height+padding*2))
|
pygame.draw.rect(self._HWND,MySkinManager.GiveColor('White'),(x_-padding,y_-padding, self._Width+padding*2,self._Height+padding*2))
|
||||||
|
|
||||||
if self._HWND != None:
|
if self._HWND != None:
|
||||||
rect = pygame.Rect(x_,y_,self._Width,self._Height)
|
rect = pygame.Rect(x_,y_,self._Width,self._Height)
|
||||||
@ -107,7 +108,7 @@ class MessageBox(Label):
|
|||||||
#self._HWND.blit(self._CanvasHWND,rect)
|
#self._HWND.blit(self._CanvasHWND,rect)
|
||||||
|
|
||||||
if withborder == True:
|
if withborder == True:
|
||||||
pygame.draw.rect(self._HWND,SkinManager().GiveColor('Black'),(x_-padding,y_-padding, self._Width+padding*2,self._Height+padding*2),1)
|
pygame.draw.rect(self._HWND,MySkinManager.GiveColor('Black'),(x_-padding,y_-padding, self._Width+padding*2,self._Height+padding*2),1)
|
||||||
|
|
||||||
def Draw(self):
|
def Draw(self):
|
||||||
x = (self._Parent._Width)/2
|
x = (self._Parent._Width)/2
|
||||||
@ -135,8 +136,8 @@ class MainScreen(object):
|
|||||||
_TitleBar = None
|
_TitleBar = None
|
||||||
_FootBar = None
|
_FootBar = None
|
||||||
_MsgBox = None
|
_MsgBox = None
|
||||||
_MsgBoxFont = fonts["veramono20"]
|
_MsgBoxFont = MyLangManager.TrFont("veramono20")
|
||||||
_IconFont = fonts["varela15"]
|
_IconFont = MyLangManager.TrFont("varela15")
|
||||||
_SkinManager = None
|
_SkinManager = None
|
||||||
|
|
||||||
_Closed = False
|
_Closed = False
|
||||||
@ -152,9 +153,8 @@ class MainScreen(object):
|
|||||||
self._MsgBox._Parent= self
|
self._MsgBox._Parent= self
|
||||||
self._MsgBox.Init(" ", self._MsgBoxFont)
|
self._MsgBox.Init(" ", self._MsgBoxFont)
|
||||||
|
|
||||||
self._SkinManager = SkinManager()
|
self._SkinManager = MySkinManager
|
||||||
self._SkinManager.Init()
|
|
||||||
|
|
||||||
self._CounterScreen = CounterScreen()
|
self._CounterScreen = CounterScreen()
|
||||||
self._CounterScreen._HWND = self._HWND
|
self._CounterScreen._HWND = self._HWND
|
||||||
|
|
||||||
@ -349,7 +349,7 @@ class MainScreen(object):
|
|||||||
self._Pages.append(Page)
|
self._Pages.append(Page)
|
||||||
|
|
||||||
def ClearCanvas(self):
|
def ClearCanvas(self):
|
||||||
self._CanvasHWND.fill(SkinManager().GiveColor('White'))
|
self._CanvasHWND.fill(self._SkinManager.GiveColor('White'))
|
||||||
|
|
||||||
def SwapAndShow(self):
|
def SwapAndShow(self):
|
||||||
if self._Closed == True:
|
if self._Closed == True:
|
||||||
@ -432,7 +432,7 @@ class MainScreen(object):
|
|||||||
iconitem = IconItem()
|
iconitem = IconItem()
|
||||||
iconitem._FileName = i
|
iconitem._FileName = i
|
||||||
iconitem._CmdPath = ""
|
iconitem._CmdPath = ""
|
||||||
iconitem.AddLabel(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( SkinMap(_dir+"/"+i2+".png") ):
|
||||||
@ -540,7 +540,7 @@ class MainScreen(object):
|
|||||||
|
|
||||||
iconitem._ImageName = ""
|
iconitem._ImageName = ""
|
||||||
|
|
||||||
iconitem.AddLabel(i2.split(".")[0],self._IconFont)
|
iconitem.AddLabel(MyLangManager.Tr(i2.split(".")[0]),self._IconFont)
|
||||||
iconitem._LinkPage = None
|
iconitem._LinkPage = None
|
||||||
cur_page._Icons.append(iconitem)
|
cur_page._Icons.append(iconitem)
|
||||||
|
|
||||||
@ -588,7 +588,7 @@ class MainScreen(object):
|
|||||||
|
|
||||||
|
|
||||||
def DrawRun(self):
|
def DrawRun(self):
|
||||||
self._MsgBox.SetText("Launching....")
|
self._MsgBox.SetText(MyLangManager.Tr("Launching"))
|
||||||
self._MsgBox.Draw()
|
self._MsgBox.Draw()
|
||||||
|
|
||||||
def Draw(self):
|
def Draw(self):
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import pygame
|
import pygame
|
||||||
|
|
||||||
from skin_manager import SkinManager
|
from skin_manager import MySkinManager
|
||||||
|
|
||||||
|
|
||||||
class MultiLabel: ##Multi Line Label
|
class MultiLabel: ##Multi Line Label
|
||||||
@ -12,7 +12,7 @@ class MultiLabel: ##Multi Line Label
|
|||||||
_Height=100
|
_Height=100
|
||||||
_Text=""
|
_Text=""
|
||||||
_FontObj=None
|
_FontObj=None
|
||||||
_Color = SkinManager().GiveColor('Text')
|
_Color = MySkinManager.GiveColor('Text')
|
||||||
_CanvasHWND = None
|
_CanvasHWND = None
|
||||||
_TextSurf = None
|
_TextSurf = None
|
||||||
_MaxWidth = 0
|
_MaxWidth = 0
|
||||||
@ -20,7 +20,7 @@ class MultiLabel: ##Multi Line Label
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def Init(self,text,font_obj,color=SkinManager().GiveColor('Text')):
|
def Init(self,text,font_obj,color=MySkinManager.GiveColor('Text')):
|
||||||
self._Color = color
|
self._Color = color
|
||||||
self._FontObj = font_obj
|
self._FontObj = font_obj
|
||||||
self._Text = text
|
self._Text = text
|
||||||
|
|||||||
@ -17,6 +17,7 @@ from constants import ALIGN,icon_width,icon_height,Width,Height,ICON_TYPES
|
|||||||
from util_funcs import midRect
|
from util_funcs import midRect
|
||||||
from keys_def import CurKeys
|
from keys_def import CurKeys
|
||||||
from icon_pool import MyIconPool
|
from icon_pool import MyIconPool
|
||||||
|
from lang_manager import MyLangManager
|
||||||
|
|
||||||
class PageStack:
|
class PageStack:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -99,7 +100,7 @@ class Page(object):
|
|||||||
_Name = ""
|
_Name = ""
|
||||||
_Screen = None ## Should be the Screen Class
|
_Screen = None ## Should be the Screen Class
|
||||||
_PageIconMargin = 20
|
_PageIconMargin = 20
|
||||||
_FootMsg = ["Nav.","","","","Enter"] ## Default Page Foot info
|
_FootMsg = ["Nav","","","","Enter"] ## Default Page Foot info
|
||||||
|
|
||||||
_SelectedIconTopOffset=20
|
_SelectedIconTopOffset=20
|
||||||
_EasingDur = 30
|
_EasingDur = 30
|
||||||
|
|||||||
@ -5,7 +5,7 @@ from util_funcs import midRect
|
|||||||
|
|
||||||
from libs.roundrects import aa_round_rect
|
from libs.roundrects import aa_round_rect
|
||||||
|
|
||||||
from skin_manager import SkinManager
|
from skin_manager import MySkinManager
|
||||||
|
|
||||||
class ListScroller(object):
|
class ListScroller(object):
|
||||||
_PosX = 0
|
_PosX = 0
|
||||||
@ -14,7 +14,7 @@ class ListScroller(object):
|
|||||||
_Height = 0
|
_Height = 0
|
||||||
_MinHeight = 6 ## tested
|
_MinHeight = 6 ## tested
|
||||||
_Parent = None
|
_Parent = None
|
||||||
_Color = SkinManager().GiveColor('Front')
|
_Color = MySkinManager.GiveColor('Front')
|
||||||
|
|
||||||
_StartX = 0
|
_StartX = 0
|
||||||
_StartY = 0
|
_StartY = 0
|
||||||
|
|||||||
@ -78,3 +78,16 @@ class SkinManager(object):
|
|||||||
else:
|
else:
|
||||||
return pygame.Color(255,0,0)
|
return pygame.Color(255,0,0)
|
||||||
|
|
||||||
|
|
||||||
|
##global MySkinManager Handler
|
||||||
|
MySkinManager = None
|
||||||
|
|
||||||
|
def InitMySkinManager():
|
||||||
|
global MySkinManager
|
||||||
|
if MySkinManager == None:
|
||||||
|
MySkinManager = SkinManager()
|
||||||
|
|
||||||
|
|
||||||
|
InitMySkinManager()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
from UI.constants import Width,Height,ICON_TYPES
|
from UI.constants import Width,Height,ICON_TYPES
|
||||||
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 SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
class TextItem(IconItem):
|
class TextItem(IconItem):
|
||||||
_PosX = 0
|
_PosX = 0
|
||||||
@ -11,7 +11,7 @@ class TextItem(IconItem):
|
|||||||
_Width = 0
|
_Width = 0
|
||||||
_Height = 0
|
_Height = 0
|
||||||
_Str = ""
|
_Str = ""
|
||||||
_Color = SkinManager().GiveColor('Text')
|
_Color = MySkinManager.GiveColor('Text')
|
||||||
_FontObj = None
|
_FontObj = None
|
||||||
_Bold = False
|
_Bold = False
|
||||||
_MyType = ICON_TYPES["LETTER"]
|
_MyType = ICON_TYPES["LETTER"]
|
||||||
|
|||||||
@ -10,14 +10,14 @@ from libs.roundrects import aa_round_rect
|
|||||||
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.fonts import fonts
|
||||||
from UI.skin_manager import SkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
|
|
||||||
class Textarea:
|
class Textarea:
|
||||||
_PosX =0
|
_PosX =0
|
||||||
_PosY = 0
|
_PosY = 0
|
||||||
_Width = 0
|
_Width = 0
|
||||||
_Height = 0
|
_Height = 0
|
||||||
_BackgroundColor = SkinManager().GiveColor('TitleBg')
|
_BackgroundColor = MySkinManager.GiveColor('TitleBg')
|
||||||
_CanvasHWND = None
|
_CanvasHWND = None
|
||||||
_MyWords = []
|
_MyWords = []
|
||||||
_BlitWords = []
|
_BlitWords = []
|
||||||
@ -80,7 +80,7 @@ class Textarea:
|
|||||||
x = self._PosX+xmargin
|
x = self._PosX+xmargin
|
||||||
linenumber = 0
|
linenumber = 0
|
||||||
cursor_row = 0
|
cursor_row = 0
|
||||||
|
|
||||||
for i, v in enumerate(self._MyWords):
|
for i, v in enumerate(self._MyWords):
|
||||||
t = self._FontObj.render(v, True, (8, 135, 174))
|
t = self._FontObj.render(v, True, (8, 135, 174))
|
||||||
t_width = t.get_width()
|
t_width = t.get_width()
|
||||||
|
|||||||
@ -17,7 +17,7 @@ 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 util_funcs import midRect,SwapAndShow,SkinMap
|
from util_funcs import midRect,SwapAndShow,SkinMap
|
||||||
|
|
||||||
from config import Battery
|
from config import Battery
|
||||||
@ -183,7 +183,7 @@ class TitleBar:
|
|||||||
def CheckBluetooth(self):
|
def CheckBluetooth(self):
|
||||||
out = commands.getstatusoutput("hcitool dev | grep hci0 |cut -f3")
|
out = commands.getstatusoutput("hcitool dev | grep hci0 |cut -f3")
|
||||||
if len(out[1]) < 17:
|
if len(out[1]) < 17:
|
||||||
print("no bluetooth", out)
|
print("CheckBluetooth:no bluetooth", out)
|
||||||
self._Icons["bluetooth"]._IconIndex = 2
|
self._Icons["bluetooth"]._IconIndex = 2
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
@ -297,17 +297,17 @@ class TitleBar:
|
|||||||
|
|
||||||
def Draw(self,title):
|
def Draw(self,title):
|
||||||
self.ClearCanvas()
|
self.ClearCanvas()
|
||||||
|
title = MyLangManager.Tr(title)
|
||||||
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_size = fonts["varela12"].size(cur_time)
|
||||||
title_text_size = fonts["varela16"].size(title)
|
title_text_size = MyLangManager.TrFont("varela16").size(title)
|
||||||
|
|
||||||
self._CanvasHWND.blit(fonts["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( fonts["varela12"].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))
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ from beeprint import pp
|
|||||||
from util_funcs import midRect, SkinMap
|
from util_funcs import midRect, SkinMap
|
||||||
from fonts import fonts
|
from fonts import fonts
|
||||||
|
|
||||||
from skin_manager import SkinManager
|
from skin_manager import MySkinManager
|
||||||
|
|
||||||
BlankPng = SkinMap("gameshell/blank.png") # 80x80
|
BlankPng = SkinMap("gameshell/blank.png") # 80x80
|
||||||
## use blank circle as bg, Two alpha As Icon Label
|
## use blank circle as bg, Two alpha As Icon Label
|
||||||
@ -32,7 +32,7 @@ class UntitledIcon(object):
|
|||||||
|
|
||||||
_BG = None # initial surface
|
_BG = None # initial surface
|
||||||
|
|
||||||
_Color = SkinManager().GiveColor('Text')
|
_Color = MySkinManager.GiveColor('Text')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._Words = ["G", "s"]
|
self._Words = ["G", "s"]
|
||||||
|
|||||||
104
sys.py/langs/00_English.ini
Normal file
104
sys.py/langs/00_English.ini
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
[Langs]
|
||||||
|
Settings=Settings
|
||||||
|
Retro Games=Retro Games
|
||||||
|
Music Player=Music Player
|
||||||
|
TinyCloud=TinyCloud
|
||||||
|
PowerOFF=PowerOFF
|
||||||
|
Reload UI=Reload UI
|
||||||
|
freeDM=freeDM
|
||||||
|
CaveStory=CaveStory
|
||||||
|
RetroArch=RetroArch
|
||||||
|
Launching=Launching....
|
||||||
|
Nav=Nav
|
||||||
|
Scan=Scan
|
||||||
|
Back=Back
|
||||||
|
Enter=Enter
|
||||||
|
Remove=Remove
|
||||||
|
Run=Run
|
||||||
|
AddToPlayList=Add to Playlist
|
||||||
|
Add to Playlist=Add to Playlist
|
||||||
|
DownloadConfirm=Download Confirm
|
||||||
|
MyFavGames=my favourites games
|
||||||
|
Deleting=Deleting...
|
||||||
|
AddFav=Add Fav
|
||||||
|
ADdFavList=Add to favourite list
|
||||||
|
Del=Del
|
||||||
|
Please upload data over Wi-Fi=Please upload data over Wi-Fi
|
||||||
|
ConfirmDeleteQ=Confirm Delete ?
|
||||||
|
AlreadyExisted=Already existed
|
||||||
|
Cancel=Cancel
|
||||||
|
Yes=Yes
|
||||||
|
ConfirmQ=Confirm?
|
||||||
|
Disconnecting=Disconnecting...
|
||||||
|
ConfirmUpdateToFQ=Confirm Update to %%s ?
|
||||||
|
UpdateToFQ=Update to %%s ?
|
||||||
|
SetupGameEngineAutoQ=Do you want to setup this game engine automatically?
|
||||||
|
Downloading=Downloading...
|
||||||
|
BATOver5Pct=Battery must over 5%%
|
||||||
|
DeleteConfirm=Delete Confirm
|
||||||
|
FavouriteGames=Favourite Games
|
||||||
|
ConfirmForgetQ=Confirm Forget?
|
||||||
|
ConfirmForget=Confirm Forget
|
||||||
|
Disconnect=Disconnect
|
||||||
|
ConfirmDisconnectQ=Confirm Disconnect ?
|
||||||
|
Confirm Disconnect=Confirm Disconnect
|
||||||
|
Forget=Forget
|
||||||
|
Forgeting=Forgeting...
|
||||||
|
Info=Info
|
||||||
|
TryConnect=TryConnect
|
||||||
|
Bluetooth Info=Bluetooth info
|
||||||
|
Connecting=Connecting
|
||||||
|
BluetoothScanning=Bluetooth scanning...
|
||||||
|
Scanning=Scanning..
|
||||||
|
ShutDownConnecting=ShutDownConnecting...
|
||||||
|
Select=Select
|
||||||
|
Detail=Detail
|
||||||
|
Applying=Applying...
|
||||||
|
DownloadFailed=Download failed
|
||||||
|
LauncherIsUpToDate=Launcher is up to date
|
||||||
|
CheckWifiConnection=Please Check your Wi-Fi connection
|
||||||
|
TurningOn=Turning On
|
||||||
|
TurningOff=Turning Off
|
||||||
|
Invalid=Invalid
|
||||||
|
CheckingUpdate=Checking update...
|
||||||
|
CheckingUpdateFailed=Checking update failed
|
||||||
|
Update=Update
|
||||||
|
Toggle=Toggle
|
||||||
|
Rescue=Rescue
|
||||||
|
Airplane Mode=Airplane Mode
|
||||||
|
minutes=minutes
|
||||||
|
seconds=seconds
|
||||||
|
second=second
|
||||||
|
minute=minute
|
||||||
|
Never=Never
|
||||||
|
Power Options=Power Options
|
||||||
|
Languages=Languages
|
||||||
|
Notify=Notify
|
||||||
|
Setting List=Setting List
|
||||||
|
Wi-Fi=Wi-Fi
|
||||||
|
Bluetooth=Bluetooth
|
||||||
|
Sound Volume=Sound Volume
|
||||||
|
Sound Volume=Sound volume
|
||||||
|
Brightness=Brightness
|
||||||
|
BackLight Brightness=BackLight Brightness
|
||||||
|
Storage=Storage
|
||||||
|
Timezone=Timezone
|
||||||
|
Timezone Selection=Timezone Selection
|
||||||
|
Notification=Notification
|
||||||
|
About=About
|
||||||
|
Power off=Power off
|
||||||
|
Buttons Layout=Buttons Layout
|
||||||
|
UpdateRetroArch=UpdateRetroArch
|
||||||
|
Wifi scanning=Wifi scanning...
|
||||||
|
Power option detail=Power option detail
|
||||||
|
Screen dimming=Screen dimming
|
||||||
|
Screen OFF=Screen OFF
|
||||||
|
Power OFF=Power OFF
|
||||||
|
Power saving=Power saving
|
||||||
|
Balanced=Balanced
|
||||||
|
Server=Server
|
||||||
|
Performance=Performance
|
||||||
|
Confirm Power OFF?=Confirm Power OFF?
|
||||||
|
Reboot=Reboot
|
||||||
|
Shutdown=Shutdown
|
||||||
|
my favourites=my favourites
|
||||||
107
sys.py/langs/01_日本語.ini
Normal file
107
sys.py/langs/01_日本語.ini
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
[Langs]
|
||||||
|
Settings=設定
|
||||||
|
Retro Games=レトロ ゲーム
|
||||||
|
Music Player=音楽プレーヤー
|
||||||
|
TinyCloud=彩雲
|
||||||
|
PowerOFF=電源を切る
|
||||||
|
Reload UI=リロードUI
|
||||||
|
freeDM=freeDM
|
||||||
|
CaveStory=洞窟物語
|
||||||
|
RetroArch=RetroArch
|
||||||
|
Launching=打ち上げ
|
||||||
|
Nav=ナビ
|
||||||
|
Scan=スキャン
|
||||||
|
Back=後ろ
|
||||||
|
Enter=入る
|
||||||
|
Remove=削除
|
||||||
|
Run=起動
|
||||||
|
AddToPlayList=再生リストに追加
|
||||||
|
Add to Playlist=再生リストに追加
|
||||||
|
DownloadConfirm=ダウンロード確認
|
||||||
|
MyFavGames=私の好きなゲーム
|
||||||
|
Deleting=削除
|
||||||
|
AddFav=好みを加える
|
||||||
|
ADdFavList=好みのリストに追加
|
||||||
|
Del=削
|
||||||
|
Please upload data over Wi-Fi=Wifiを通じてデータをアップロードする
|
||||||
|
ConfirmDeleteQ=削除の確認?
|
||||||
|
AlreadyExisted=存在している
|
||||||
|
Cancel=取り消す
|
||||||
|
Yes=は
|
||||||
|
ConfirmQ=確認?
|
||||||
|
Disconnecting=接続を切る
|
||||||
|
ConfirmUpdateToFQ=にアップグレードする%%s?
|
||||||
|
UpdateToFQ=にアップする%%s ?
|
||||||
|
SetupGameEngineAutoQ=ゲームエンジンを自動化しますか?
|
||||||
|
Downloading=ダウンロード中
|
||||||
|
BATOver5Pct=電気の量は少なくとも5%%
|
||||||
|
DeleteConfirm=削除の確認
|
||||||
|
FavouriteGames=好きなゲーム
|
||||||
|
ConfirmForgetQ=見落としを確認します?
|
||||||
|
ConfirmForget=見落としを確認する
|
||||||
|
Disconnect=接続を切る
|
||||||
|
ConfirmDisconnectQ=接続を確認しますか?
|
||||||
|
Confirm Disconnect=接続を確認する?
|
||||||
|
Forget=無視
|
||||||
|
Forgeting=見落としている
|
||||||
|
Info=情報
|
||||||
|
TryConnect=接続を試みる
|
||||||
|
Bluetooth Info=青歯設備情報
|
||||||
|
Connecting=接続中
|
||||||
|
BluetoothScanning=青い歯のスキャン中
|
||||||
|
Scanning=スキャン中
|
||||||
|
ShutDownConnecting=接続を閉じている
|
||||||
|
Select=選択
|
||||||
|
Detail=詳細
|
||||||
|
Applying=応用中
|
||||||
|
DownloadFailed=ダウンロード失敗
|
||||||
|
LauncherIsUpToDate=Launcherもう一番新しい
|
||||||
|
CheckWifiConnection=wifi接続をチェックしてください
|
||||||
|
TurningOn=開けている
|
||||||
|
TurningOff=閉まっている
|
||||||
|
Invalid=無効
|
||||||
|
CheckingUpdate=チェックアップ中
|
||||||
|
CheckingUpdateFailed=チェックの更新に失敗しました
|
||||||
|
Update=更新
|
||||||
|
Toggle=トグル
|
||||||
|
Rescue=救う
|
||||||
|
Airplane Mode=飛行モード
|
||||||
|
minutes=分
|
||||||
|
seconds=秒
|
||||||
|
second=秒
|
||||||
|
minute=分
|
||||||
|
Never=いつまでも
|
||||||
|
Power Options=電源オプション
|
||||||
|
Languages=言語
|
||||||
|
Notify=通知ウィジェット
|
||||||
|
Setting List=設定リスト
|
||||||
|
Wi-Fi=Wi-Fi
|
||||||
|
Bluetooth=青歯
|
||||||
|
Sound Volume=音量
|
||||||
|
Sound Volume=音量
|
||||||
|
Brightness=明るさ
|
||||||
|
BackLight Brightness=光の明るさ
|
||||||
|
Storage=メモリスペース
|
||||||
|
Timezone=時地
|
||||||
|
Timezone Selection=タイムゾーン選択
|
||||||
|
Notification=注意を通知する
|
||||||
|
About=について
|
||||||
|
Power off=関機
|
||||||
|
Buttons Layout=ボタンの配置
|
||||||
|
UpdateRetroArch=更新RetroArch
|
||||||
|
Wifi scanning=wifiスキャン中
|
||||||
|
Power option detail=電源オプションの詳細
|
||||||
|
Screen dimming=画面が暗くなる
|
||||||
|
Screen OFF=スクリーンを閉
|
||||||
|
Power OFF=関機
|
||||||
|
Power saving=省エネルギー
|
||||||
|
Balanced=バランス
|
||||||
|
Server=サーバ
|
||||||
|
Performance=性能
|
||||||
|
Confirm Power OFF?=電源を確認しますか?
|
||||||
|
Reboot=再起動
|
||||||
|
Shutdown=操業停止
|
||||||
|
Play List=プレイリスト
|
||||||
|
Music Library=音楽庫
|
||||||
|
Play/Pause=再生/停止
|
||||||
|
my favourites=お気に入り
|
||||||
107
sys.py/langs/02_한국어.ini
Normal file
107
sys.py/langs/02_한국어.ini
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
[Langs]
|
||||||
|
Settings=설치
|
||||||
|
Retro Games=클래식게임
|
||||||
|
Music Player=음악플레이어
|
||||||
|
TinyCloud=채색구름
|
||||||
|
PowerOFF=전원닫기
|
||||||
|
Reload UI=재개UI
|
||||||
|
freeDM=freeDM
|
||||||
|
CaveStory=동굴속어
|
||||||
|
RetroArch=RetroArch
|
||||||
|
Launching=시작중
|
||||||
|
Nav=방향
|
||||||
|
Scan=스캐닝
|
||||||
|
Back=반퇴
|
||||||
|
Enter=진입
|
||||||
|
Remove=삭제
|
||||||
|
Run=운행
|
||||||
|
AddToPlayList=재생목록에추가하기
|
||||||
|
Add to Playlist=재생목록에추가하기
|
||||||
|
DownloadConfirm=다운로드확인
|
||||||
|
MyFavGames=내가좋아하는게임
|
||||||
|
Deleting=삭제중
|
||||||
|
AddFav=편향추가
|
||||||
|
ADdFavList=기본설정목록에추가
|
||||||
|
Del=삭제
|
||||||
|
Please upload data over Wi-Fi=Wi-Fi를통해데이터를업로드하십시오
|
||||||
|
ConfirmDeleteQ=삭제확인?
|
||||||
|
AlreadyExisted=이미존재합니다
|
||||||
|
Cancel=취소
|
||||||
|
Yes=네
|
||||||
|
ConfirmQ=확인되나요?
|
||||||
|
Disconnecting=연결끊기중
|
||||||
|
ConfirmUpdateToFQ=확인업데이트%%s?
|
||||||
|
UpdateToFQ=업데이트%%s?
|
||||||
|
SetupGameEngineAutoQ=너이게임엔진자동설정?
|
||||||
|
Downloading=다운로드
|
||||||
|
BATOver5Pct=배터리가5%%보다더많아야합니다
|
||||||
|
DeleteConfirm=삭제확인
|
||||||
|
FavouriteGames=가장좋아하는게임
|
||||||
|
ConfirmForgetQ=무시확인?
|
||||||
|
ConfirmForget=무시확인
|
||||||
|
Disconnect=끊어지다
|
||||||
|
ConfirmDisconnectQ=확인끊기?
|
||||||
|
Confirm Disconnect=확인연결끊기
|
||||||
|
Forget=무시
|
||||||
|
Forgeting=무시중
|
||||||
|
Info=정보
|
||||||
|
TryConnect=연결을시도한다
|
||||||
|
Bluetooth Info=블루투스정보
|
||||||
|
Connecting=연결중
|
||||||
|
BluetoothScanning=블루투스스캔
|
||||||
|
Scanning=스캔중
|
||||||
|
ShutDownConnecting=연결닫기중
|
||||||
|
Select=선택하다
|
||||||
|
Detail=자세히
|
||||||
|
Applying=적용중
|
||||||
|
DownloadFailed=다운로드실패
|
||||||
|
LauncherIsUpToDate=Launcher이미최신이다
|
||||||
|
CheckWifiConnection=무선네트워크연결을확인하십시오
|
||||||
|
TurningOn=개회
|
||||||
|
TurningOff=폐회
|
||||||
|
Invalid=잘못된
|
||||||
|
CheckingUpdate=검사업데이트
|
||||||
|
CheckingUpdateFailed=고과업데이트실패
|
||||||
|
Update=업데이트
|
||||||
|
Toggle=토글
|
||||||
|
Rescue=구출
|
||||||
|
Airplane Mode=비행기모드
|
||||||
|
minutes=분
|
||||||
|
seconds=초
|
||||||
|
second=초
|
||||||
|
minute=분
|
||||||
|
Never=영원히
|
||||||
|
Power Options=전원옵션
|
||||||
|
Languages=언어
|
||||||
|
Notify=알림을통지하다
|
||||||
|
Setting List=목록설정
|
||||||
|
Wi-Fi=Wi-Fi
|
||||||
|
Bluetooth=블루투스
|
||||||
|
Sound Volume=음량
|
||||||
|
Sound Volume=음량
|
||||||
|
Brightness=밝기
|
||||||
|
BackLight Brightness=등광밝기
|
||||||
|
Storage=기억공간
|
||||||
|
Timezone=시구
|
||||||
|
Timezone Selection=시간대선택
|
||||||
|
Notification=통지
|
||||||
|
About=에관하다
|
||||||
|
Power off=전원닫기
|
||||||
|
Buttons Layout=버튼 레이아웃
|
||||||
|
UpdateRetroArch=갱신RetroArch
|
||||||
|
Wifi scanning=무선스캔
|
||||||
|
Power option detail=전원옵션세부정보
|
||||||
|
Screen dimming=화면이어두워진다
|
||||||
|
Screen OFF=화면닫기
|
||||||
|
Power OFF=전원닫기
|
||||||
|
Power saving=에너지절약
|
||||||
|
Balanced=밸런싱
|
||||||
|
Server=서버
|
||||||
|
Performance=성능
|
||||||
|
Confirm Power OFF?=종료를확인하시겠습니까?
|
||||||
|
Reboot=재개
|
||||||
|
Shutdown=폐쇄하다
|
||||||
|
Play List=음악목록
|
||||||
|
Music Library=음악라이브러리
|
||||||
|
Play/Pause=재생/정지
|
||||||
|
my favourites=내즐겨찾기
|
||||||
105
sys.py/langs/03_简体中文.ini
Normal file
105
sys.py/langs/03_简体中文.ini
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
[Langs]
|
||||||
|
Settings=设置
|
||||||
|
Retro Games=经典游戏
|
||||||
|
Music Player=音乐播放器
|
||||||
|
TinyCloud=彩云
|
||||||
|
PowerOFF=关机
|
||||||
|
Reload UI=重载菜单
|
||||||
|
freeDM=freeDM
|
||||||
|
CaveStory=洞窟物语
|
||||||
|
Launching=正在启动...
|
||||||
|
Nav=导航
|
||||||
|
Scan=扫描
|
||||||
|
Back=返回
|
||||||
|
Enter=进入
|
||||||
|
Remove=删除
|
||||||
|
Run=运行
|
||||||
|
AddToPlayList=添加到播放列表
|
||||||
|
Add to Playlist=添加到播放列表
|
||||||
|
DownloadConfirm=下载确认
|
||||||
|
MyFavGames=加星游戏列表
|
||||||
|
Deleting=删除中...
|
||||||
|
AddFav=加星
|
||||||
|
Del=删
|
||||||
|
Please upload data over Wi-Fi=请通过无线Wifi上传数据
|
||||||
|
ConfirmDeleteQ=确认删除?
|
||||||
|
AlreadyExisted=已存在
|
||||||
|
Cancel=取消
|
||||||
|
Yes=是
|
||||||
|
ConfirmQ=确认?
|
||||||
|
Disconnecting=断开连接...
|
||||||
|
ConfirmUpdateToFQ=确认升级至 %%s ?
|
||||||
|
UpdateToFQ=更新至 %%s ?
|
||||||
|
SetupGameEngineAutoQ=你希望自动安装游戏引擎部件吗?
|
||||||
|
Downloading=下载中...
|
||||||
|
BATOver5Pct=电量必须多余5%%
|
||||||
|
DeleteConfirm=删除确认
|
||||||
|
FavouriteGames=偏好游戏
|
||||||
|
ConfirmForgetQ=确认忽略?
|
||||||
|
ConfirmForget=确认忽略
|
||||||
|
Disconnect=断开
|
||||||
|
ConfirmDisconnectQ=确认断开?
|
||||||
|
Confirm Disconnect=确认断开
|
||||||
|
Forget=忽略
|
||||||
|
Forgeting=忽略中...
|
||||||
|
Info=属性
|
||||||
|
TryConnect=试连接
|
||||||
|
Bluetooth Info=蓝牙属性
|
||||||
|
Connecting=连接中
|
||||||
|
BluetoothScanning=蓝牙搜索中...
|
||||||
|
Scanning=搜索中..
|
||||||
|
ShutDownConnecting=断开连接...
|
||||||
|
Select=选择
|
||||||
|
Detail=详细
|
||||||
|
Applying=设置中...
|
||||||
|
DownloadFailed=下载失败
|
||||||
|
LauncherIsUpToDate=Launcher已是最新
|
||||||
|
CheckWifiConnection=请检查 Wi-Fi 连接
|
||||||
|
TurningOn=打开
|
||||||
|
TurningOff=关闭
|
||||||
|
Invalid=非法
|
||||||
|
CheckingUpdate=检查更新...
|
||||||
|
CheckingUpdateFailed=检查更新失败
|
||||||
|
Update=更新
|
||||||
|
Toggle=切换
|
||||||
|
Rescue=拯救
|
||||||
|
Airplane Mode=飞行模式
|
||||||
|
minutes=分
|
||||||
|
seconds=秒
|
||||||
|
second=秒
|
||||||
|
minute=分
|
||||||
|
Never=永不
|
||||||
|
Power Options=电源选项
|
||||||
|
Languages=语言
|
||||||
|
Notify=提醒
|
||||||
|
Setting List=设置列表
|
||||||
|
Wi-Fi=Wi-Fi
|
||||||
|
Bluetooth=蓝牙
|
||||||
|
Sound Volume=音量
|
||||||
|
Sound volume=音量
|
||||||
|
Brightness=亮度
|
||||||
|
BackLight Brightness=背光亮度
|
||||||
|
Storage=存储空间
|
||||||
|
Timezone=时区
|
||||||
|
Timezone Selection=时区选择
|
||||||
|
Notification=提醒控件
|
||||||
|
About=关于GameShell
|
||||||
|
Power off=关机
|
||||||
|
Buttons Layout=按纽布局
|
||||||
|
UpdateRetroArch=更新RetroArch
|
||||||
|
Wifi scanning=WiFi扫描中
|
||||||
|
Power option detail=电源选项
|
||||||
|
Screen dimming=屏幕变暗
|
||||||
|
Screen OFF=关闭屏幕
|
||||||
|
Power OFF=关机
|
||||||
|
Power saving=节能
|
||||||
|
Balanced=平衡
|
||||||
|
Server=服务器
|
||||||
|
Performance=性能
|
||||||
|
Confirm Power OFF?=确认关机?
|
||||||
|
Reboot=重启
|
||||||
|
Shutdown=关闭
|
||||||
|
Play List=播放列表
|
||||||
|
Music Library=乐库
|
||||||
|
Play/Pause=播放/暂停
|
||||||
|
my favourites=我的收藏夹
|
||||||
105
sys.py/langs/04_繁体中文.ini
Normal file
105
sys.py/langs/04_繁体中文.ini
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
[Langs]
|
||||||
|
Settings=設置
|
||||||
|
Retro Games=經典遊戲
|
||||||
|
Music Player=音樂播放器
|
||||||
|
TinyCloud=彩雲
|
||||||
|
PowerOFF=關機
|
||||||
|
Reload UI=重載菜單
|
||||||
|
freeDM=freeDM
|
||||||
|
CaveStory=洞窟物語
|
||||||
|
Launching=正在啟動...
|
||||||
|
Nav=導航
|
||||||
|
Scan=掃描
|
||||||
|
Back=返回
|
||||||
|
Enter=進入
|
||||||
|
Remove=刪除
|
||||||
|
Run=運行
|
||||||
|
AddToPlayList=添加到播放列表
|
||||||
|
Add to Playlist=添加到播放列表
|
||||||
|
DownloadConfirm=下載確認
|
||||||
|
MyFavGames=加星遊戲列表
|
||||||
|
Deleting=刪除中...
|
||||||
|
AddFav=加星
|
||||||
|
Del=刪
|
||||||
|
Please upload data over Wi-Fi=請通過無線Wifi上傳數據
|
||||||
|
ConfirmDeleteQ=確認刪除?
|
||||||
|
AlreadyExisted=已存在
|
||||||
|
Cancel=取消
|
||||||
|
Yes=是
|
||||||
|
ConfirmQ=確認?
|
||||||
|
Disconnecting=斷開連接...
|
||||||
|
ConfirmUpdateToFQ=確認升級至 %%s ?
|
||||||
|
UpdateToFQ=更新至 %%s ?
|
||||||
|
SetupGameEngineAutoQ=你希望自動安裝遊戲引擎部件嗎?
|
||||||
|
Downloading=下載中...
|
||||||
|
BATOver5Pct=電量必須多余5%%
|
||||||
|
DeleteConfirm=刪除確認
|
||||||
|
FavouriteGames=偏好遊戲
|
||||||
|
ConfirmForgetQ=確認忽略?
|
||||||
|
ConfirmForget=確認忽略
|
||||||
|
Disconnect=斷開
|
||||||
|
ConfirmDisconnectQ=確認斷開?
|
||||||
|
Confirm Disconnect=確認斷開
|
||||||
|
Forget=忽略
|
||||||
|
Forgeting=忽略中...
|
||||||
|
Info=屬性
|
||||||
|
TryConnect=試連接
|
||||||
|
Bluetooth Info=藍牙屬性
|
||||||
|
Connecting=連接中
|
||||||
|
BluetoothScanning=藍牙搜索中...
|
||||||
|
Scanning=搜索中..
|
||||||
|
ShutDownConnecting=斷開連接...
|
||||||
|
Select=選擇
|
||||||
|
Detail=詳細
|
||||||
|
Applying=設置中...
|
||||||
|
DownloadFailed=下載失敗
|
||||||
|
LauncherIsUpToDate=Launcher已是最新
|
||||||
|
CheckWifiConnection=請檢查 Wi-Fi 連接
|
||||||
|
TurningOn=打開
|
||||||
|
TurningOff=關閉
|
||||||
|
Invalid=非法
|
||||||
|
CheckingUpdate=檢查更新...
|
||||||
|
CheckingUpdateFailed=檢查更新失敗
|
||||||
|
Update=更新
|
||||||
|
Toggle=切換
|
||||||
|
Rescue=拯救
|
||||||
|
Airplane Mode=飛行模式
|
||||||
|
minutes=分
|
||||||
|
seconds=秒
|
||||||
|
second=秒
|
||||||
|
minute=分
|
||||||
|
Never=永不
|
||||||
|
Power Options=電源選項
|
||||||
|
Languages=語言
|
||||||
|
Notify=提醒
|
||||||
|
Setting List=設置列表
|
||||||
|
Wi-Fi=Wi-Fi
|
||||||
|
Bluetooth=藍牙
|
||||||
|
Sound Volume=音量
|
||||||
|
Sound volume=音量
|
||||||
|
Brightness=亮度
|
||||||
|
BackLight Brightness=背光亮度
|
||||||
|
Storage=存儲空間
|
||||||
|
Timezone=時區
|
||||||
|
Timezone Selection=時區選擇
|
||||||
|
Notification=提醒控件
|
||||||
|
About=關於GameShell
|
||||||
|
Power off=關機
|
||||||
|
Buttons Layout=按紐布局
|
||||||
|
UpdateRetroArch=更新RetroArch
|
||||||
|
Wifi scanning=WiFi掃描中
|
||||||
|
Power option detail=電源選項
|
||||||
|
Screen dimming=屏幕變暗
|
||||||
|
Screen OFF=關閉屏幕
|
||||||
|
Power OFF=關機
|
||||||
|
Power saving=節能
|
||||||
|
Balanced=平衡
|
||||||
|
Server=服務器
|
||||||
|
Performance=性能
|
||||||
|
Confirm Power OFF?=確認關機?
|
||||||
|
Reboot=重啟
|
||||||
|
Shutdown=關閉
|
||||||
|
Play List=播放列表
|
||||||
|
Music Library=樂庫
|
||||||
|
Play/Pause=播放/暫停
|
||||||
|
my favourites=我的收藏夾
|
||||||
@ -31,7 +31,7 @@ else:
|
|||||||
|
|
||||||
|
|
||||||
#local UI import
|
#local UI import
|
||||||
from UI.constants import Width,Height,bg_color,icon_width,icon_height,DT,GMEVT,RUNEVT,RUNSYS,ICON_TYPES,POWEROPT
|
from UI.constants import Width,Height,bg_color,icon_width,icon_height,DT,GMEVT,RUNEVT,RUNSYS,ICON_TYPES,POWEROPT,RESTARTUI
|
||||||
from UI.util_funcs import ReplaceSuffix,FileExists, ReadTheFileContent,midRect,color_surface,SwapAndShow,GetExePath,X_center_mouse
|
from UI.util_funcs import ReplaceSuffix,FileExists, ReadTheFileContent,midRect,color_surface,SwapAndShow,GetExePath,X_center_mouse
|
||||||
from UI.page import PageStack,PageSelector,Page
|
from UI.page import PageStack,PageSelector,Page
|
||||||
from UI.label import Label
|
from UI.label import Label
|
||||||
@ -282,7 +282,7 @@ def RecordKeyDns(thekey,main_screen):
|
|||||||
Keys.append(thekey)
|
Keys.append(thekey)
|
||||||
|
|
||||||
keys = ''.join(map(str,Keys))
|
keys = ''.join(map(str,Keys))
|
||||||
print(keys)
|
#print(keys)
|
||||||
if keys == "273273274274276276275275106107":##uuddllrrab
|
if keys == "273273274274276276275275106107":##uuddllrrab
|
||||||
crt_screen.Draw()
|
crt_screen.Draw()
|
||||||
crt_screen.SwapAndShow()
|
crt_screen.SwapAndShow()
|
||||||
@ -345,7 +345,16 @@ def event_process(event,main_screen):
|
|||||||
os.chdir( GetExePath())
|
os.chdir( GetExePath())
|
||||||
os.exelp("python","python"," "+myscriptname)
|
os.exelp("python","python"," "+myscriptname)
|
||||||
return
|
return
|
||||||
|
if event.type == RESTARTUI:
|
||||||
|
pygame.quit()
|
||||||
|
gobject_main_loop.quit()
|
||||||
|
os.chdir(GetExePath())
|
||||||
|
exec_app_cmd = " sync & cd "+GetExePath()+"; exec python "+myscriptname
|
||||||
|
print(exec_app_cmd)
|
||||||
|
os.execlp("/bin/sh","/bin/sh","-c", exec_app_cmd)
|
||||||
|
os.chdir( GetExePath())
|
||||||
|
os.exelp("python","python"," "+myscriptname)
|
||||||
|
return
|
||||||
if event.type == POWEROPT:
|
if event.type == POWEROPT:
|
||||||
everytime_keydown = time.time()
|
everytime_keydown = time.time()
|
||||||
|
|
||||||
@ -539,7 +548,7 @@ if __name__ == '__main__':
|
|||||||
screen = pygame.display.set_mode(SCREEN_SIZE, 0, 32)
|
screen = pygame.display.set_mode(SCREEN_SIZE, 0, 32)
|
||||||
|
|
||||||
pygame.event.set_allowed(None)
|
pygame.event.set_allowed(None)
|
||||||
pygame.event.set_allowed([pygame.KEYDOWN,pygame.KEYUP,GMEVT,RUNEVT,RUNSYS,POWEROPT])
|
pygame.event.set_allowed([pygame.KEYDOWN,pygame.KEYUP,GMEVT,RUNEVT,RUNSYS,POWEROPT,RESTARTUI])
|
||||||
|
|
||||||
pygame.key.set_repeat(DT+DT*6+DT/2, DT+DT*3+DT/2)
|
pygame.key.set_repeat(DT+DT*6+DT/2, DT+DT*3+DT/2)
|
||||||
|
|
||||||
@ -570,9 +579,9 @@ if __name__ == '__main__':
|
|||||||
if powerlevel != "":
|
if powerlevel != "":
|
||||||
config.PowerLevel = powerlevel
|
config.PowerLevel = powerlevel
|
||||||
if powerlevel != "supersaving":
|
if powerlevel != "supersaving":
|
||||||
os.system("sudo iw wlan0 set power_save off")
|
os.system("sudo iw wlan0 set power_save off >/dev/null")
|
||||||
else:
|
else:
|
||||||
os.system("sudo iw wlan0 set power_save on")
|
os.system("sudo iw wlan0 set power_save on > /dev/null")
|
||||||
|
|
||||||
crt_screen = CreateByScreen()
|
crt_screen = CreateByScreen()
|
||||||
crt_screen.Init()
|
crt_screen.Init()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user