continue translate

This commit is contained in:
cuu
2018-11-30 19:08:35 +08:00
parent 44ce359f0e
commit b3aea583a5
33 changed files with 316 additions and 185 deletions

View File

@@ -22,17 +22,18 @@ from UI.scroller import ListScroller
from UI.icon_pool import MyIconPool
from UI.icon_item import IconItem
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.info_page_list_item import InfoPageListItem
from UI.multilabel import MultiLabel
from UI.lang_manager import MyLangManager
from net_item import NetItem
class BleForgetConfirmPage(ConfirmPage):
_ConfirmText = "Confirm Forget?"
_ConfirmText = MyLangManager.Tr("ConfirmForgetQ")
def KeyDown(self,event):
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
@@ -41,7 +42,7 @@ class BleForgetConfirmPage(ConfirmPage):
self._Screen.SwapAndShow()
if event.key == CurKeys["B"]:
self.SnapMsg("Deleteing...")
self.SnapMsg(MyLangManager.Tr("Deleting"))
self._Screen.Draw()
self._Screen.SwapAndShow()
@@ -68,7 +69,7 @@ class BleForgetConfirmPage(ConfirmPage):
class BleInfoPageSelector(PageSelector):
_BackgroundColor = SkinManager().GiveColor('Front')
_BackgroundColor = MySkinManager.GiveColor('Front')
def __init__(self):
self._PosX = 0
@@ -93,9 +94,9 @@ class BleInfoPageSelector(PageSelector):
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
class BleInfoPage(Page):
_FootMsg = ["Nav.","Disconnect","Forget","Back",""]
_FootMsg = [MyLangManager.Tr("Nav"),MyLangManager.Tr("Disconnect"),MyLangManager.Tr("Forget"),MyLangManager.Tr("Back"),""]
_MyList = []
_ListFontObj = fonts["varela15"]
_ListFontObj = MyLangManager.TrFont("varela15")
_ListSmFontObj = fonts["varela12"] # small font
_ListSm2FontObj= fonts["varela11"]
@@ -126,7 +127,7 @@ class BleInfoPage(Page):
self._ConfirmPage1 = BleForgetConfirmPage()
self._ConfirmPage1._Screen = self._Screen
self._ConfirmPage1._Name = "Confirm Forget"
self._ConfirmPage1._Name = MyLangManager.Tr("ConfirmForget")
self._ConfirmPage1._Parent = self
self._ConfirmPage1.Init()
@@ -204,7 +205,7 @@ class BleInfoPage(Page):
proxy_obj = bus.get_object("org.bluez", self._Path)
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
self._Screen._MsgBox.SetText("Forgeting...")
self._Screen._MsgBox.SetText(MyLangManager.Tr("Forgeting"))
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
@@ -229,8 +230,8 @@ class BleInfoPage(Page):
proxy_obj = bus.get_object("org.bluez", self._Path)
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
self._Screen._FootBar.UpdateNavText("Disconnecting...")
self._Screen._MsgBox.SetText("Disconnecting...")
self._Screen._FootBar.UpdateNavText(MyLangManager.Tr("Disconnecting"))
self._Screen._MsgBox.SetText(MyLangManager.Tr("Disconnecting"))
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
@@ -260,7 +261,7 @@ class BleInfoPage(Page):
if self._AList != None:
if "Connected" in self._AList:
if self._AList["Connected"] == 1:
self._FootMsg[1] = "Disconnect"
self._FootMsg[1] = MyLangManager.Tr("Disconnect")
else:
self._FootMsg[1] = ""
@@ -322,7 +323,7 @@ class BleInfoPage(Page):
class BleListSelector(PageSelector):
_BackgroundColor = SkinManager().GiveColor('Front')
_BackgroundColor = MySkinManager.GiveColor('Front')
def __init__(self):
self._PosX = 0
@@ -356,9 +357,9 @@ class BleListMessageBox(Label):
x = (self._Parent._Width - w)/2
y = (self._Parent._Height - h)/2
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))
@@ -384,7 +385,7 @@ class BluetoothPage(Page):
_BlockCb = None
_LastStatusMsg = ""
_FootMsg = ["Nav.","Scan","Info","Back","TryConnect"]
_FootMsg = [MyLangManager.Tr("Nav"),MyLangManager.Tr("Scan"),MyLangManager.Tr("Info"),MyLangManager.Tr("Back"),MyLangManager.Tr("TryConnect")]
_Scroller = None
_ListFontObj = fonts["notosanscjk15"]
@@ -428,7 +429,7 @@ class BluetoothPage(Page):
msgbox = BleListMessageBox()
msgbox._CanvasHWND = self._CanvasHWND
msgbox.Init(" ",fonts["veramono12"])
msgbox.Init(" ",MyLangManager.TrFont("veramono12"))
msgbox._Parent = self
self._MsgBox = msgbox
@@ -443,7 +444,7 @@ class BluetoothPage(Page):
self._InfoPage = BleInfoPage()
self._InfoPage._Screen = self._Screen
self._InfoPage._Name = "Bluetooth info"
self._InfoPage._Name = MyLangManager.Tr("BluetoothInfo")
self._InfoPage.Init()
def print_normal(self,address, properties):
@@ -529,8 +530,8 @@ class BluetoothPage(Page):
proxy_obj = bus.get_object("org.bluez", cur_li._Path)
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
self._Screen._FootBar.UpdateNavText("connecting...")
self.ShowBox("connecting...")
self._Screen._FootBar.UpdateNavText(MyLangManager.Tr("Connecting"))
self.ShowBox(MyLangManager.Tr("Connecting"))
try:
dev.Connect()
@@ -577,8 +578,8 @@ class BluetoothPage(Page):
return
self._Scanning = True
self.ShowBox("Bluetooth scanning...")
self._Screen._FootBar.UpdateNavText("bluetooth scanning")
self.ShowBox(MyLangManager.Tr("BluetoothScanning"))
self._Screen._FootBar.UpdateNavText(MyLangManager.Tr("Scanning"))
proxy_obj = self._Dbus.get_object("org.bluez", "/org/bluez/" + self._ADAPTER_DEV)
adapter_props = dbus.Interface(proxy_obj,"org.freedesktop.DBus.Properties")
@@ -642,7 +643,7 @@ class BluetoothPage(Page):
_connecting = self.CheckIfBluetoothConnecting()
if _connecting:
self.ShutDownConnecting()
self.ShowBox("ShutDownConnecting...")
self.ShowBox(MyLangManager.Tr("ShutDownConnecting"))
self.AbortedAndReturnToUpLevel()
else:
self.AbortedAndReturnToUpLevel()

