From c5597284546a84e31f976dda4b943719285c1e48 Mon Sep 17 00:00:00 2001 From: cuu Date: Thu, 13 Jun 2019 21:24:56 +0800 Subject: [PATCH 1/4] replace all MyIconPool._Icons to be MyIconPool.GiveIconSurface --- Menu/GameShell/10_Settings/About/__init__.py | 2 +- Menu/GameShell/10_Settings/Airplane/__init__.py | 8 ++++---- Menu/GameShell/10_Settings/Bluetooth/net_item.py | 2 +- .../10_Settings/Brightness/brightness_page.py | 4 ++-- .../10_Settings/ButtonsLayout/__init__.py | 2 +- Menu/GameShell/10_Settings/GateWay/__init__.py | 2 +- Menu/GameShell/10_Settings/Languages/__init__.py | 2 +- Menu/GameShell/10_Settings/Lima/__init__.py | 2 +- .../GameShell/10_Settings/Notification/__init__.py | 2 +- .../GameShell/10_Settings/PowerOptions/__init__.py | 2 +- Menu/GameShell/10_Settings/Skins/__init__.py | 2 +- Menu/GameShell/10_Settings/Sound/sound_page.py | 4 ++-- Menu/GameShell/10_Settings/Storage/__init__.py | 2 +- .../10_Settings/Time/timezone_lib_list_page.py | 4 ++-- Menu/GameShell/10_Settings/Wifi/net_item.py | 4 ++-- .../GameShell/97_Music Player/mpd_spectrum_page.py | 8 ++++---- .../97_Music Player/music_lib_list_page.py | 4 ++-- Menu/GameShell/97_Music Player/play_list_page.py | 2 +- Menu/GameShell/98_TinyCloud/__init__.py | 4 ++-- sys.py/UI/CommercialSoftwarePackage/__init__.py | 4 ++-- sys.py/UI/Emulator/__init__.py | 2 +- sys.py/UI/Emulator/fav_list_page.py | 2 +- sys.py/UI/Emulator/rom_list_page.py | 2 +- sys.py/UI/download_process_page.py | 4 ++-- sys.py/UI/foot_bar.py | 2 +- sys.py/UI/keyboard.py | 2 +- sys.py/UI/page.py | 14 +++++++------- sys.py/UI/title_bar.py | 2 +- 28 files changed, 48 insertions(+), 48 deletions(-) diff --git a/Menu/GameShell/10_Settings/About/__init__.py b/Menu/GameShell/10_Settings/About/__init__.py index cb73a74..44992ff 100644 --- a/Menu/GameShell/10_Settings/About/__init__.py +++ b/Menu/GameShell/10_Settings/About/__init__.py @@ -254,7 +254,7 @@ class AboutPage(Page): self._Height = self._Screen._Height bgpng = IconItem() - bgpng._ImgSurf = MyIconPool._Icons["about_bg"] + bgpng._ImgSurf = MyIconPool.GiveIconSurface("about_bg") bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0) diff --git a/Menu/GameShell/10_Settings/Airplane/__init__.py b/Menu/GameShell/10_Settings/Airplane/__init__.py index f2a11a8..3338d90 100644 --- a/Menu/GameShell/10_Settings/Airplane/__init__.py +++ b/Menu/GameShell/10_Settings/Airplane/__init__.py @@ -65,21 +65,21 @@ class AirplanePage(Page): airwire = IconItem() - airwire._ImgSurf = MyIconPool._Icons["airwire"] + airwire._ImgSurf = MyIconPool.GiveIconSurface("airwire") airwire._MyType = ICON_TYPES["STAT"] airwire._Parent = self airwire.Adjust(0,0,5,43,0) self._Icons["airwire"] = airwire GS = IconItem() - GS._ImgSurf = MyIconPool._Icons["GS"] + GS._ImgSurf = MyIconPool.GiveIconSurface("GS") GS._MyType = ICON_TYPES["STAT"] GS._Parent = self GS.Adjust(0,0,72,95,0) self._Icons["GS"] = GS DialogBoxs = MultiIconItem() - DialogBoxs._ImgSurf = MyIconPool._Icons["DialogBoxs"] + DialogBoxs._ImgSurf = MyIconPool.GiveIconSurface("DialogBoxs") DialogBoxs._MyType = ICON_TYPES["STAT"] DialogBoxs._Parent = self DialogBoxs._IconWidth = 134 @@ -90,7 +90,7 @@ class AirplanePage(Page): """ bgpng = MultiIconItem() - bgpng._ImgSurf = MyIconPool._Icons["about_bg"] + bgpng._ImgSurf = MyIconPool.GiveIconSurface("about_bg") bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0) diff --git a/Menu/GameShell/10_Settings/Bluetooth/net_item.py b/Menu/GameShell/10_Settings/Bluetooth/net_item.py index a9aa511..cc37882 100644 --- a/Menu/GameShell/10_Settings/Bluetooth/net_item.py +++ b/Menu/GameShell/10_Settings/Bluetooth/net_item.py @@ -98,7 +98,7 @@ class NetItem(object): self._Labels["mac_addr"] = name_label done_icon = NetItemIcon() - done_icon._ImgSurf = MyIconPool._Icons["done"] + done_icon._ImgSurf = MyIconPool.GiveIconSurface("done") done_icon._CanvasHWND = self._Parent._CanvasHWND done_icon._Parent = self diff --git a/Menu/GameShell/10_Settings/Brightness/brightness_page.py b/Menu/GameShell/10_Settings/Brightness/brightness_page.py index 7494ff8..8b56473 100644 --- a/Menu/GameShell/10_Settings/Brightness/brightness_page.py +++ b/Menu/GameShell/10_Settings/Brightness/brightness_page.py @@ -39,7 +39,7 @@ class BSlider(Slider): self._Height = self._Parent._Height bgpng = IconItem() - bgpng._ImgSurf = MyIconPool._Icons["light"] + bgpng._ImgSurf = MyIconPool.GiveIconSurface("light") bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0) @@ -49,7 +49,7 @@ class BSlider(Slider): scale = MultiIconItem() scale._MyType = ICON_TYPES["STAT"] scale._Parent = self - scale._ImgSurf = MyIconPool._Icons["scale"] + scale._ImgSurf = MyIconPool.GiveIconSurface("scale") scale._IconWidth = 82 scale._IconHeight = 63 scale.Adjust(0,0,82,63,0) diff --git a/Menu/GameShell/10_Settings/ButtonsLayout/__init__.py b/Menu/GameShell/10_Settings/ButtonsLayout/__init__.py index 53a09f3..70ad3da 100644 --- a/Menu/GameShell/10_Settings/ButtonsLayout/__init__.py +++ b/Menu/GameShell/10_Settings/ButtonsLayout/__init__.py @@ -153,7 +153,7 @@ class ButtonsLayoutPage(Page): self._Height = self._Screen._Height DialogBoxs = MultiIconItem() - DialogBoxs._ImgSurf = MyIconPool._Icons["buttonslayout"] + DialogBoxs._ImgSurf = MyIconPool.GiveIconSurface("buttonslayout") DialogBoxs._MyType = ICON_TYPES["STAT"] DialogBoxs._Parent = self DialogBoxs._IconWidth = 300 diff --git a/Menu/GameShell/10_Settings/GateWay/__init__.py b/Menu/GameShell/10_Settings/GateWay/__init__.py index 3ada322..8a5bc0a 100644 --- a/Menu/GameShell/10_Settings/GateWay/__init__.py +++ b/Menu/GameShell/10_Settings/GateWay/__init__.py @@ -133,7 +133,7 @@ class GateWayPage(Page): self._Height = self._Screen._Height done = IconItem() - done._ImgSurf = MyIconPool._Icons["done"] + done._ImgSurf = MyIconPool.GiveIconSurface("done") done._MyType = ICON_TYPES["STAT"] done._Parent = self self._Icons["done"] = done diff --git a/Menu/GameShell/10_Settings/Languages/__init__.py b/Menu/GameShell/10_Settings/Languages/__init__.py index 26b66c0..49ab84e 100644 --- a/Menu/GameShell/10_Settings/Languages/__init__.py +++ b/Menu/GameShell/10_Settings/Languages/__init__.py @@ -133,7 +133,7 @@ class LanguagesPage(Page): self._Height = self._Screen._Height done = IconItem() - done._ImgSurf = MyIconPool._Icons["done"] + done._ImgSurf = MyIconPool.GiveIconSurface("done") done._MyType = ICON_TYPES["STAT"] done._Parent = self self._Icons["done"] = done diff --git a/Menu/GameShell/10_Settings/Lima/__init__.py b/Menu/GameShell/10_Settings/Lima/__init__.py index ef9672e..9131709 100644 --- a/Menu/GameShell/10_Settings/Lima/__init__.py +++ b/Menu/GameShell/10_Settings/Lima/__init__.py @@ -132,7 +132,7 @@ class GPUDriverPage(Page): self._Height = self._Screen._Height done = IconItem() - done._ImgSurf = MyIconPool._Icons["done"] + done._ImgSurf = MyIconPool.GiveIconSurface("done") done._MyType = ICON_TYPES["STAT"] done._Parent = self self._Icons["done"] = done diff --git a/Menu/GameShell/10_Settings/Notification/__init__.py b/Menu/GameShell/10_Settings/Notification/__init__.py index e5cb530..d2bdc6a 100644 --- a/Menu/GameShell/10_Settings/Notification/__init__.py +++ b/Menu/GameShell/10_Settings/Notification/__init__.py @@ -44,7 +44,7 @@ class NotifyJobListItem(InfoPageListItem): self._Labels["Text"] = l done_icon = IconItem() - done_icon._ImgSurf = MyIconPool._Icons["done"] + done_icon._ImgSurf = MyIconPool.GiveIconSurface("done") done_icon._CanvasHWND = self._Parent._CanvasHWND done_icon._Parent = self diff --git a/Menu/GameShell/10_Settings/PowerOptions/__init__.py b/Menu/GameShell/10_Settings/PowerOptions/__init__.py index ed9444a..e80e68c 100644 --- a/Menu/GameShell/10_Settings/PowerOptions/__init__.py +++ b/Menu/GameShell/10_Settings/PowerOptions/__init__.py @@ -378,7 +378,7 @@ class PowerOptionsPage(Page): self._Height = self._Screen._Height done = IconItem() - done._ImgSurf = MyIconPool._Icons["done"] + done._ImgSurf = MyIconPool.GiveIconSurface("done") done._MyType = ICON_TYPES["STAT"] done._Parent = self self._Icons["done"] = done diff --git a/Menu/GameShell/10_Settings/Skins/__init__.py b/Menu/GameShell/10_Settings/Skins/__init__.py index 64d0cf6..33fe53c 100644 --- a/Menu/GameShell/10_Settings/Skins/__init__.py +++ b/Menu/GameShell/10_Settings/Skins/__init__.py @@ -136,7 +136,7 @@ class SkinsPage(Page): self._Height = self._Screen._Height done = IconItem() - done._ImgSurf = MyIconPool._Icons["done"] + done._ImgSurf = MyIconPool.GiveIconSurface("done") done._MyType = ICON_TYPES["STAT"] done._Parent = self self._Icons["done"] = done diff --git a/Menu/GameShell/10_Settings/Sound/sound_page.py b/Menu/GameShell/10_Settings/Sound/sound_page.py index fd18b9c..2a3c026 100644 --- a/Menu/GameShell/10_Settings/Sound/sound_page.py +++ b/Menu/GameShell/10_Settings/Sound/sound_page.py @@ -43,7 +43,7 @@ class SoundSlider(Slider): self._Height = self._Parent._Height self._BGpng = IconItem() - self._BGpng._ImgSurf = MyIconPool._Icons["vol"] + self._BGpng._ImgSurf = MyIconPool.GiveIconSurface("vol") self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0) @@ -53,7 +53,7 @@ class SoundSlider(Slider): self._Scale = MultiIconItem() self._Scale._MyType = ICON_TYPES["STAT"] self._Scale._Parent = self - self._Scale._ImgSurf = MyIconPool._Icons["scale"] + self._Scale._ImgSurf = MyIconPool.GiveIconSurface("scale") self._Scale._IconWidth = 82 self._Scale._IconHeight = 63 self._Scale.Adjust(0,0,82,63,0) diff --git a/Menu/GameShell/10_Settings/Storage/__init__.py b/Menu/GameShell/10_Settings/Storage/__init__.py index 0cd306a..0af1f8a 100644 --- a/Menu/GameShell/10_Settings/Storage/__init__.py +++ b/Menu/GameShell/10_Settings/Storage/__init__.py @@ -54,7 +54,7 @@ class StoragePage(Page): self._Height = self._Screen._Height self._BGpng = IconItem() - self._BGpng._ImgSurf = MyIconPool._Icons["icon_sd"] + self._BGpng._ImgSurf = MyIconPool.GiveIconSurface("icon_sd") self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self diff --git a/Menu/GameShell/10_Settings/Time/timezone_lib_list_page.py b/Menu/GameShell/10_Settings/Time/timezone_lib_list_page.py index f4f9a87..4297ce9 100644 --- a/Menu/GameShell/10_Settings/Time/timezone_lib_list_page.py +++ b/Menu/GameShell/10_Settings/Time/timezone_lib_list_page.py @@ -176,7 +176,7 @@ class TimezoneListPage(Page): self.SyncList("/usr/share/zoneinfo/posix") icon_for_list = MultiIconItem() - icon_for_list._ImgSurf = MyIconPool._Icons["sys"] + icon_for_list._ImgSurf = MyIconPool.GiveIconSurface("sys") icon_for_list._MyType = ICON_TYPES["STAT"] icon_for_list._Parent = self @@ -185,7 +185,7 @@ class TimezoneListPage(Page): self._BGpng = IconItem() - self._BGpng._ImgSurf = MyIconPool._Icons["empty"] + self._BGpng._ImgSurf = MyIconPool.GiveIconSurface("empty") self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self self._BGpng.AddLabel("No timezones found on system!", MyLangManager.TrFont("varela22")) diff --git a/Menu/GameShell/10_Settings/Wifi/net_item.py b/Menu/GameShell/10_Settings/Wifi/net_item.py index dc4ba88..d01b22b 100644 --- a/Menu/GameShell/10_Settings/Wifi/net_item.py +++ b/Menu/GameShell/10_Settings/Wifi/net_item.py @@ -137,13 +137,13 @@ class NetItem(Widget): lock_icon = NetItemIcon() - lock_icon._ImgSurf = MyIconPool._Icons["lock"] + lock_icon._ImgSurf = MyIconPool.GiveIconSurface("lock") lock_icon._CanvasHWND = self._Parent._CanvasHWND lock_icon._Parent = self self._Icons["lock"] = lock_icon done_icon = NetItemIcon() - done_icon._ImgSurf = MyIconPool._Icons["done"] + done_icon._ImgSurf = MyIconPool.GiveIconSurface("done") done_icon._CanvasHWND = self._Parent._CanvasHWND done_icon._Parent = self diff --git a/Menu/GameShell/97_Music Player/mpd_spectrum_page.py b/Menu/GameShell/97_Music Player/mpd_spectrum_page.py index fbd5e9c..92bf899 100644 --- a/Menu/GameShell/97_Music Player/mpd_spectrum_page.py +++ b/Menu/GameShell/97_Music Player/mpd_spectrum_page.py @@ -136,26 +136,26 @@ class MPDSpectrumPage(Page): """ self._BGpng = IconItem() - self._BGpng._ImgSurf = MyIconPool._Icons["sheep_bg"] + self._BGpng._ImgSurf = MyIconPool.GiveIconSurface("sheep_bg") self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0) self._SheepHead = IconItem() - self._SheepHead._ImgSurf = MyIconPool._Icons["sheep_head"] + self._SheepHead._ImgSurf = MyIconPool.GiveIconSurface("sheep_head") self._SheepHead._MyType = ICON_TYPES["STAT"] self._SheepHead._Parent = self self._SheepHead.Adjust(0,0,self._SheepHeadW,self._SheepHeadH,0) self._SheepBody = IconItem() - self._SheepBody._ImgSurf = MyIconPool._Icons["sheep_body"] + self._SheepBody._ImgSurf = MyIconPool.GiveIconSurface("sheep_body") self._SheepBody._MyType = ICON_TYPES["STAT"] self._SheepBody._Parent = self self._SheepBody.Adjust(0,0,self._SheepBodyW,self._SheepBodyH,0) """ self._cwp_png = IconItem() - self._cwp_png._ImgSurf = MyIconPool._Icons["tape"] + self._cwp_png._ImgSurf = MyIconPool.GiveIconSurface("tape") self._cwp_png._MyType = ICON_TYPES["STAT"] self._cwp_png._Parent = self self._cwp_png.Adjust(0,0,79,79,0) diff --git a/Menu/GameShell/97_Music Player/music_lib_list_page.py b/Menu/GameShell/97_Music Player/music_lib_list_page.py index 5bcc1b4..61e88c6 100644 --- a/Menu/GameShell/97_Music Player/music_lib_list_page.py +++ b/Menu/GameShell/97_Music Player/music_lib_list_page.py @@ -172,7 +172,7 @@ class MusicLibListPage(Page): self.SyncList("/") icon_for_list = MultiIconItem() - icon_for_list._ImgSurf = MyIconPool._Icons["sys"] + icon_for_list._ImgSurf = MyIconPool.GiveIconSurface("sys") icon_for_list._MyType = ICON_TYPES["STAT"] icon_for_list._Parent = self @@ -181,7 +181,7 @@ class MusicLibListPage(Page): self._BGpng = IconItem() - self._BGpng._ImgSurf = MyIconPool._Icons["empty"] + self._BGpng._ImgSurf = MyIconPool.GiveIconSurface("empty") self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self self._BGpng.AddLabel(MyLangManager.Tr("Please upload data over Wi-Fi"), MyLangManager.TrFont("varela22")) diff --git a/Menu/GameShell/97_Music Player/play_list_page.py b/Menu/GameShell/97_Music Player/play_list_page.py index 4cc6a4e..790c2ab 100644 --- a/Menu/GameShell/97_Music Player/play_list_page.py +++ b/Menu/GameShell/97_Music Player/play_list_page.py @@ -180,7 +180,7 @@ class PlayListPage(Page): gobject.timeout_add(850,self.GObjectInterval) self._BGpng = IconItem() - self._BGpng._ImgSurf = MyIconPool._Icons["heart"] + self._BGpng._ImgSurf = MyIconPool.GiveIconSurface("heart") self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self self._BGpng.AddLabel(MyLangManager.Tr("my favorite music"), MyLangManager.TrFont("varela18")) diff --git a/Menu/GameShell/98_TinyCloud/__init__.py b/Menu/GameShell/98_TinyCloud/__init__.py index 46c8d69..8ebc531 100644 --- a/Menu/GameShell/98_TinyCloud/__init__.py +++ b/Menu/GameShell/98_TinyCloud/__init__.py @@ -155,7 +155,7 @@ class TinyCloudPage(Page): self._PngSize["online"] = (75,122) bgpng = IconItem() - bgpng._ImgSurf = MyIconPool._Icons["needwifi_bg"] + bgpng._ImgSurf = MyIconPool.GiveIconSurface("needwifi_bg") bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.Adjust(0,0,self._PngSize["bg"][0],self._PngSize["bg"][1],0) @@ -163,7 +163,7 @@ class TinyCloudPage(Page): self._Icons["bg"] = bgpng onlinepng = IconItem() - onlinepng._ImgSurf = MyIconPool._Icons["online"] + onlinepng._ImgSurf = MyIconPool.GiveIconSurface("online") onlinepng._MyType = ICON_TYPES["STAT"] onlinepng._Parent = self onlinepng.Adjust(0,0,self._PngSize["online"][0], self._PngSize["online"][1],0) diff --git a/sys.py/UI/CommercialSoftwarePackage/__init__.py b/sys.py/UI/CommercialSoftwarePackage/__init__.py index a6add87..6a412a5 100644 --- a/sys.py/UI/CommercialSoftwarePackage/__init__.py +++ b/sys.py/UI/CommercialSoftwarePackage/__init__.py @@ -49,7 +49,7 @@ class NotFoundPage(Page): self._CanvasHWND = self._Screen._CanvasHWND self._BGpng = IconItem() - self._BGpng._ImgSurf = MyIconPool._Icons[self._BG] + self._BGpng._ImgSurf = MyIconPool.GiveIconSurface(self._BG) self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self #print( MyIconPool.Width(self._BG),MyIconPool.Height(self._BG) ) @@ -143,7 +143,7 @@ class HashErrPage(Page): self._CanvasHWND = self._Screen._CanvasHWND self._BGpng = IconItem() - self._BGpng._ImgSurf = MyIconPool._Icons[self._BG] + self._BGpng._ImgSurf = MyIconPool.GiveIconSurface(self._BG) self._BGpng._MyType = ICON_TYPES["STAT"] self._BGpng._Parent = self self._BGpng.Adjust(0,0,MyIconPool.Width(self._BG),MyIconPool.Height(self._BG),0) diff --git a/sys.py/UI/Emulator/__init__.py b/sys.py/UI/Emulator/__init__.py index b180722..fdf2935 100644 --- a/sys.py/UI/Emulator/__init__.py +++ b/sys.py/UI/Emulator/__init__.py @@ -70,7 +70,7 @@ class MyEmulator(object): keyname = i.split(".")[0] self._Icons[keyname] = pygame.image.load(basepath+"/"+i).convert_alpha() """ - self._Icons["sys"] = MyIconPool._Icons["sys"] + self._Icons["sys"] = MyIconPool.GiveIconSurface("sys") def InitDeleteConfirmPage(self,main_screen): diff --git a/sys.py/UI/Emulator/fav_list_page.py b/sys.py/UI/Emulator/fav_list_page.py index 0ae379f..0b5121d 100644 --- a/sys.py/UI/Emulator/fav_list_page.py +++ b/sys.py/UI/Emulator/fav_list_page.py @@ -234,7 +234,7 @@ class FavListPage(Page): bgpng = IconItem() - bgpng._ImgSurf = MyIconPool._Icons["star"] + bgpng._ImgSurf = MyIconPool.GiveIconSurface("star") bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.AddLabel(MyLangManager.Tr("MyFavGames"), MyLangManager.TrFont("varela18")) diff --git a/sys.py/UI/Emulator/rom_list_page.py b/sys.py/UI/Emulator/rom_list_page.py index a0c7508..2398764 100644 --- a/sys.py/UI/Emulator/rom_list_page.py +++ b/sys.py/UI/Emulator/rom_list_page.py @@ -269,7 +269,7 @@ class RomListPage(Page): bgpng = IconItem() - bgpng._ImgSurf = MyIconPool._Icons["empty"] + bgpng._ImgSurf = MyIconPool.GiveIconSurface("empty") bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.AddLabel(MyLangManager.Tr("Please upload data over Wi-Fi"), MyLangManager.TrFont("varela22")) diff --git a/sys.py/UI/download_process_page.py b/sys.py/UI/download_process_page.py index 2f99dd9..74e191a 100644 --- a/sys.py/UI/download_process_page.py +++ b/sys.py/UI/download_process_page.py @@ -58,14 +58,14 @@ class DownloadProcessPage(Page): self._PngSize["needwifi_bg"] = (253,132) bgpng = IconItem() - bgpng._ImgSurf = MyIconPool._Icons["rom_download"] + bgpng._ImgSurf = MyIconPool.GiveIconSurface("rom_download") bgpng._MyType = ICON_TYPES["STAT"] bgpng._Parent = self bgpng.Adjust(0,0,self._PngSize["bg"][0],self._PngSize["bg"][1],0) self._Icons["bg"] = bgpng needwifi_bg = IconItem() - needwifi_bg._ImgSurf = MyIconPool._Icons["needwifi_bg"] + needwifi_bg._ImgSurf = MyIconPool.GiveIconSurface("needwifi_bg") needwifi_bg._MyType = ICON_TYPES["STAT"] needwifi_bg._Parent = self needwifi_bg.Adjust(0,0,self._PngSize["needwifi_bg"][0],self._PngSize["needwifi_bg"][1],0) diff --git a/sys.py/UI/foot_bar.py b/sys.py/UI/foot_bar.py index 1a8f53c..b2cc8e2 100644 --- a/sys.py/UI/foot_bar.py +++ b/sys.py/UI/foot_bar.py @@ -94,7 +94,7 @@ class FootBar(Widget): round_corners._MyType = ICON_TYPES["STAT"] round_corners._Parent = self - round_corners._ImgSurf = MyIconPool._Icons["roundcorners"] + round_corners._ImgSurf = MyIconPool.GiveIconSurface("roundcorners") round_corners.Adjust(0,0,10,10,0) self._Icons["round_corners"] = round_corners diff --git a/sys.py/UI/keyboard.py b/sys.py/UI/keyboard.py index bd71987..51aa395 100644 --- a/sys.py/UI/keyboard.py +++ b/sys.py/UI/keyboard.py @@ -128,7 +128,7 @@ class Keyboard(Page): if val == "_L" or val == "_R": it = KeyboardIcon() - it._ImgSurf = MyIconPool._Icons[val] + it._ImgSurf = MyIconPool.GiveIconSurface(val) it._Parent = self it._Str = val it.Init(start_x+it._ImgSurf.get_width()/2 ,start_y,it._ImgSurf.get_width(),it._ImgSurf.get_height(),0) diff --git a/sys.py/UI/page.py b/sys.py/UI/page.py index b29350c..8986b12 100644 --- a/sys.py/UI/page.py +++ b/sys.py/UI/page.py @@ -147,7 +147,7 @@ class Page(Widget): cnt+=1 ps = PageSelector() - ps._IconSurf = MyIconPool._Icons["blueselector"] + ps._IconSurf = MyIconPool.GiveIconSurface("blueselector") ps._Parent = self ps.Init(icon_width/2, TitleBar._BarHeight+icon_height/2,92,92,128) self._Ps = ps @@ -171,7 +171,7 @@ class Page(Widget): it._ImgSurf = pygame.transform.smoothscale(it._ImgSurf,(it._Width,it._Height)) ps = PageSelector() - ps._IconSurf = MyIconPool._Icons["blueselector"] + ps._IconSurf = MyIconPool.GiveIconSurface("blueselector") ps._Parent = self ps.Init(start_x,start_y,92,92,128) @@ -223,7 +223,7 @@ class Page(Widget): # it._ImgSurf = pygame.transform.smoothscale(it._ImgSurf,(it._Width,it._Height)) ps = PageSelector() - ps._IconSurf = MyIconPool._Icons["blueselector"] + ps._IconSurf = MyIconPool.GiveIconSurface("blueselector") ps._Parent = self ps.Init(start_x,start_y,92,92,128) @@ -261,7 +261,7 @@ class Page(Widget): cnt+=1 ps = PageSelector() - ps._IconSurf = MyIconPool._Icons["blueselector"] + ps._IconSurf = MyIconPool.GiveIconSurface("blueselector") ps._Parent = self ps.Init(icon_width/2,icon_height/2,92,92,128) self._Ps = ps @@ -284,7 +284,7 @@ class Page(Widget): it.Adjust(start_x+i*icon_width,start_y,icon_width,icon_height,0) ps = PageSelector() - ps._IconSurf = MyIconPool._Icons["blueselector"] + ps._IconSurf = MyIconPool.GiveIconSurface("blueselector") ps._Parent = self ps.Init(start_x,start_y,92,92,128) self._Ps = ps @@ -303,7 +303,7 @@ class Page(Widget): ps = PageSelector() - ps._IconSurf = MyIconPool._Icons["blueselector"] + ps._IconSurf = MyIconPool.GiveIconSurface("blueselector") ps._Parent = self ps.Init(start_x,start_y-self._SelectedIconTopOffset,92,92,128) @@ -339,7 +339,7 @@ class Page(Widget): if self._IconNumbers > 0: ps = PageSelector() - ps._IconSurf = MyIconPool._Icons["blueselector"] + ps._IconSurf = MyIconPool.GiveIconSurface("blueselector") ps._Parent = self ps.Init(start_x,start_y,icon_width+4,icon_height+4,128) self._Ps = ps diff --git a/sys.py/UI/title_bar.py b/sys.py/UI/title_bar.py index 2f27b89..cfe3c96 100644 --- a/sys.py/UI/title_bar.py +++ b/sys.py/UI/title_bar.py @@ -259,7 +259,7 @@ class TitleBar(Widget): round_corners._MyType = ICON_TYPES["STAT"] round_corners._Parent = self - round_corners._ImgSurf = MyIconPool._Icons["roundcorners"] + round_corners._ImgSurf = MyIconPool.GiveIconSurface("roundcorners") round_corners.Adjust(0,0,10,10,0) self._Icons["round_corners"] = round_corners From 29cbe9297adcf7dad805e4ac496c6dbb962edc2c Mon Sep 17 00:00:00 2001 From: cuu Date: Mon, 17 Jun 2019 18:18:18 +0800 Subject: [PATCH 2/4] switch lima improvements --- Menu/GameShell/10_Settings/Lima/__init__.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Menu/GameShell/10_Settings/Lima/__init__.py b/Menu/GameShell/10_Settings/Lima/__init__.py index 9131709..96d3ed0 100644 --- a/Menu/GameShell/10_Settings/Lima/__init__.py +++ b/Menu/GameShell/10_Settings/Lima/__init__.py @@ -11,7 +11,7 @@ from libs.roundrects import aa_round_rect from UI.constants import Width,Height,ICON_TYPES,RESTARTUI from UI.page import Page,PageSelector from UI.label import Label -from UI.util_funcs import midRect,FileExists +from UI.util_funcs import midRect,FileExists,ArmSystem from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB from UI.scroller import ListScroller from UI.icon_pool import MyIconPool @@ -170,12 +170,16 @@ class GPUDriverPage(Page): self._Screen._MsgBox.Draw() self._Screen.SwapAndShow() - if "modesetting" in cur_li._Value: + if "modesetting" in cur_li._Value: ## enable lima os.system("touch %s/.lima" % os.path.expanduser('~') ) - os.system("sudo mv /usr/lib/xorg/modules/drivers/modesetting_drv.so.lima /usr/lib/xorg/modules/drivers/modesetting_drv.so") - else: + ArmSystem("sudo mv /usr/lib/xorg/modules/drivers/modesetting_drv.so.lima /usr/lib/xorg/modules/drivers/modesetting_drv.so") + ArmSystem("sudo sed -i '/^#.*lima/s/^#//' /etc/ld.so.conf.d/00-arm-linux-gnueabihf.conf") + ArmSystem("sudo ldconfig") + else: #disable lima os.system("rm %s/.lima" % os.path.expanduser('~') ) - os.system("sudo mv /usr/lib/xorg/modules/drivers/modesetting_drv.so /usr/lib/xorg/modules/drivers/modesetting_drv.so.lima") + ArmSystem("sudo mv /usr/lib/xorg/modules/drivers/modesetting_drv.so /usr/lib/xorg/modules/drivers/modesetting_drv.so.lima") + ArmSystem("sudo sed -i 's/^[^#]*lima/#&/' /etc/ld.so.conf.d/00-arm-linux-gnueabihf.conf") + ArmSystem("sudo ldconfig") pygame.time.delay(800) os.system("sudo reboot") From 4d67c053ff7a60ffbb3571e76628b035911fd884 Mon Sep 17 00:00:00 2001 From: cuu Date: Thu, 20 Jun 2019 14:23:01 +0800 Subject: [PATCH 3/4] ChocoDM --- Menu/GameShell/32_ChocoDM/action.config | 6 ++++++ Menu/GameShell/32_freeDM.sh | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 Menu/GameShell/32_ChocoDM/action.config delete mode 100755 Menu/GameShell/32_freeDM.sh diff --git a/Menu/GameShell/32_ChocoDM/action.config b/Menu/GameShell/32_ChocoDM/action.config new file mode 100644 index 0000000..706a84f --- /dev/null +++ b/Menu/GameShell/32_ChocoDM/action.config @@ -0,0 +1,6 @@ +ROM=/home/cpi/games/ChocoDM +ROM_SO= +EXT=wad +LAUNCHER=chocolate-doom -iwad +TITLE=ChocoDM +SO_URL= diff --git a/Menu/GameShell/32_freeDM.sh b/Menu/GameShell/32_freeDM.sh deleted file mode 100755 index 5613ef0..0000000 --- a/Menu/GameShell/32_freeDM.sh +++ /dev/null @@ -1 +0,0 @@ -chocolate-doom -iwad /home/cpi/games/FreeDM/freedoom1.wad From 055ee12867cdbfdf73ee32161f2011ff7ceb5642 Mon Sep 17 00:00:00 2001 From: cuu Date: Fri, 21 Jun 2019 12:16:44 +0800 Subject: [PATCH 4/4] add launcher and os version in About --- Menu/GameShell/10_Settings/About/__init__.py | 36 ++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/Menu/GameShell/10_Settings/About/__init__.py b/Menu/GameShell/10_Settings/About/__init__.py index 44992ff..ab8b654 100644 --- a/Menu/GameShell/10_Settings/About/__init__.py +++ b/Menu/GameShell/10_Settings/About/__init__.py @@ -12,7 +12,7 @@ from libs.roundrects import aa_round_rect from UI.constants import Width,Height,ICON_TYPES from UI.page import Page,PageSelector from UI.label import Label -from UI.util_funcs import midRect +from UI.util_funcs import midRect,FileExists from UI.keys_def import CurKeys, IsKeyMenuOrB from UI.scroller import ListScroller from UI.icon_pool import MyIconPool @@ -21,6 +21,8 @@ from UI.multilabel import MultiLabel from UI.lang_manager import MyLangManager from UI.skin_manager import MySkinManager +from config import VERSION + class InfoPageListItem(object): _PosX = 0 _PosY = 0 @@ -206,7 +208,32 @@ class AboutPage(Page): memory["value"] = str( int(parts[1].strip())/1000.0) +" MB" self._AList["memory"] = memory break - + + def LauncherVersion(self): + launcher_version = {} + launcher_version["key"] = "launcher_ver" + launcher_version["label"] = "Launcher:" + launcher_version["value"] = VERSION + self._AList["launcher_ver"] = launcher_version + + def OsImageVersion(self): + if FileExists("/etc/clockworkpi_os_image_version"): + try: + with open("/etc/clockworkpi_os_image_version") as f: + content = f.readlines() + content = [x.strip() for x in content] + + except: + print("open %s failed" % "/etc/clockworkpi_os_image_version") + content = None + + if content != None and len(content) > 0: + os_image_ver = {} + os_image_ver["key"] = "os_image_ver" + os_image_ver["label"] = "OS Image:" + os_image_ver["value"] = content[0][:12] + self._AList["os_image_ver"] = os_image_ver + def GenList(self): self._MyList = [] @@ -215,7 +242,7 @@ class AboutPage(Page): start_y = 10 last_height = 0 - for i,u in enumerate( ["processor","armcores","cpuscalemhz","features","memory","uname"] ): + for i,u in enumerate( ["processor","armcores","cpuscalemhz","features","memory","uname","launcher_ver","os_image_ver"] ): #for i,u in enumerate( ["processor","cpucores","cpumhz","flags","memory","uname"] ): if u not in self._AList: continue @@ -266,6 +293,9 @@ class AboutPage(Page): self.CpuMhz() self.Uname() + self.LauncherVersion() + self.OsImageVersion() + self.GenList() self._Scroller = ListScroller()