Compare commits
91 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 975ce6a4a4 | |||
| 8f91cfe020 | |||
| 228a771184 | |||
| e93fc99fcd | |||
| e59787d5cd | |||
| cf7bcd615c | |||
| 5a2d662ba2 | |||
| 5313c26ea7 | |||
| 733fdbc55d | |||
| 7917aaaddc | |||
| 2dc6087950 | |||
| dc4f61ee92 | |||
| 277d3afdf9 | |||
| b6f0e69573 | |||
| efd83802d3 | |||
| 66607a26b3 | |||
| 3ecd4fa349 | |||
| 6f90f8d3cd | |||
| 3a38c26553 | |||
| 148c60330b | |||
| c5d8735b92 | |||
| b3879473b3 | |||
| 3a27edaa84 | |||
| f10cc77780 | |||
| d54a85b82a | |||
| 87943a7ac5 | |||
| 7d932ad590 | |||
| 119cf5f2ad | |||
| b2511e97c4 | |||
| 615c9e0dfc | |||
| ee71a91c0b | |||
| 38e217ef49 | |||
| f4cbaba80d | |||
| 4f7fcc6433 | |||
| eae8d4fae8 | |||
| d8426c37f0 | |||
| 6458e9c425 | |||
| 1d34a8b287 | |||
| 925076fac7 | |||
| 450680b2b3 | |||
| 66298985a4 | |||
| b36a750b3b | |||
| ae279bda94 | |||
| af8f80736e | |||
| f90b45059d | |||
| 9208fccacd | |||
| 720152dfe6 | |||
| 108e2b6877 | |||
| d8bd6a1718 | |||
| ba0c11bb4d | |||
| b488b5d4f1 | |||
| 99305de562 | |||
| d76dd08bf5 | |||
| 2577d0b534 | |||
| eab2724dc7 | |||
| 25b976d948 | |||
| 9e70c4a088 | |||
| ecfe99bc49 | |||
| f5ac2da976 | |||
| 534883ca1f | |||
| ad540da0c0 | |||
| bb66f3c8f0 | |||
| 13aa69700a | |||
| d919110d58 | |||
| fcd978b615 | |||
| 4b26c692ee | |||
| f3948dfd71 | |||
| b9e890137c | |||
| a871da1b85 | |||
| 8f55eea7cf | |||
| 52c1d12029 | |||
| ae589ac886 | |||
| 6ef89ddbff | |||
| 90dcd1bd25 | |||
| 0ead001f80 | |||
| f58d8218c2 | |||
| 3ec8a1a65b | |||
| 160ff76d6e | |||
| 51f62ea575 | |||
| 3c88f42924 | |||
| 40d705acb5 | |||
| ee88a3170b | |||
| c05da6de97 | |||
| 423044f496 | |||
| 5d93fda813 | |||
| 63d1af1337 | |||
| bceb9a372e | |||
| 1d8d85812a | |||
| 8bca1166df | |||
| e38521e9c7 | |||
| 0bb9ed9eda |
@@ -1,7 +1,7 @@
|
||||
SCREEN=`cat /sys/class/graphics/fb0/modes`
|
||||
|
||||
XORG_CONF="~/launcher/.xorg.conf"
|
||||
if [ -f ~/.lima ]
|
||||
if [ -f /home/cpi/.lima ]
|
||||
then
|
||||
XORG_CONF="~/launcher/.xorg_lima.conf"
|
||||
fi
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "Pcsx"]
|
||||
path = Menu/GameShell/20_Retro Games/Pcsx
|
||||
url = https://github.com/cuu/Pcsx.git
|
||||
@@ -1,7 +1,7 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
love MANUAL.love gameshell
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
love OPERATION.love gameshell
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
love MAIL.love gameshell
|
||||
@@ -1,7 +0,0 @@
|
||||
ROM=/home/cpi/games/MAME
|
||||
ROM_SO=/home/cpi/apps/emulators/mame2003_plus_libretro.so
|
||||
EXT=zip
|
||||
LAUNCHER=retroarch -L
|
||||
TITLE=MAME Roms
|
||||
EXCLUDE=neogeo.zip
|
||||
SO_URL=https://raw.githubusercontent.com/cuu/emulators/master/mame2003_plus_libretro.so.zip
|
||||
@@ -1,6 +0,0 @@
|
||||
ROM=/home/cpi/games/MGBA
|
||||
ROM_SO=/home/cpi/apps/emulators/mgba_libretro.so
|
||||
EXT=gb,gbc,gba,gbx
|
||||
LAUNCHER=retroarch -L
|
||||
TITLE=MGBA Roms
|
||||
SO_URL=https://raw.githubusercontent.com/cuu/emulators/master/mgba_libretro.so.zip
|
||||
@@ -1,7 +0,0 @@
|
||||
ROM=/home/cpi/games/NESTOPIA
|
||||
ROM_SO=/home/cpi/apps/emulators/nestopia_libretro.so
|
||||
EXT=zip,nes
|
||||
LAUNCHER=retroarch -L
|
||||
TITLE=NESTOPIA Roms
|
||||
SO_URL=https://raw.githubusercontent.com/cuu/emulators/master/nestopia_libretro.so.zip
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
retroarch
|
||||
@@ -1 +0,0 @@
|
||||
retroarch -L /home/cpi/apps/emulators/nxengine_libretro.so /home/cpi/games/nxengine/cavestory/data
|
||||
@@ -1 +0,0 @@
|
||||
chocolate-doom -iwad /home/cpi/games/FreeDM/freedoom1.wad
|
||||
@@ -163,22 +163,22 @@ class MPDSpectrumPage(Page):
|
||||
|
||||
self._song_title = Label()
|
||||
self._song_title.SetCanvasHWND(self._RollCanvas)
|
||||
self._song_title.Init("Untitled",self._SongFont,MySkinManager.GiveColor('White'))
|
||||
self._song_title.Init("Untitled",self._SongFont,MySkinManager.GiveColor('Text'))
|
||||
|
||||
|
||||
self._title = Label()
|
||||
self._title.SetCanvasHWND(self._CanvasHWND)
|
||||
self._title.Init("Title:",self._ListFont,MySkinManager.GiveColor('White'))
|
||||
self._title.Init("Title:",self._ListFont,MySkinManager.GiveColor('Text'))
|
||||
|
||||
self._time = Label()
|
||||
self._time.SetCanvasHWND(self._CanvasHWND)
|
||||
self._time.Init("Time:",self._ListFont,MySkinManager.GiveColor('White'))
|
||||
self._time.Init("Time:",self._ListFont,MySkinManager.GiveColor('Text'))
|
||||
|
||||
|
||||
self._time2 = Label()
|
||||
self._time2.SetCanvasHWND(self._CanvasHWND)
|
||||
self._time2.Init("00:00-00:00", self._ListFont,
|
||||
MySkinManager.GiveColor('White'))
|
||||
MySkinManager.GiveColor('Text'))
|
||||
|
||||
|
||||
self.Start()
|
||||
@@ -336,7 +336,7 @@ class MPDSpectrumPage(Page):
|
||||
|
||||
if self._RollCanvas != None:
|
||||
# self._RollCanvas.fill((111,22,33))
|
||||
self._RollCanvas.fill(MySkinManager.GiveColor('Black'))
|
||||
self._RollCanvas.fill(MySkinManager.GiveColor('White'))
|
||||
if self._song_title._Width > self._RollW:
|
||||
if (self._song_title._PosX + self._song_title._Width) > self._RollW and self._frames % 30 == 0:
|
||||
self._song_title._PosX -= 1
|
||||
@@ -410,9 +410,9 @@ class MPDSpectrumPage(Page):
|
||||
else:
|
||||
self._capYPositionArray[i] = value
|
||||
|
||||
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,MySkinManager.GiveColor('Text'),(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-value-gap-margin_bottom,bw,value+gap),0)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),(i*(bw+gap)+margin_left,self._Height-value-gap-margin_bottom,bw,value+gap),0)
|
||||
|
||||
self._vis_values[i] -= 2
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import os
|
||||
import pygame
|
||||
|
||||
from libs.roundrects import aa_round_rect
|
||||
#from libs.roundrects import aa_round_rect
|
||||
|
||||
## local UI import
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
@@ -49,7 +49,7 @@ class MusicLibStack:
|
||||
return len(self.stack)
|
||||
|
||||
class ListPageSelector(PageSelector):
|
||||
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||
_BackgroundColor = MySkinManager.GiveColor('Line')
|
||||
|
||||
def __init__(self):
|
||||
self._PosX = 0
|
||||
@@ -72,9 +72,9 @@ class ListPageSelector(PageSelector):
|
||||
self._PosY = y
|
||||
self._Height = h
|
||||
|
||||
aa_round_rect(self._Parent._CanvasHWND,
|
||||
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
|
||||
#aa_round_rect(self._Parent._CanvasHWND,
|
||||
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width-4,h),0)
|
||||
|
||||
|
||||
class MusicLibListPage(Page):
|
||||
@@ -184,8 +184,8 @@ class MusicLibListPage(Page):
|
||||
self._BGpng._ImgSurf = MyIconPool._Icons["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"))
|
||||
self._BGpng.SetLableColor(MySkinManager.GiveColor('Disabled'))
|
||||
self._BGpng.AddLabel(MyLangManager.Tr("Please upload data over Wi-Fi"), MyLangManager.TrFont("varela18"))
|
||||
self._BGpng.SetLableColor(MySkinManager.GiveColor('Text'))
|
||||
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import os
|
||||
import pygame
|
||||
import gobject
|
||||
|
||||
from libs.roundrects import aa_round_rect
|
||||
#from libs.roundrects import aa_round_rect
|
||||
|
||||
## local UI import
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
@@ -23,7 +23,7 @@ from list_item import ListItem
|
||||
import myvars
|
||||
|
||||
class ListPageSelector(PageSelector):
|
||||
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||
_BackgroundColor = MySkinManager.GiveColor('Line')
|
||||
|
||||
def __init__(self):
|
||||
self._PosX = 0
|
||||
@@ -51,9 +51,9 @@ class ListPageSelector(PageSelector):
|
||||
self._PosY = y
|
||||
self._Height = h
|
||||
|
||||
aa_round_rect(self._Parent._CanvasHWND,
|
||||
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
|
||||
#aa_round_rect(self._Parent._CanvasHWND,
|
||||
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width-4,h),0)
|
||||
|
||||
|
||||
class PlayListPage(Page):
|
||||
@@ -184,7 +184,7 @@ class PlayListPage(Page):
|
||||
self._BGpng._MyType = ICON_TYPES["STAT"]
|
||||
self._BGpng._Parent = self
|
||||
self._BGpng.AddLabel(MyLangManager.Tr("my favorite music"), MyLangManager.TrFont("varela18"))
|
||||
self._BGpng.SetLableColor(MySkinManager.GiveColor('Disabled'))
|
||||
self._BGpng.SetLableColor(MySkinManager.GiveColor('Text'))
|
||||
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||
|
||||
self._Scroller = ListScroller()
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#SDL_VIDEODRIVER=x11 DISPLAY=:0 ./pico-8/pico8_dyn -splore -draw_rect 32,0,256,240
|
||||
cd /home/cpi/games/PICO-8/pico-8
|
||||
SDL_VIDEODRIVER=x11 DISPLAY=:0 ./pico8_dyn -splore -draw_rect 32,0,256,240
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir ~/.lexaloffle
|
||||
|
||||
cp -rf pico-8 ~/.lexaloffle
|
||||
|
||||
touch .done
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"GameDir":"/home/cpi/games/PICO-8/",
|
||||
"InstallDir":"pico-8",
|
||||
"NotFoundMsg":["Please purchase the PICO-8 \n|None|varela16",
|
||||
"and copy it to the \"~/games/PICO-8\"|None|varela16"],
|
||||
|
||||
"MD5":{"pico-8_0.1.11g_raspi.zip":"a3f2995cf117499f880bd964d6a0e1f2","pico-8_0.1.11g_amd64.zip":"6726141c784afd4a41be6b7414c1b932","pico-8_0.1.12_raspi.zip":"08eda95570e63089a2b9f5531503431e","pico-8_0.1.12c_raspi.zip":"1a62b0d7d4e4be65f89f23ec9757cb66"},
|
||||
"Post-Up":"bash Post-Up.sh"
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
// Configuration for pico-8
|
||||
//
|
||||
// config.txt is read on startup and saved on exit.
|
||||
// To generate the default config.txt, delete this file.
|
||||
//
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
// :: Video Settings
|
||||
|
||||
window_size 0 0 // window width, height
|
||||
screen_size 0 0 // screen width, height (stretched to window)
|
||||
show_fps 0 // Draw frames per second in the corner
|
||||
|
||||
|
||||
// :: Window Settings
|
||||
|
||||
windowed 0 // 1 to start up in windowed mode
|
||||
window_position -1 -1 // x and y position of window, or -1, -1 to let the window manager decide
|
||||
frameless 0 // 1 to use a window with no frame
|
||||
fullscreen_method 0 // 0 maximized window (linux) 1 borderless desktop-sized window 2 fullscreen
|
||||
|
||||
|
||||
// :: System Settings
|
||||
|
||||
foreground_sleep_ms 1 // number of milliseconds to sleep each frame. Try 10 to conserve battery power
|
||||
|
||||
background_sleep_ms 20 // number of milliseconds to sleep each frame when running in the background
|
||||
|
||||
sessions 4 // number of times program has been run
|
||||
|
||||
// (scancode) hold this key down and left-click to simulate right-click
|
||||
rmb_key 0 // 0 for none 226 for LALT
|
||||
|
||||
// 0:off 1: ignore SDL_TEXTINPUT and use SDL_GetKeyboardState instead (mapped to a US layout)
|
||||
emulate_textinput 1
|
||||
|
||||
// Desktop for saving screenshots etc. Defaults to $HOME/Desktop
|
||||
desktop_path
|
||||
|
||||
|
||||
|
||||
// :: Audio Settings
|
||||
|
||||
sound_volume 256 // 0..256
|
||||
music_volume 256 // 0..256
|
||||
mix_buffer_size 1024 // usually 1024. Try 2048 if you get choppy sound
|
||||
|
||||
|
||||
// ::
|
||||
|
||||
version 0.1.11g
|
||||
|
||||
|
||||
// Location of pico-8's root folder
|
||||
root_path /home/cpi/.lexaloffle/pico-8/carts/
|
||||
|
||||
|
||||
// Location of cartridge save data
|
||||
cdata_path /home/cpi/.lexaloffle/pico-8/cdata/
|
||||
|
||||
|
||||
// Specify which player index joystick control begins at (0..7)
|
||||
joystick_index 0
|
||||
|
||||
|
||||
// Custom keyboard scancodes for buttons. player0 0..6, player1 0..5
|
||||
button_keys 0 0 0 0 13 14 0 0 0 0 0 0 0
|
||||
|
||||
// Play notes as they are plotted in frequency mode
|
||||
live_notes 0
|
||||
|
||||
// iff 1: when using keyboard cursor, snap to closest pixel / map cel
|
||||
cursor_snap 0
|
||||
|
||||
// maximum length of gif in seconds (1..120, default 8)
|
||||
gif_len 8
|
||||
|
||||
// 0 classic 1 dark blue background in code editor
|
||||
gui_theme 0
|
||||
|
||||
// scale of screenshots and gifs // 2 means 256x256
|
||||
screenshot_scale 3
|
||||
gif_scale 2
|
||||
|
||||
// when 1 can enter glyphs using shift-A..Z
|
||||
shift_glyphs 1
|
||||
|
||||
// 0 for off. 1 to notify whenever unsaved changes are backed up
|
||||
show_backup_messages 1
|
||||
|
||||
// 0 for off. 1 to allow control of a cart's framerate due to host machine's cpu capacity (recommended)
|
||||
host_framerate_control 1
|
||||
|
||||
// filter splore content
|
||||
// 0 for no filter (18+) 1 medium (13+) 2 maximum (kid-friendly)
|
||||
content_filter 1
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
codo_init
|
||||
platform: Linux
|
||||
Found config.txt
|
||||
|
||||
01 window_size 0 0 // window width, height
|
||||
02 screen_size 0 0 // screen width, height (stretched to window)
|
||||
03 show_fps 0 // Draw frames per second in the corner
|
||||
04 windowed 0 // 1 to start up in windowed mode
|
||||
05 window_position -1 -1 // x and y position of window, or -1, -1 to let the window manager decide
|
||||
new window position: -1, -1
|
||||
06 frameless 0 // 1 to use a window with no frame
|
||||
07 fullscreen_method 1 // 0 maximized window (linux) 1 borderless desktop-sized window 2 fullscreen
|
||||
08 foreground_sleep_ms 1 // number of milliseconds to sleep each frame. Try 10 to conserve battery power
|
||||
09 background_sleep_ms 20 // number of milliseconds to sleep each frame when running in the background
|
||||
10 sessions 3 // number of times program has been run
|
||||
11 rmb_key 0 // 0 for none 226 for LALT
|
||||
12 emulate_textinput 1
|
||||
13 desktop_path
|
||||
14 sound_volume 256 // 0..256
|
||||
15 music_volume 256 // 0..256
|
||||
16 mix_buffer_size 1024 // usually 1024. Try 2048 if you get choppy sound
|
||||
17 version 0.1.11g
|
||||
18 root_path /home/cpi/.lexaloffle/pico-8/carts/
|
||||
19 cdata_path /home/cpi/.lexaloffle/pico-8/cdata/
|
||||
20 joystick_index 0
|
||||
21 button_keys 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
22 live_notes 0
|
||||
23 cursor_snap 0
|
||||
24 gif_len 8
|
||||
25 gui_theme 0
|
||||
26 screenshot_scale 3
|
||||
27 gif_scale 2
|
||||
28 shift_glyphs 1
|
||||
29 show_backup_messages 1
|
||||
30 host_framerate_control 1
|
||||
31 content_filter 1
|
||||
|
||||
codo_system_init
|
||||
Compiled against SDL version: 2.0.7
|
||||
Linked against SDL version: 2.0.5
|
||||
Built-in video drivers: 0 x11 1 wayland 2 dummy
|
||||
Current video driver: x11
|
||||
Built-in render drivers:
|
||||
Renderer opengl:
|
||||
Flags: 0x0000000E ( | | )
|
||||
Texture formats (1): ARGB8888
|
||||
Renderer opengles2:
|
||||
Flags: 0x0000000E ( | | )
|
||||
Texture formats (4): ARGB8888, ABGR8888, RGB888, BGR888
|
||||
Renderer software:
|
||||
Flags: 0x00000009 ( | )
|
||||
Texture formats (8): ARGB8888, ABGR8888, RGBA8888, BGRA8888, RGB888, BGR888, RGB565, RGB555
|
||||
codo_reset_timer
|
||||
codo_gui_init
|
||||
codo_keys_init
|
||||
codo_text_init
|
||||
codo_video_init
|
||||
codo_mouse_init
|
||||
codo_joystick_init
|
||||
Reading controller mappings: /home/cpi/.lexaloffle/pico-8/sdl_controllers.txt
|
||||
searching for joysticks
|
||||
found 0 joysticks
|
||||
ok
|
||||
ok
|
||||
codo_load_pod: /home/cpi/apps/Menu/50_PICO-8/pico8.dat ok
|
||||
codo_set_screen 128 128 8 100
|
||||
set pixel_perfect 1
|
||||
window size: 640 480
|
||||
codo_plat_pi: forcing fullscreen mode
|
||||
Current renderer:
|
||||
Renderer opengl:
|
||||
Flags: 0x0000000A ( | )
|
||||
Texture formats (5): ARGB8888, YV12, IYUV, 0x3231564e, 0x3132564e
|
||||
Max Texture Size: 8192x8192
|
||||
codo_sound_init mix_buffer_size: 1024
|
||||
codo_sound_init
|
||||
SDL_INIT_AUDIO ok
|
||||
SDL_OpenAudio ok
|
||||
Built-in audio drivers: 0 pulseaudio 1 alsa 2 sndio 3 dsp 4 disk 5 dummy
|
||||
Current audio driver: alsa
|
||||
codo_exit
|
||||
cmusic_stop
|
||||
codo_main_exit
|
||||
codo_config_save
|
||||
codo_sound_exit
|
||||
codo_video_exit
|
||||
codo_joystick_exit
|
||||
codo_system_exit
|
||||
codo_items_created: 1023
|
||||
ok
|
||||
@@ -1 +0,0 @@
|
||||
// add SDL2 game controller mappings to this file
|
||||
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import pygame
|
||||
import validators
|
||||
import commands
|
||||
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.simple_name_space import SimpleNamespace
|
||||
@@ -18,8 +19,9 @@ class TinyCloudPage(Page):
|
||||
_FootMsg = ["Nav","","","Back",""]
|
||||
_MyList = []
|
||||
|
||||
_ListFontObj = MyLangManager.TrFont("varela13")
|
||||
|
||||
_ListFontObj = MyLangManager.TrFont("veramono13")
|
||||
_ListLabelFontObj = MyLangManager.TrFont("varela13")
|
||||
|
||||
_AList = {}
|
||||
_Labels = {}
|
||||
|
||||
@@ -116,18 +118,26 @@ class TinyCloudPage(Page):
|
||||
else:
|
||||
self._IP = "xxx.xxx.xxx.xxx"
|
||||
|
||||
hostname = commands.getstatusoutput("hostname")[1]
|
||||
if hostname == "":
|
||||
hostname = "clockworkpi"
|
||||
|
||||
labels = \
|
||||
[["forssh","For ssh and scp:",self._ListFontObj,self._TextColor],
|
||||
[["forssh","For ssh and scp:",self._ListLabelFontObj,self._TextColor],
|
||||
["ssh_addr","ssh cpi@%s" % self._IP, self._ListFontObj,self._URLColor],
|
||||
["forwin", "For Windows network:", self._ListFontObj, self._TextColor],
|
||||
|
||||
["forwin", "For Windows network:", self._ListLabelFontObj, self._TextColor],
|
||||
["samba_games", "\\\\%s\games" % self._IP, self._ListFontObj,self._URLColor],
|
||||
["samba_music", "\\\\%s\music" % self._IP, self._ListFontObj,self._URLColor],
|
||||
["forID", "ID:", self._ListFontObj, self._TextColor],
|
||||
["forKey", "Key:", self._ListFontObj, self._TextColor],
|
||||
|
||||
["forID", "ID:", self._ListLabelFontObj, self._TextColor],
|
||||
["forKey", "Key:", self._ListLabelFontObj, self._TextColor],
|
||||
["key_and_pass", "cpi", self._ListFontObj, self._URLColor],
|
||||
["for_airplay", "Airplay:", self._ListFontObj, self._TextColor],
|
||||
["airplay_name","clockworkpi", self._ListFontObj, self._URLColor],
|
||||
["for-usb-eth","USB-Ethernet:", self._ListFontObj, self._TextColor],
|
||||
|
||||
["for_airplay", "Airplay:", self._ListLabelFontObj, self._TextColor],
|
||||
["airplay_name",hostname, self._ListFontObj, self._URLColor],
|
||||
|
||||
["for-usb-eth","USB-Ethernet:", self._ListLabelFontObj, self._TextColor],
|
||||
["usb-eth-addr","192.168.10.1", self._ListFontObj, self._URLColor]]
|
||||
|
||||
for i in labels:
|
||||
@@ -152,7 +162,7 @@ class TinyCloudPage(Page):
|
||||
self._Height = self._Screen._Height
|
||||
|
||||
self._PngSize["bg"] = (253,114)
|
||||
self._PngSize["online"] = (75,122)
|
||||
#self._PngSize["online"] = (75,122)
|
||||
|
||||
bgpng = IconItem()
|
||||
bgpng._ImgSurf = MyIconPool._Icons["needwifi_bg"]
|
||||
@@ -162,6 +172,7 @@ class TinyCloudPage(Page):
|
||||
|
||||
self._Icons["bg"] = bgpng
|
||||
|
||||
"""
|
||||
onlinepng = IconItem()
|
||||
onlinepng._ImgSurf = MyIconPool._Icons["online"]
|
||||
onlinepng._MyType = ICON_TYPES["STAT"]
|
||||
@@ -169,7 +180,7 @@ class TinyCloudPage(Page):
|
||||
onlinepng.Adjust(0,0,self._PngSize["online"][0], self._PngSize["online"][1],0)
|
||||
|
||||
self._Icons["online"] = onlinepng
|
||||
|
||||
"""
|
||||
self.SetLabels()
|
||||
|
||||
def KeyDown(self,event):
|
||||
@@ -184,8 +195,8 @@ class TinyCloudPage(Page):
|
||||
|
||||
if is_wifi_connected_now():
|
||||
|
||||
self._Icons["online"].NewCoord(self._Coords["online"].x, self._Coords["online"].y)
|
||||
self._Icons["online"].Draw()
|
||||
#self._Icons["online"].NewCoord(self._Coords["online"].x, self._Coords["online"].y)
|
||||
#self._Icons["online"].Draw()
|
||||
|
||||
self.SetLabels()
|
||||
|
||||
@@ -224,7 +235,7 @@ class APIOBJ(object):
|
||||
def Init(self,main_screen):
|
||||
self._Page = TinyCloudPage()
|
||||
self._Page._Screen = main_screen
|
||||
self._Page._Name ="Tiny cloud"
|
||||
self._Page._Name ="CONNECT"
|
||||
self._Page.Init()
|
||||
|
||||
def API(self,main_screen):
|
||||
@@ -12,15 +12,17 @@ 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
|
||||
from UI.icon_item import IconItem
|
||||
from UI.multi_icon_item import MultiIconItem
|
||||
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
|
||||
@@ -239,7 +266,7 @@ class AboutPage(Page):
|
||||
|
||||
li.SetSmallText( self._AList[u]["value"] )
|
||||
|
||||
last_height += li._Height
|
||||
last_height += li._Height+2 ## fix offset for long line text covered on the right background png
|
||||
|
||||
self._MyList.append(li)
|
||||
|
||||
@@ -247,14 +274,14 @@ class AboutPage(Page):
|
||||
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._CanvasHWND = pygame.Surface( (self._Screen._Width,self._BGheight+50) )
|
||||
|
||||
self._PosX = self._Index*self._Screen._Width
|
||||
self._Width = self._Screen._Width ## equal to screen width
|
||||
self._Height = self._Screen._Height
|
||||
|
||||
bgpng = IconItem()
|
||||
bgpng._ImgSurf = MyIconPool._Icons["about_bg"]
|
||||
bgpng = MultiIconItem()
|
||||
bgpng._ImgSurf = MyIconPool.GiveIconSurface("about_bg")
|
||||
bgpng._MyType = ICON_TYPES["STAT"]
|
||||
bgpng._Parent = self
|
||||
bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||
@@ -266,6 +293,9 @@ class AboutPage(Page):
|
||||
self.CpuMhz()
|
||||
self.Uname()
|
||||
|
||||
self.LauncherVersion()
|
||||
self.OsImageVersion()
|
||||
|
||||
self.GenList()
|
||||
|
||||
self._Scroller = ListScroller()
|
||||
@@ -277,7 +307,7 @@ class AboutPage(Page):
|
||||
|
||||
def ScrollDown(self):
|
||||
dis = 10
|
||||
if abs(self._Scrolled) < (self._BGheight - self._Height)/2 + 50:
|
||||
if abs(self._Scrolled) < (self._BGheight - self._Height)/2 + 100:
|
||||
self._PosY -= dis
|
||||
self._Scrolled -= dis
|
||||
|
||||
@@ -320,16 +350,19 @@ class AboutPage(Page):
|
||||
self.ClearCanvas()
|
||||
#self._Ps.Draw()
|
||||
|
||||
self._Icons["bg"].NewCoord(self._Width/2,self._Height/2 + (self._BGheight - Height)/2 + self._Screen._TitleBar._Height)
|
||||
self._Icons["bg"].Draw()
|
||||
|
||||
for i in self._MyList:
|
||||
i.Draw()
|
||||
|
||||
self._DrawOnce = True
|
||||
|
||||
self._Icons["bg"].DrawRect((230,0,82,184),(228,0,82,184))
|
||||
|
||||
y = self._MyList[len(self._MyList)-1]._PosY+30
|
||||
|
||||
self._Icons["bg"].DrawRect(( (self._Width-191)/2,y,191,68),(65,232,191,68))
|
||||
|
||||
if self._HWND != None:
|
||||
self._HWND.fill((255,255,255))
|
||||
self._HWND.fill(MySkinManager.GiveColor("White"))
|
||||
|
||||
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )
|
||||
|
||||
@@ -19,7 +19,7 @@ from UI.icon_pool import MyIconPool
|
||||
from UI.icon_item import IconItem
|
||||
from UI.multi_icon_item import MultiIconItem
|
||||
from UI.lang_manager import MyLangManager
|
||||
|
||||
from UI.skin_manager import MySkinManager
|
||||
from UI.multilabel import MultiLabel
|
||||
|
||||
class AirplanePage(Page):
|
||||
@@ -63,7 +63,7 @@ class AirplanePage(Page):
|
||||
self._Height = self._Screen._Height
|
||||
|
||||
|
||||
|
||||
"""
|
||||
airwire = IconItem()
|
||||
airwire._ImgSurf = MyIconPool._Icons["airwire"]
|
||||
airwire._MyType = ICON_TYPES["STAT"]
|
||||
@@ -77,14 +77,15 @@ class AirplanePage(Page):
|
||||
GS._Parent = self
|
||||
GS.Adjust(0,0,72,95,0)
|
||||
self._Icons["GS"] = GS
|
||||
"""
|
||||
|
||||
DialogBoxs = MultiIconItem()
|
||||
DialogBoxs._ImgSurf = MyIconPool._Icons["DialogBoxs"]
|
||||
DialogBoxs._MyType = ICON_TYPES["STAT"]
|
||||
DialogBoxs._Parent = self
|
||||
DialogBoxs._IconWidth = 134
|
||||
DialogBoxs._IconHeight = 93
|
||||
DialogBoxs.Adjust(0,0,134,372,0)
|
||||
DialogBoxs._IconWidth = 180
|
||||
DialogBoxs._IconHeight = 80
|
||||
DialogBoxs.Adjust(0,0,180,320,0)
|
||||
self._Icons["DialogBoxs"] = DialogBoxs
|
||||
|
||||
|
||||
@@ -231,19 +232,24 @@ class AirplanePage(Page):
|
||||
def Draw(self):
|
||||
self.ClearCanvas()
|
||||
|
||||
self._Icons["DialogBoxs"].NewCoord(145,23)
|
||||
self._Icons["airwire"].NewCoord(80,self._airwire_y)
|
||||
self._Icons["DialogBoxs"].NewCoord(70,58)
|
||||
#self._Icons["airwire"].NewCoord(80,self._airwire_y)
|
||||
|
||||
self._Icons["DialogBoxs"]._IconIndex = self._dialog_index
|
||||
|
||||
self._Icons["DialogBoxs"].DrawTopLeft()
|
||||
self._Icons["airwire"].Draw()
|
||||
#self._Icons["airwire"].Draw()
|
||||
|
||||
self._Icons["GS"].NewCoord(98,118)
|
||||
self._Icons["GS"].Draw()
|
||||
#self._Icons["GS"].NewCoord(98,118)
|
||||
#self._Icons["GS"].Draw()
|
||||
|
||||
self.DrawCross(10,10)
|
||||
self.DrawCross(self._Screen._Width-20,10)
|
||||
self.DrawCross(10,self._Screen._Height-20)
|
||||
self.DrawCross(self._Screen._Width-20,self._Screen._Height-20)
|
||||
|
||||
if self._HWND != None:
|
||||
self._HWND.fill((255,255,255))
|
||||
self._HWND.fill(MySkinManager.GiveColor("White"))
|
||||
|
||||
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )
|
||||
|
||||
@@ -71,7 +71,7 @@ class BleForgetConfirmPage(ConfirmPage):
|
||||
|
||||
|
||||
class BleInfoPageSelector(PageSelector):
|
||||
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||
_BackgroundColor = MySkinManager.GiveColor('Line')
|
||||
|
||||
def __init__(self):
|
||||
self._PosX = 0
|
||||
@@ -92,8 +92,9 @@ class BleInfoPageSelector(PageSelector):
|
||||
self._PosY = y
|
||||
self._Height = h
|
||||
|
||||
aa_round_rect(self._Parent._CanvasHWND,
|
||||
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
#aa_round_rect(self._Parent._CanvasHWND,
|
||||
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width-4,h),0)
|
||||
|
||||
class BleInfoPage(Page):
|
||||
_FootMsg = ["Nav","Forget","Disconnect","Back",""]
|
||||
@@ -315,7 +316,7 @@ class BleInfoPage(Page):
|
||||
|
||||
|
||||
class BleListSelector(PageSelector):
|
||||
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||
_BackgroundColor = MySkinManager.GiveColor('Line')
|
||||
|
||||
def __init__(self):
|
||||
self._PosX = 0
|
||||
@@ -336,8 +337,9 @@ class BleListSelector(PageSelector):
|
||||
self._PosY = y
|
||||
self._Height = h
|
||||
|
||||
aa_round_rect(self._Parent._CanvasHWND,
|
||||
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
#aa_round_rect(self._Parent._CanvasHWND,
|
||||
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor, (x,y,self._Width-4,h),0 )
|
||||
|
||||
class BleListMessageBox(Label):
|
||||
_Parent = None
|
||||
@@ -351,7 +353,7 @@ class BleListMessageBox(Label):
|
||||
padding = 10
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),(x-padding,y-padding, w+padding*2,h+padding*2))
|
||||
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Black'),(x-padding,y-padding, w+padding*2,h+padding*2),1)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),(x-padding,y-padding, w+padding*2,h+padding*2),1)
|
||||
|
||||
self._CanvasHWND.blit(my_text,(x,y,w,h))
|
||||
|
||||
@@ -15,19 +15,18 @@ from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||
from UI.slider import Slider
|
||||
from UI.icon_pool import MyIconPool
|
||||
from UI.multi_icon_item import MultiIconItem
|
||||
from UI.skin_manager import MySkinManager
|
||||
|
||||
|
||||
from config import BackLight
|
||||
|
||||
|
||||
import myvars
|
||||
|
||||
class BSlider(Slider):
|
||||
|
||||
|
||||
OnChangeCB = None
|
||||
_BGpng = None
|
||||
_BGwidth = 179
|
||||
_BGheight = 153
|
||||
|
||||
_NeedleSurf = None
|
||||
_Scale = None
|
||||
_Parent = None
|
||||
_Icons = {}
|
||||
|
||||
@@ -38,22 +37,11 @@ class BSlider(Slider):
|
||||
self._Width = self._Parent._Width
|
||||
self._Height = self._Parent._Height
|
||||
|
||||
bgpng = IconItem()
|
||||
bgpng._ImgSurf = MyIconPool._Icons["light"]
|
||||
bgpng._MyType = ICON_TYPES["STAT"]
|
||||
bgpng._Parent = self
|
||||
bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||
self._Icons["bg"] = bgpng
|
||||
##self._NeedleSurf = pygame.Surface( (38,12),pygame.SRCALPHA )
|
||||
self._BrightnessLabel = Label()
|
||||
self._BrightnessLabel.SetCanvasHWND(self._CanvasHWND)
|
||||
self._BrightnessLabel.Init("BRIGHT",MySkinManager.GiveFont("EurostileBold13"))
|
||||
self._BrightnessLabel.SetColor(MySkinManager.GiveColor('Text'))
|
||||
|
||||
scale = MultiIconItem()
|
||||
scale._MyType = ICON_TYPES["STAT"]
|
||||
scale._Parent = self
|
||||
scale._ImgSurf = MyIconPool._Icons["scale"]
|
||||
scale._IconWidth = 82
|
||||
scale._IconHeight = 63
|
||||
scale.Adjust(0,0,82,63,0)
|
||||
self._Icons["scale"] = scale
|
||||
|
||||
def SetValue(self,brt):
|
||||
self._Value = brt
|
||||
@@ -78,27 +66,40 @@ class BSlider(Slider):
|
||||
self.OnChangeCB(self._Value)
|
||||
|
||||
def Draw(self):
|
||||
start_x = 82
|
||||
start_y = self._Parent._Screen._Height/2-5
|
||||
height = 30
|
||||
width = 4
|
||||
padding = 15
|
||||
seg = self._Value-1
|
||||
|
||||
self._Icons["bg"].NewCoord(self._Width/2,self._Height/2 +11 )
|
||||
self._Icons["bg"].Draw()
|
||||
for i in range(0,9):
|
||||
rect = pygame.Rect(start_x+i*(width+padding),start_y,width,height)
|
||||
if i > seg:
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect, 1)
|
||||
#aa_round_rect(self._CanvasHWND,rect, MySkinManager.GiveColor('Text'),1,1, MySkinManager.GiveColor('White'))
|
||||
else:
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect, 0)
|
||||
#aa_round_rect(self._CanvasHWND,rect, MySkinManager.GiveColor('Text'),1,0, MySkinManager.GiveColor('White'))
|
||||
|
||||
self._BrightnessLabel.NewCoord(118,self._Parent._Screen._Height/2-30)
|
||||
self._BrightnessLabel.Draw(True)
|
||||
|
||||
minus_box_rect = pygame.Rect(start_x- (4+6)*4,start_y,6*4,30)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),minus_box_rect, 0)
|
||||
|
||||
minus_rect = pygame.Rect(start_x-8*4,start_y+14,2*4,2)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),minus_rect, 0)
|
||||
|
||||
plus_box_rect = pygame.Rect(start_x + 39*4 +4*4,start_y,6*4,30)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),plus_box_rect, 0)
|
||||
|
||||
cross1_rect = pygame.Rect(start_x+39*4+4*4+2*4,start_y+14,2*4,2)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),cross1_rect, 0)
|
||||
cross2_rect = pygame.Rect(start_x+39*4+4*4+2*4+3,start_y+14-3,2,2*4)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),cross2_rect, 0)
|
||||
|
||||
self._Icons["scale"].NewCoord(self._Width/2,self._Height/2 )
|
||||
|
||||
icon_idx = self._Value - 1
|
||||
if icon_idx < 0:
|
||||
icon_idx = 0
|
||||
|
||||
self._Icons["scale"]._IconIndex = icon_idx
|
||||
self._Icons["scale"].Draw()
|
||||
"""
|
||||
pygame.draw.line(self._CanvasHWND,(255,0,0), (posx,self._PosY),(self._Width,self._PosY),3) ## range line
|
||||
pygame.draw.line(self._CanvasHWND,(0,0,255), (self._PosX,self._PosY),(posx,self._PosY),3) ## range line
|
||||
|
||||
pygame.draw.circle(self._CanvasHWND,(255,255,255),( posx, self._PosY),7,0)
|
||||
pygame.draw.circle(self._CanvasHWND,(0,0,0) ,( posx, self._PosY),7,1)## outer border
|
||||
"""
|
||||
|
||||
|
||||
|
||||
class BrightnessPage(Page):
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import platform
|
||||
import pygame
|
||||
import glob
|
||||
#import math
|
||||
import commands
|
||||
|
||||
#from beeprint import pp
|
||||
from libs.roundrects import aa_round_rect
|
||||
#import gobject
|
||||
#from wicd import misc
|
||||
## local UI import
|
||||
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,FileExists,IsExecutable,ArmSystem,CmdClean
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
from UI.icon_pool import MyIconPool
|
||||
from UI.icon_item import IconItem
|
||||
from UI.confirm_page import ConfirmPage
|
||||
from UI.multi_icon_item import MultiIconItem
|
||||
from UI.lang_manager import MyLangManager
|
||||
from UI.multilabel import MultiLabel
|
||||
from UI.info_page_list_item import InfoPageListItem
|
||||
from UI.info_page_selector import InfoPageSelector
|
||||
from UI.skin_manager import MySkinManager
|
||||
|
||||
|
||||
class DeleteCoreConfirmPage(ConfirmPage):
|
||||
|
||||
_ConfirmText = MyLangManager.Tr("Awaiting Input")
|
||||
_FootMsg = ["Nav","","","Cancel","OK"]
|
||||
CallbackA = None
|
||||
|
||||
def KeyDown(self,event):
|
||||
|
||||
if IsKeyMenuOrB(event.key):
|
||||
self.ReturnToUpLevelPage()
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if IsKeyStartOrA(event.key):
|
||||
self._Screen._MsgBox.SetText("Applying")
|
||||
self._Screen._MsgBox.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
pygame.time.delay(638)
|
||||
|
||||
self.CallbackA()
|
||||
|
||||
self.ReturnToUpLevelPage()
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
class CoresPage(Page):
|
||||
_FootMsg = ["Nav","Del","Scan","Back",""]
|
||||
_MyList = []
|
||||
_ListFontObj = MyLangManager.TrFont("varela13")
|
||||
|
||||
_AList = {}
|
||||
|
||||
_Scrolled = 0
|
||||
|
||||
_BGwidth = 320
|
||||
_BGheight = 240-24-20
|
||||
|
||||
_DrawOnce = False
|
||||
_Scroller = None
|
||||
|
||||
_EasingDur = 30
|
||||
|
||||
_CORES_PATH = "%s/apps/emulators" % os.path.expanduser('~')
|
||||
|
||||
_Config =None
|
||||
_AllowedExts = [".so",".bin"]
|
||||
_HiddenSos = ["chailove_libretro.so","nxengine_libretro.so"]
|
||||
|
||||
def __init__(self):
|
||||
Page.__init__(self)
|
||||
self._Icons = {}
|
||||
|
||||
if "arm" in platform.machine():
|
||||
pass
|
||||
|
||||
def GenList(self):
|
||||
|
||||
self._MyList = []
|
||||
## map ini to self._AList
|
||||
files_path = glob.glob(self._CORES_PATH+"/*")
|
||||
|
||||
start_x = 10
|
||||
start_y = 0
|
||||
counter = 0
|
||||
for i,v in enumerate( files_path):
|
||||
if os.path.basename(v) in self._HiddenSos:
|
||||
continue
|
||||
|
||||
filename, file_extension = os.path.splitext(v)
|
||||
|
||||
alias_file = filename+file_extension + ".alias"
|
||||
|
||||
if file_extension in self._AllowedExts:
|
||||
li = InfoPageListItem()
|
||||
li._Parent = self
|
||||
li._PosX = start_x
|
||||
li._PosY = start_y + counter*InfoPageListItem._Height
|
||||
li._Width = Width-10
|
||||
li._Fonts["normal"] = self._ListFontObj
|
||||
li._Fonts["small"] = MySkinManager.GiveFont("varela12")
|
||||
li._ReadOnly = True
|
||||
|
||||
if os.path.isfile(alias_file):
|
||||
fp = open(alias_file, "r")
|
||||
alias = fp.read()
|
||||
alias = alias.strip()
|
||||
label_text = alias.decode("utf8")
|
||||
li.Init( label_text )
|
||||
fp.close()
|
||||
else:
|
||||
li.Init( os.path.basename(v) )
|
||||
li._Flag = v
|
||||
##li.SetSmallText( v )
|
||||
|
||||
self._MyList.append(li)
|
||||
counter += 1
|
||||
|
||||
def Init(self):
|
||||
if self._Screen != None:
|
||||
if self._Screen._CanvasHWND != None and self._CanvasHWND == None:
|
||||
self._CanvasHWND = self._Screen._CanvasHWND
|
||||
|
||||
self._PosX = self._Index*self._Screen._Width
|
||||
self._Width = self._Screen._Width ## equal to screen width
|
||||
self._Height = self._Screen._Height
|
||||
|
||||
ps = InfoPageSelector()
|
||||
ps._PosX = 11
|
||||
ps._Parent = self
|
||||
ps._Width = self._Width-10
|
||||
self._Ps = ps
|
||||
self._PsIndex = 0
|
||||
|
||||
self._Scroller = ListScroller()
|
||||
self._Scroller._Parent = self
|
||||
self._Scroller._PosX = 2
|
||||
self._Scroller._PosY = 2
|
||||
self._Scroller.Init()
|
||||
|
||||
self._ConfirmBox = DeleteCoreConfirmPage()
|
||||
self._ConfirmBox._Screen = self._Screen
|
||||
self._ConfirmBox._Name = "Confirm to Delete?"
|
||||
self._ConfirmBox._Parent = self
|
||||
self._ConfirmBox.Init()
|
||||
|
||||
def ReScan(self):
|
||||
self.GenList()
|
||||
self.RefreshPsIndex()
|
||||
|
||||
def ConfirmBoxCallbackA(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
|
||||
os.system("rm %s" % CmdClean(cur_li._Flag))
|
||||
self.GenList()
|
||||
self.RefreshPsIndex()
|
||||
|
||||
def OnLoadCb(self):
|
||||
self._Scrolled = 0
|
||||
self._PosY = 0
|
||||
self._DrawOnce = False
|
||||
self.GenList()
|
||||
|
||||
def OnReturnBackCb(self):
|
||||
pass
|
||||
|
||||
def KeyDown(self,event):
|
||||
if IsKeyMenuOrB(event.key):
|
||||
self.ReturnToUpLevelPage()
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["X"]: #Scan current
|
||||
self.ReScan()
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Y"]: #del
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
|
||||
self._ConfirmBox.CallbackA = self.ConfirmBoxCallbackA
|
||||
|
||||
self._Screen.PushPage(self._ConfirmBox)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
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()
|
||||
self._Ps.Draw()
|
||||
|
||||
if len(self._MyList) > 0:
|
||||
for i in self._MyList:
|
||||
i.Draw()
|
||||
|
||||
self._Scroller.UpdateSize( len(self._MyList)*InfoPageListItem._Height,
|
||||
self._PsIndex*InfoPageListItem._Height)
|
||||
self._Scroller.Draw()
|
||||
|
||||
|
||||
|
||||
|
||||
class APIOBJ(object):
|
||||
|
||||
_Page = None
|
||||
def __init__(self):
|
||||
pass
|
||||
def Init(self,main_screen):
|
||||
self._Page = CoresPage()
|
||||
self._Page._Screen = main_screen
|
||||
self._Page._Name ="Retroarch cores manager"
|
||||
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)
|
||||
|
||||
|
||||
@@ -38,8 +38,9 @@ class ListPageSelector(InfoPageSelector):
|
||||
self._PosY = y
|
||||
self._Height = h
|
||||
|
||||
aa_round_rect(self._Parent._CanvasHWND,
|
||||
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
#aa_round_rect(self._Parent._CanvasHWND,
|
||||
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width-4,h) ,0)
|
||||
|
||||
|
||||
class PageListItem(InfoPageListItem):
|
||||
@@ -37,9 +37,9 @@ class ListPageSelector(InfoPageSelector):
|
||||
self._PosY = y
|
||||
self._Height = h
|
||||
|
||||
aa_round_rect(self._Parent._CanvasHWND,
|
||||
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
|
||||
#aa_round_rect(self._Parent._CanvasHWND,
|
||||
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width-4,h) ,0)
|
||||
|
||||
class PageListItem(InfoPageListItem):
|
||||
_PosX = 0
|
||||
@@ -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
|
||||
@@ -76,7 +76,7 @@ class PageListItem(InfoPageListItem):
|
||||
class GPUDriverPage(Page):
|
||||
_FootMsg = ["Nav","","","Back","Select"]
|
||||
_MyList = []
|
||||
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||
_ListFont = MyLangManager.TrFont("notosanscjk12")
|
||||
|
||||
_AList = {}
|
||||
|
||||
@@ -101,8 +101,8 @@ class GPUDriverPage(Page):
|
||||
start_y = 0
|
||||
last_height = 0
|
||||
|
||||
drivers = [["fbturbo","Fbturbo"],
|
||||
["modesetting","Lima"]]
|
||||
drivers = [["fbturbo","FBTURBO driver (Software Rendering)"],
|
||||
["modesetting","LIMA driver (Experimental GPU Rendering)"]]
|
||||
|
||||
|
||||
for i,u in enumerate( drivers ):
|
||||
@@ -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
|
||||
@@ -170,10 +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('~') )
|
||||
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('~') )
|
||||
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")
|
||||
@@ -265,7 +271,7 @@ class GPUDriverPage(Page):
|
||||
i.Draw()
|
||||
|
||||
if self._HWND != None:
|
||||
self._HWND.fill((255,255,255))
|
||||
self._HWND.fill(MySkinManager.GiveColor("White"))
|
||||
|
||||
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )
|
||||
|
||||
@@ -278,7 +284,7 @@ class APIOBJ(object):
|
||||
def Init(self,main_screen):
|
||||
self._Page = GPUDriverPage()
|
||||
self._Page._Screen = main_screen
|
||||
self._Page._Name ="GPU driver switch"
|
||||
self._Page._Name ="GPU Driver Switch"
|
||||
self._Page.Init()
|
||||
|
||||
def API(self,main_screen):
|
||||
@@ -24,7 +24,7 @@ from UI.lang_manager import MyLangManager
|
||||
import config
|
||||
|
||||
class ListPageSelector(PageSelector):
|
||||
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||
_BackgroundColor = MySkinManager.GiveColor('Line')
|
||||
|
||||
def __init__(self):
|
||||
self._PosX = 0
|
||||
@@ -47,9 +47,9 @@ class ListPageSelector(PageSelector):
|
||||
self._PosY = y
|
||||
self._Height = h
|
||||
|
||||
aa_round_rect(self._Parent._CanvasHWND,
|
||||
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
|
||||
#aa_round_rect(self._Parent._CanvasHWND,
|
||||
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width-4,h),0 )
|
||||
|
||||
class PageListItem(object):
|
||||
_PosX = 0
|
||||
@@ -15,25 +15,19 @@ from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||
from UI.slider import Slider
|
||||
from UI.multi_icon_item import MultiIconItem
|
||||
|
||||
from UI.skin_manager import MySkinManager
|
||||
|
||||
from UI.icon_pool import MyIconPool
|
||||
|
||||
from libs.roundrects import aa_round_rect
|
||||
|
||||
import myvars
|
||||
|
||||
class SoundSlider(Slider):
|
||||
OnChangeCB = None
|
||||
|
||||
_BGpng = None
|
||||
_BGwidth = 192
|
||||
_BGheight = 173
|
||||
|
||||
_NeedleSurf = None
|
||||
_Scale = None
|
||||
_Parent = None
|
||||
|
||||
snd_segs = [ [0,20],[21,40],[41,50],[51,60],[61,70],[71,85],[86,90],[91,95],[96,100] ]
|
||||
|
||||
_VolumeLabel =None
|
||||
|
||||
def __init__(self):
|
||||
Slider.__init__(self)
|
||||
@@ -42,64 +36,67 @@ class SoundSlider(Slider):
|
||||
self._Width = self._Parent._Width
|
||||
self._Height = self._Parent._Height
|
||||
|
||||
self._BGpng = IconItem()
|
||||
self._BGpng._ImgSurf = MyIconPool._Icons["vol"]
|
||||
self._BGpng._MyType = ICON_TYPES["STAT"]
|
||||
self._BGpng._Parent = self
|
||||
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||
|
||||
##self._NeedleSurf = pygame.Surface( (38,12),pygame.SRCALPHA )
|
||||
|
||||
self._Scale = MultiIconItem()
|
||||
self._Scale._MyType = ICON_TYPES["STAT"]
|
||||
self._Scale._Parent = self
|
||||
self._Scale._ImgSurf = MyIconPool._Icons["scale"]
|
||||
self._Scale._IconWidth = 82
|
||||
self._Scale._IconHeight = 63
|
||||
self._Scale.Adjust(0,0,82,63,0)
|
||||
self._VolumeLabel = Label()
|
||||
self._VolumeLabel.SetCanvasHWND(self._CanvasHWND)
|
||||
self._VolumeLabel.Init("VOLUME",MySkinManager.GiveFont("EurostileBold13"))
|
||||
self._VolumeLabel.SetColor(MySkinManager.GiveColor('Text'))
|
||||
|
||||
def SetValue(self,vol):#pct 0-100
|
||||
for i,v in enumerate(self.snd_segs):
|
||||
if vol >= v[0] and vol <= v[1]:
|
||||
self._Value = i # self._Value : 0 - 8
|
||||
break
|
||||
if vol >= 0 and vol <= 100:
|
||||
self._Value = vol
|
||||
|
||||
def Further(self):
|
||||
self._Value+=1
|
||||
self._Value+=5
|
||||
|
||||
if self._Value > len(self.snd_segs)-1:
|
||||
self._Value = len(self.snd_segs) -1
|
||||
|
||||
vol = self.snd_segs[self._Value][0] + (self.snd_segs[self._Value][1] - self.snd_segs[self._Value][0])/2
|
||||
if self._Value > 100:
|
||||
self._Value = 100
|
||||
|
||||
if self.OnChangeCB != None:
|
||||
if callable(self.OnChangeCB):
|
||||
self.OnChangeCB( vol )
|
||||
self.OnChangeCB( self._Value )
|
||||
|
||||
def StepBack(self):
|
||||
self._Value-=1
|
||||
self._Value-=5
|
||||
|
||||
if self._Value < 0:
|
||||
self._Value = 0
|
||||
|
||||
vol = self.snd_segs[self._Value][0] + (self.snd_segs[self._Value][1] - self.snd_segs[self._Value][0])/2
|
||||
|
||||
|
||||
if self.OnChangeCB != None:
|
||||
if callable(self.OnChangeCB):
|
||||
self.OnChangeCB( vol )
|
||||
self.OnChangeCB( self._Value )
|
||||
|
||||
def Draw(self):
|
||||
|
||||
self._BGpng.NewCoord(self._Width/2,self._Height/2 )
|
||||
self._BGpng.Draw()
|
||||
start_x = 82
|
||||
start_y = self._Parent._Screen._Height/2-5
|
||||
height = 30
|
||||
width = 4
|
||||
seg = self._Value / 5
|
||||
|
||||
self._Scale.NewCoord(self._Width/2,self._Height/2)
|
||||
|
||||
self._Scale._IconIndex = self._Value
|
||||
for i in range(0, 20):
|
||||
rect = pygame.Rect(start_x+i*(width*2),start_y,width,height)
|
||||
if i > seg:
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect, 1)
|
||||
#aa_round_rect(self._CanvasHWND,rect, MySkinManager.GiveColor('Text'),1,1, MySkinManager.GiveColor('White'))
|
||||
else:
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect, 0)
|
||||
#aa_round_rect(self._CanvasHWND,rect, MySkinManager.GiveColor('Text'),1,0, MySkinManager.GiveColor('White'))
|
||||
|
||||
self._Scale.Draw()
|
||||
self._VolumeLabel.NewCoord(118,self._Parent._Screen._Height/2-30)
|
||||
self._VolumeLabel.Draw(True)
|
||||
|
||||
minus_box_rect = pygame.Rect(start_x- (4+6)*4,start_y,6*4,30)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),minus_box_rect, 0)
|
||||
|
||||
minus_rect = pygame.Rect(start_x-8*4,start_y+14,2*4,2)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),minus_rect, 0)
|
||||
|
||||
plus_box_rect = pygame.Rect(start_x + 39*4 +4*4,start_y,6*4,30)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),plus_box_rect, 0)
|
||||
|
||||
cross1_rect = pygame.Rect(start_x+39*4+4*4+2*4,start_y+14,2*4,2)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),cross1_rect, 0)
|
||||
cross2_rect = pygame.Rect(start_x+39*4+4*4+2*4+3,start_y+14-3,2,2*4)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),cross2_rect, 0)
|
||||
|
||||
class SoundPage(Page):
|
||||
|
||||
@@ -13,8 +13,6 @@ from UI.icon_pool import MyIconPool
|
||||
from UI.label import Label
|
||||
from UI.util_funcs import midRect
|
||||
|
||||
from libs.roundrects import aa_round_rect
|
||||
|
||||
class StoragePage(Page):
|
||||
|
||||
_Icons = {}
|
||||
@@ -24,10 +22,10 @@ class StoragePage(Page):
|
||||
_BGlabel = None
|
||||
_FreeLabel = None
|
||||
|
||||
_BGmsg = "%.1fGB of %.1fGB Used"
|
||||
_GBmsg = "%.1fGB of %.1fGB Used"
|
||||
_DskUsg = None
|
||||
|
||||
_HighColor = MySkinManager.GiveColor('High')
|
||||
_TextColor = MySkinManager.GiveColor('Text')
|
||||
_FootMsg = ["Nav.","","","Back",""]
|
||||
|
||||
def __init__(self):
|
||||
@@ -53,27 +51,24 @@ class StoragePage(Page):
|
||||
self._Width = self._Screen._Width
|
||||
self._Height = self._Screen._Height
|
||||
|
||||
self._BGpng = IconItem()
|
||||
self._BGpng._ImgSurf = MyIconPool._Icons["icon_sd"]
|
||||
self._BGpng._MyType = ICON_TYPES["STAT"]
|
||||
self._BGpng._Parent = self
|
||||
self._GBLabel = Label()
|
||||
self._GBLabel.SetCanvasHWND(self._CanvasHWND)
|
||||
self._GBLabel.Init(self._GBmsg % (self._DskUsg[1]-self._DskUsg[0], self._DskUsg[1]),MySkinManager.GiveFont("varela11") )
|
||||
self._GBLabel.SetColor(self._TextColor)
|
||||
|
||||
self._BGpng.AddLabel(self._BGmsg % (self._DskUsg[1]-self._DskUsg[0], self._DskUsg[1]), MySkinManager.GiveFont("varela15"))
|
||||
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||
|
||||
|
||||
self._BGlabel = Label()
|
||||
self._BGlabel.SetCanvasHWND(self._CanvasHWND)
|
||||
self._PctLabel = Label()
|
||||
self._PctLabel.SetCanvasHWND(self._CanvasHWND)
|
||||
|
||||
usage_percent = (self._DskUsg[0]/self._DskUsg[1] )*100.0
|
||||
|
||||
self._BGlabel.Init("%d%%"% int(usage_percent),MySkinManager.GiveFont("varela25"))
|
||||
self._BGlabel.SetColor( self._HighColor )
|
||||
|
||||
self._PctLabel.Init("%d%%"% int(usage_percent),MySkinManager.GiveFont("EurostileBold30"))
|
||||
self._PctLabel.SetColor( self._TextColor )
|
||||
|
||||
self._FreeLabel = Label()
|
||||
self._FreeLabel.SetCanvasHWND(self._CanvasHWND)
|
||||
self._FreeLabel.Init("Free",MySkinManager.GiveFont("varela13"))
|
||||
self._FreeLabel.SetColor(self._BGlabel._Color)
|
||||
self._FreeLabel.Init("FREE",MySkinManager.GiveFont("varela12"))
|
||||
self._FreeLabel.SetColor(self._PctLabel._Color)
|
||||
|
||||
|
||||
def OnLoadCb(self):
|
||||
@@ -82,31 +77,43 @@ class StoragePage(Page):
|
||||
def Draw(self):
|
||||
self.ClearCanvas()
|
||||
|
||||
self._BGpng.NewCoord(self._Width/2,self._Height/2-10)
|
||||
self._BGpng.Draw()
|
||||
self._BGlabel.NewCoord(self._Width/2-28,self._Height/2-30)
|
||||
self._BGlabel.Draw()
|
||||
self._PctLabel.NewCoord(32,102- 33)
|
||||
self._PctLabel.Draw()
|
||||
|
||||
self._FreeLabel.NewCoord(self._BGlabel._PosX+10 ,self._Height/2)
|
||||
self._FreeLabel.NewCoord(33 ,130-25)
|
||||
self._FreeLabel.Draw()
|
||||
|
||||
self._GBLabel.NewCoord(145,103-29)
|
||||
self._GBLabel.Draw()
|
||||
|
||||
#bgcolor = (238,238,238), fgcolor = (126,206,244)
|
||||
#aa_round_rect
|
||||
|
||||
usage_percent = (self._DskUsg[0]/self._DskUsg[1] )
|
||||
if usage_percent < 0.1:
|
||||
usage_percent = 0.1
|
||||
|
||||
rect_ = midRect(self._Width/2,self._Height-30,170,17, Width,Height)
|
||||
rect_ = pygame.Rect(144,118-25, 283-144,139-117)
|
||||
|
||||
aa_round_rect(self._CanvasHWND, rect_, MySkinManager.GiveColor('Line'), 5, 0, MySkinManager.GiveColor('Line'))
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'), rect_, 1)
|
||||
|
||||
|
||||
rect2 = midRect(self._Width/2,self._Height-30,int(170*(1.0-usage_percent)),17, Width,Height)
|
||||
rect2 = pygame.Rect(144,118-25,int((283-144)*(1.0-usage_percent)),139-117)
|
||||
|
||||
rect2.left = rect_.left
|
||||
rect2.top = rect_.top
|
||||
|
||||
aa_round_rect(self._CanvasHWND,rect2, MySkinManager.GiveColor('Front'),5,0,MySkinManager.GiveColor('Front'))
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect2, 0)
|
||||
|
||||
sep_rect = pygame.Rect(129,99-25,2,42)
|
||||
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Inactive'),sep_rect, 0)
|
||||
|
||||
##4 cross
|
||||
self.DrawCross(10,10)
|
||||
self.DrawCross(self._Screen._Width-20,10)
|
||||
self.DrawCross(10,self._Screen._Height-20)
|
||||
self.DrawCross(self._Screen._Width-20,self._Screen._Height-20)
|
||||
|
||||
|
||||
class APIOBJ(object):
|
||||
|
||||
@@ -50,7 +50,7 @@ class TimeLibStack:
|
||||
return len(self.stack)
|
||||
|
||||
class ListPageSelector(PageSelector):
|
||||
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||
_BackgroundColor = MySkinManager.GiveColor('Line')
|
||||
|
||||
def __init__(self):
|
||||
self._PosX = 0
|
||||
@@ -73,9 +73,9 @@ class ListPageSelector(PageSelector):
|
||||
self._PosY = y
|
||||
self._Height = h
|
||||
|
||||
aa_round_rect(self._Parent._CanvasHWND,
|
||||
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
|
||||
#aa_round_rect(self._Parent._CanvasHWND,
|
||||
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width-4,h),0)
|
||||
|
||||
|
||||
class TimezoneListPage(Page):
|
||||
@@ -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
|
||||
|
||||
@@ -202,7 +202,7 @@ class WifiInfoPage(Page):
|
||||
|
||||
|
||||
class WifiListSelector(PageSelector):
|
||||
_BackgroundColor = MySkinManager.GiveColor('Front')
|
||||
_BackgroundColor = MySkinManager.GiveColor('Line')
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
@@ -221,9 +221,8 @@ class WifiListSelector(PageSelector):
|
||||
self._PosX = x
|
||||
self._PosY = y
|
||||
self._Height = h
|
||||
|
||||
aa_round_rect(self._Parent._CanvasHWND,
|
||||
(x,y,self._Width,h),self._BackgroundColor,4,0,self._BackgroundColor)
|
||||
|
||||
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width,h),0)
|
||||
|
||||
|
||||
class WifiListMessageBox(Label):
|
||||
@@ -238,7 +237,7 @@ class WifiListMessageBox(Label):
|
||||
padding = 10
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),(x-padding,y-padding, w+padding*2,h+padding*2))
|
||||
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Black'),(x-padding,y-padding, w+padding*2,h+padding*2),1)
|
||||
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),(x-padding,y-padding, w+padding*2,h+padding*2),1)
|
||||
|
||||
self._CanvasHWND.blit(my_text,(x,y,w,h))
|
||||
|
||||
@@ -568,7 +567,23 @@ class WifiList(Page):
|
||||
password_inputed = "".join(myvars.PasswordPage._Textarea._MyWords)
|
||||
if is_wifi_connected_now() == False:
|
||||
self.ConfigWireless(password_inputed)
|
||||
|
||||
else:
|
||||
for i in range(0,10):
|
||||
if is_wifi_connected_now() == True:
|
||||
self.ShowBox(MyLangManager.Tr("Launching"))
|
||||
self._Daemon.Disconnect()
|
||||
self._Daemon.SetForcedDisconnect(True)
|
||||
self._Connecting = False
|
||||
else:
|
||||
break
|
||||
|
||||
pygame.time.delay(100)
|
||||
|
||||
if is_wifi_connected_now() == False:
|
||||
self.ConfigWireless(password_inputed)
|
||||
else:
|
||||
self.ShowBox(MyLangManager.Tr("Disconnect first"))
|
||||
|
||||
def OnReturnBackCb(self):
|
||||
pass
|
||||
|
||||
@@ -621,8 +636,8 @@ class WifiList(Page):
|
||||
for i in wicd_wirelss_encrypt_pwd:
|
||||
if "preshared_key" in i:
|
||||
if i["preshared_key"] != None:
|
||||
if len(i["preshared_key"]) > 0:
|
||||
thepass = i["preshared_key"]
|
||||
if len(str(i["preshared_key"])) > 0:
|
||||
thepass = str(i["preshared_key"])
|
||||
break
|
||||
|
||||
myvars.PasswordPage.SetPassword(thepass)
|
||||
@@ -8,6 +8,8 @@ import pygame
|
||||
from UI.page import Page
|
||||
from UI.label import Label
|
||||
from UI.lang_manager import MyLangManager
|
||||
from UI.skin_manager import MySkinManager
|
||||
|
||||
# a item for List
|
||||
# - - - - - - - - - - - --
|
||||
# | Icon Text..... > |
|
||||
@@ -50,6 +52,6 @@ class ListItem(object):
|
||||
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
|
||||
self._Labels["Text"].Draw()
|
||||
|
||||
pygame.draw.line(self._Parent._CanvasHWND,(169,169,169),(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)
|
||||
|
||||
|
||||
@@ -55,19 +55,20 @@ class ListPage(Page):
|
||||
["","PowerOptions","Power Options"],
|
||||
["","Wifi","Wi-Fi"],
|
||||
["","Bluetooth","Bluetooth"],
|
||||
["","Sound","Sound Volume"],
|
||||
["","Sound","Sound Volume"],
|
||||
["","Brightness","BackLight Brightness"],
|
||||
["","Storage",""],
|
||||
["","Time","Timezone"],
|
||||
["","Languages","Languages"],
|
||||
["","Notification","Notification"],
|
||||
["","Update", ""],
|
||||
["","Cores", "Retroarch cores manager"],
|
||||
["","About", "About"],
|
||||
["","PowerOFF","Power off"],
|
||||
["","PowerOFF","Power OFF"],
|
||||
["","ButtonsLayout","Buttons Layout"],
|
||||
["","LauncherGo","Switch to LauncherGo"],
|
||||
["","Lima","GPU driver switch"],
|
||||
["","GateWay","Network gateway switch"]]
|
||||
#["","LauncherGo","Switch to LauncherGo"],
|
||||
["","Lima","GPU Driver Switch"],
|
||||
["","GateWay","Network Gateway Switch"]]
|
||||
|
||||
start_x = 0
|
||||
start_y = 0
|
||||
@@ -76,7 +76,7 @@ class APIOBJ(object):
|
||||
self._Page = PowerOffConfirmPage()
|
||||
|
||||
self._Page._Screen = main_screen
|
||||
self._Page._Name ="Power OFF"
|
||||
self._Page._Name ="SHUTDOWN"
|
||||
self._Page.Init()
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
FIRM=`cat /proc/driver/brcmf_fw`
|
||||
|
||||
if [[ $FIRM =~ .*a0.* ]]
|
||||
then
|
||||
brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a0.hcd --enable_hci --bd_addr B0:F1:EC:2D:07:5B --no2bytes --tosleep 5000 /dev/ttyS1 &
|
||||
else
|
||||
brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a1.hcd --enable_hci --bd_addr B0:F1:EC:2D:07:5B --no2bytes --tosleep 5000 /dev/ttyS1 &
|
||||
fi
|
||||
@@ -4,6 +4,15 @@ BASENAME=`dirname "$0"`
|
||||
|
||||
cd $BASENAME/sys.py
|
||||
|
||||
if [ ! -f ~/.apps_menu_updated ]
|
||||
then
|
||||
cd ~/apps/Menu && git pull origin gcores
|
||||
if [ $? -eq 0 ]; then
|
||||
touch ~/.apps_menu_updated
|
||||
fi
|
||||
cd -
|
||||
fi
|
||||
|
||||
python run.py
|
||||
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 3.3 KiB |