View File

@@ -9,7 +9,7 @@ from UI.fonts import fonts
from UI.icon_item import IconItem
from UI.multi_icon_item import MultiIconItem
from UI.icon_pool import MyIconPool
from UI.skin_manager import SkinManager
from UI.skin_manager import MySkinManager
class NetItemMultiIcon(MultiIconItem):
@@ -123,5 +123,5 @@ class NetItem(object):
self._Icons["done"].NewCoord(320-22,self._PosY)
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)

View File

@@ -19,12 +19,12 @@ 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 SkinManager
from UI.skin_manager import MySkinManager
import config
class ListPageSelector(PageSelector):
_BackgroundColor = SkinManager().GiveColor('Front')
_BackgroundColor = MySkinManager.GiveColor('Front')
def __init__(self):
self._PosX = 0
@@ -103,7 +103,7 @@ class PageListItem(object):
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)
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):
@@ -445,9 +445,9 @@ class PowerOptionsPage(Page):
config.PowerLevel = cur_li._Value
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:
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.Draw()

View File

@@ -6,7 +6,7 @@ import os
## local UI import
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.icon_item import IconItem
from UI.icon_pool import MyIconPool
@@ -28,7 +28,7 @@ class StoragePage(Page):
_BGmsg = "%.1fGB of %.1fGB Used"
_DskUsg = None
_HighColor = SkinManager().GiveColor('High')
_HighColor = MySkinManager.GiveColor('High')
_FootMsg = ["Nav.","","","Back",""]
def __init__(self):
@@ -99,7 +99,7 @@ class StoragePage(Page):
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)
@@ -107,7 +107,7 @@ class StoragePage(Page):
rect2.left = rect_.left
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):

View File

@@ -10,7 +10,7 @@ from UI.label import Label
from UI.fonts import fonts
from UI.icon_item import IconItem
from UI.util_funcs import midRect
from UI.skin_manager import SkinManager
from UI.skin_manager import MySkinManager
# a item for List
# - - - - - - - - - - - --
@@ -32,7 +32,7 @@ class ListItemIcon(IconItem):
class ListItemLabel(Label):
_ActiveColor = SkinManager().GiveColor('Active')
_ActiveColor = MySkinManager.GiveColor('Active')
_Active = False
def Draw(self):
@@ -107,7 +107,7 @@ class ListItem(object):
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()

View File

@@ -17,7 +17,7 @@ from UI.keys_def import CurKeys
from UI.multi_icon_item import MultiIconItem
from UI.icon_pool import MyIconPool
from UI.scroller import ListScroller
from UI.skin_manager import SkinManager
from UI.skin_manager import MySkinManager
from list_item import ListItem
@@ -51,7 +51,7 @@ class TimeLibStack:
return len(self.stack)
class ListPageSelector(PageSelector):
_BackgroundColor = SkinManager().GiveColor('Front')
_BackgroundColor = MySkinManager.GiveColor('Front')
def __init__(self):
self._PosX = 0
@@ -190,7 +190,7 @@ class TimezoneListPage(Page):
self._BGpng._MyType = ICON_TYPES["STAT"]
self._BGpng._Parent = self
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)

View File

@@ -19,7 +19,7 @@ from UI.keys_def import CurKeys
from UI.confirm_page import ConfirmPage
from UI.download import Download
from UI.download_process_page import DownloadProcessPage
from UI.skin_manager import SkinManager
from UI.skin_manager import MySkinManager
from libs.roundrects import aa_round_rect
from libs.DBUS import is_wifi_connected_now
@@ -195,7 +195,7 @@ class InfoPageListItem(object):
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)
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 UpdatePage(Page):

View File

@@ -9,7 +9,7 @@ from UI.fonts import fonts
from UI.icon_item import IconItem
from UI.multi_icon_item import MultiIconItem
from UI.icon_pool import MyIconPool
from UI.skin_manager import SkinManager
from UI.skin_manager import MySkinManager
class NetItemMultiIcon(MultiIconItem):
@@ -195,6 +195,6 @@ class NetItem(object):
self._Icons["wifistatus"].NewCoord(self._Width-23,self._PosY)
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)

View File

@@ -15,7 +15,7 @@ from UI.util_funcs import midRect,SwapAndShow
from UI.keys_def import CurKeys
from UI.scroller import ListScroller
from UI.confirm_page import ConfirmPage
from UI.skin_manager import SkinManager
from UI.skin_manager import MySkinManager
from UI.info_page_list_item import InfoPageListItem
from UI.info_page_selector import InfoPageSelector
@@ -224,7 +224,7 @@ class WifiInfoPage(Page):
class WifiListSelector(PageSelector):
_BackgroundColor = SkinManager().GiveColor('Front')
_BackgroundColor = MySkinManager.GiveColor('Front')
def __init__(self):
self._PosX = 0
@@ -260,9 +260,9 @@ class WifiListMessageBox(Label):
x = (self._Parent._Width - w)/2
y = (self._Parent._Height - h)/2
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))

View File

@@ -13,14 +13,14 @@ from UI.fonts import fonts
from UI.util_funcs import midRect,FileExists
from UI.keys_def import CurKeys
from UI.scroller import ListScroller
from UI.skin_manager import SkinManager
from UI.skin_manager import MySkinManager
from list_item import ListItem
import myvars
class ListPageSelector(PageSelector):
_BackgroundColor = SkinManager().GiveColor('Front')
_BackgroundColor = MySkinManager.GiveColor('Front')
def __init__(self):
self._PosX = 0