438 Commits

Author SHA1 Message Date
cpi 975ce6a4a4 fix bug in title_bar auto redraw when in Low backlight 2019-09-03 13:20:50 +08:00
cpi 8f91cfe020 cores manager ps index out of range bug fix 2019-08-26 16:11:02 +08:00
GNU 228a771184 Merge pull request #289 from cuu/gcores
unzip with override
2019-08-22 21:18:02 +08:00
cpi e93fc99fcd unzip with override 2019-08-22 13:15:57 +00:00
GNU e59787d5cd Merge pull request #287 from cuu/gcores
Gcores
2019-08-22 16:31:55 +08:00
cpi cf7bcd615c alias list_item encode utf8 2019-08-22 08:25:42 +00:00
cpi 5a2d662ba2 ROM_SO bug fix 2019-08-22 08:21:35 +00:00
GNU 5313c26ea7 Merge pull request #285 from cuu/gcores
Correction of Translation
2019-08-19 17:47:44 +08:00
cuu 733fdbc55d Correction of Translation 2019-08-19 17:40:17 +08:00
cpi 7917aaaddc add Menu update before launcher 2019-08-16 14:59:27 +08:00
GNU 2dc6087950 Merge pull request #275 from cuu/gcores
add patch for mame2003plus
2019-08-07 21:43:07 +08:00
cuu dc4f61ee92 add patch for mame2003plus 2019-08-07 21:40:50 +08:00
cpi 277d3afdf9 update OPERATION.love 2019-07-18 19:51:36 +08:00
cpi b6f0e69573 update apps and wallpaper resources 2019-07-18 15:59:11 +08:00
cpi efd83802d3 update gcores MANUAL 2019-07-18 14:40:36 +08:00
GNU 66607a26b3 Merge pull request #266 from cuu/gcores
lima text revision
2019-07-18 10:39:36 +08:00
cuu 3ecd4fa349 lima text revision 2019-07-18 10:37:45 +08:00
GNU 6f90f8d3cd Merge pull request #263 from cuu/gcores
Gcores
2019-07-18 06:52:15 +08:00
cuu 3a38c26553 remove gitmodule 2019-07-18 06:51:20 +08:00
cuu 148c60330b TinyCloud airplay_name 2019-07-18 06:47:14 +08:00
GNU c5d8735b92 Merge pull request #262 from cuu/gcores
update lima
2019-07-18 06:08:59 +08:00
cuu b3879473b3 update lima 2019-07-18 06:08:17 +08:00
cpi 3a27edaa84 airplane customization 2019-07-17 20:04:20 +08:00
cpi f10cc77780 update gcores apps 2019-07-17 16:18:54 +08:00
cpi d54a85b82a about page fix 2019-07-17 15:47:43 +08:00
cpi 87943a7ac5 swap the orders of OPERATION and MANUAL 2019-07-17 15:00:02 +08:00
cpi 7d932ad590 update gcores apps 2019-07-17 14:51:58 +08:00
GNU 119cf5f2ad Merge pull request #259 from cuu/gcores
sync bluetooth_firmware.sh from master branch
2019-07-17 12:31:38 +08:00
cuu b2511e97c4 sync bluetooth_firmware.sh from master branch 2019-07-17 12:30:02 +08:00
GNU 615c9e0dfc Merge pull request #258 from cuu/gcores
Gcores
2019-07-17 12:25:30 +08:00
cuu ee71a91c0b wifi color restore 2019-07-17 12:24:46 +08:00
cuu 38e217ef49 update wifi 2019-07-17 12:21:11 +08:00
GNU f4cbaba80d Merge pull request #257 from cuu/gcores
update  settings->about
2019-07-16 20:48:02 +08:00
cuu 4f7fcc6433 update about 2019-07-16 20:45:13 +08:00
cpi eae8d4fae8 pico8 icon 2019-07-16 15:04:50 +08:00
cpi d8426c37f0 icons and apps 2019-07-16 14:45:46 +08:00
cpi 6458e9c425 remove 40_PLAY ,50_DEV from launcher to ~/apps/Menu 2019-07-16 03:32:49 +00:00
GNU 1d34a8b287 Merge pull request #256 from cuu/gcores
Update menu content items, icons and the order
2019-07-16 10:21:31 +08:00
cuu 925076fac7 Update menu content items, icons and the order 2019-07-16 09:10:42 +08:00
GNU 450680b2b3 Merge pull request #253 from cuu/gcores
skin update
2019-07-12 14:12:18 +08:00
cuu 66298985a4 skin update 2019-07-12 14:11:37 +08:00
GNU b36a750b3b Merge pull request #252 from cuu/gcores
Gcores Custom Modification
2019-07-12 14:03:42 +08:00
cuu ae279bda94 Gcores Custom Modification 2019-07-12 14:02:32 +08:00
GNU af8f80736e Merge pull request #251 from cuu/gcores
Gcores
2019-07-11 22:38:00 +08:00
cuu f90b45059d Merge branch 'gcores' of https://github.com/cuu/launcher into gcores 2019-07-11 22:25:25 +08:00
cuu 9208fccacd ignore dot file in main_screen ReadTheDirIntoPages 2019-07-11 22:24:06 +08:00
GNU 720152dfe6 Merge pull request #211 from cuu/gcores
skip UnicodeDecodeError in Emulator
2019-05-13 19:48:44 +08:00
cuu 108e2b6877 skip UnicodeDecodeError in Emulator 2019-05-13 19:47:04 +08:00
GNU d8bd6a1718 Merge pull request #209 from cuu/gcores
TinyCloud font improvement
2019-05-12 10:08:13 +08:00
cuu ba0c11bb4d TinyCloud font improvement 2019-05-12 10:07:05 +08:00
GNU b488b5d4f1 Merge pull request #208 from cuu/gcores
TrFont bug fix
2019-05-11 17:55:38 +08:00
cuu 99305de562 TrFont bug fix 2019-05-11 17:54:59 +08:00
GNU d76dd08bf5 Update LICENSE 2019-05-10 19:08:42 +08:00
GNU 2577d0b534 Merge pull request #206 from cuu/gcores
Gcores
2019-05-09 21:02:02 +08:00
cuu eab2724dc7 Merge branch 'gcores' of github.com:cuu/launcher into gcores 2019-05-09 20:58:48 +08:00
cuu 25b976d948 wifi_list bug fix 2019-05-09 20:58:31 +08:00
GNU 9e70c4a088 Merge pull request #203 from cuu/gcores
wifilist message box colors fix
2019-05-07 13:55:20 +08:00
cuu ecfe99bc49 wifilist message box colors fix 2019-05-07 13:53:44 +08:00
GNU f5ac2da976 Merge pull request #200 from cuu/gcores
bug fix download_process_page.py
2019-05-07 13:02:24 +08:00
cuu 534883ca1f bug fix 2019-05-07 13:01:11 +08:00
GNU ad540da0c0 Merge pull request #199 from cuu/gcores
mpd_spectrum_page.py
2019-05-05 19:15:07 +08:00
cuu bb66f3c8f0 mpd_spectrum_page.py
text colors
2019-05-05 19:14:24 +08:00
GNU 13aa69700a Merge pull request #198 from cuu/gcores
MsgBoxFont
2019-05-05 18:53:23 +08:00
cuu d919110d58 MsgBoxFont 2019-05-05 18:52:25 +08:00
GNU fcd978b615 Merge pull request #196 from cuu/gcores
add absolute path in .cpirc
2019-05-05 18:30:16 +08:00
cuu 4b26c692ee add absolute path in .cpirc 2019-05-05 18:29:16 +08:00
GNU f3948dfd71 Merge pull request #195 from cuu/gcores
main_screen msgbox color fix
2019-05-05 17:08:49 +08:00
cuu b9e890137c main_screen msgbox color fix 2019-05-05 17:06:57 +08:00
GNU a871da1b85 Merge pull request #194 from cuu/gcores
update Menu icons to be 80x80
2019-05-05 16:48:51 +08:00
cuu 8f55eea7cf update Menu icons to be 80x80 2019-05-05 16:48:12 +08:00
GNU 52c1d12029 Merge pull request #193 from cuu/gcores
Gcores  cursor color and icons
2019-05-05 16:08:59 +08:00
cuu ae589ac886 Merge branch 'gcores' of https://github.com/clockworkpi/launcher into gcores 2019-05-05 16:08:06 +08:00
cuu 6ef89ddbff cursor color and icons 2019-05-05 16:07:37 +08:00
GNU 90dcd1bd25 Merge pull request #191 from cuu/gcores
textarea gcores theme
2019-05-05 15:05:59 +08:00
cuu 0ead001f80 textarea gcores theme 2019-05-05 15:05:09 +08:00
GNU f58d8218c2 Merge pull request #190 from cuu/gcores
colors fix
2019-05-05 14:43:04 +08:00
cuu 3ec8a1a65b compkginfo add pico-8.zip 2019-05-05 14:41:59 +08:00
cuu 160ff76d6e colors fix 2019-05-05 14:37:26 +08:00
GNU 51f62ea575 Merge pull request #189 from cuu/gcores
...
2019-05-05 14:01:27 +08:00
cuu 3c88f42924 ... 2019-05-05 14:00:39 +08:00
GNU 40d705acb5 Merge pull request #188 from cuu/gcores
gcores theme update
2019-05-05 13:46:13 +08:00
cuu ee88a3170b gcores theme update 2019-05-05 13:45:16 +08:00
GNU c05da6de97 Merge pull request #187 from cuu/gcores
Gcores
2019-05-05 12:03:23 +08:00
cuu 423044f496 gcorse theme images update 2019-04-30 18:20:18 +08:00
cuu 5d93fda813 gcores brightness theme 2019-04-30 14:23:32 +08:00
cuu 63d1af1337 Line color 2019-04-29 21:30:28 +08:00
cuu bceb9a372e footbar,blank,page.py hide PageSelector 2019-04-29 20:08:55 +08:00
GNU cb9562ebbd Merge pull request #184 from mguilherme/pico-8_0.1.12c
Add support for pico-8 latest version pico-8_0.1.12c
2019-04-28 15:02:46 +08:00
Miguel Guilherme bd88c1730e Add support for pico-8 latest version pico-8_0.1.12c 2019-04-27 23:13:27 +01:00
cuu 1d8d85812a gcores volume 2019-04-27 22:17:22 +08:00
cuu 8bca1166df storage theme 2019-04-27 16:46:13 +08:00
cuu e38521e9c7 change icons and color for gcores theme 2019-04-27 12:05:00 +08:00
cuu 0bb9ed9eda ... 2019-04-27 11:13:46 +08:00
GNU a5b10b16be Merge pull request #183 from cuu/master
fix fds leak and remove SkinMap,fonts.py
2019-04-27 09:56:44 +08:00
cuu 0981ac4c59 delete sys.py/UI/fonts.py 2019-04-26 17:34:23 +08:00
cuu 25a191a4d0 empty fonts.py 2019-04-26 17:33:44 +08:00
cuu d3b508c3a1 fix fds leak and remove SkinMap 2019-04-26 14:01:36 +08:00
cuu 6f855dc36f update pico8 zip md5sum 2019-04-17 14:52:43 +08:00
GNU 583d888aba Merge pull request #176 from aifreedom/songx--add-chinese-translation
Chinese translations for menu items in Settings
2019-03-28 19:37:38 +08:00
Song Xie 5d1dba3479 Chinese translation for menu items in Settings 2019-03-23 01:52:17 -07:00
GNU 823cb756eb Merge pull request #174 from Cecilectomy/master
Adding icon boundary wrapping to page
2019-03-14 13:48:15 +08:00
Daniel Cecil e3747493ad Adding icon boundary wrapping to page
Wrapping back to beggining or end of icon list provides better usability
2019-02-26 10:57:31 -08:00
GNU 8cd87b5276 Merge pull request #172 from ruverav/master
Missing translations and minor fixes
2019-02-14 18:30:11 +08:00
Rubén Verdute Ávila 219e880f18 Missing translations and minor fixes
Translate missing texts, remove duplicated disconnect button in wifi info page and add translations for spanish language.
2019-02-13 22:24:59 +01:00
GNU c1b06db2dc Merge pull request #171 from infernalmaster/master
add select button to footer
2019-02-13 15:38:38 +08:00
cpi a2d8de4535 add select button to footer 2019-02-12 23:01:51 +02:00
GNU b7cd5aaf90 Merge pull request #170 from infernalmaster/master
Fix UX for XBOX layout
2019-02-12 17:19:56 +08:00
Rostyslav Diachok df05604013 fix xbox layout 2019-02-12 01:41:42 +02:00
Rostyslav Diachok 5b0db0a461 remove never used buttons from config 2019-02-12 01:36:24 +02:00
cpi b47b020339 fix xbox layout UX 2019-02-12 01:09:48 +02:00
GNU c4587c12bf Merge pull request #169 from cuu/master
update spanish translation
2019-02-10 13:56:18 +08:00
cuu 1fa3c80229 update spanish translation 2019-02-10 13:54:43 +08:00
GNU 3196496018 Merge pull request #166 from cuu/master
french translation
2019-02-08 17:34:54 +08:00
cuu 17265eab55 Merge branch 'master' of https://github.com/clockworkpi/launcher 2019-02-08 17:33:14 +08:00
cuu fd879c607a french translation 2019-02-08 17:29:56 +08:00
GNU ae8b4b775a Merge pull request #165 from cuu/master
bug fix ,add spanish translation
2019-02-07 21:26:09 +08:00
cuu 827b7f06fa bug fix ,add spanish translation 2019-02-07 17:44:21 +08:00
GNU 83e2cc8fe6 Merge pull request #163 from cuu/master
update 10_Settings/Update
2019-01-28 23:44:14 +08:00
cuu 02b399dd01 pygame limits 9 userevent 2019-01-28 23:40:35 +08:00
cuu 10305da9e8 allow RUNSH in pygame.event queue 2019-01-28 23:29:40 +08:00
cuu dc33952c58 update bug 2019-01-28 23:26:30 +08:00
cuu 8b5b93f721 Merge branch 'master' of https://github.com/clockworkpi/launcher 2019-01-28 23:14:37 +08:00
cuu 2e5ea437cd add SpeedScroll 2019-01-28 23:13:05 +08:00
cuu f9a74d6579 submodule init and update 2019-01-26 20:57:52 +08:00
cuu fc099786fe update 10_Settings/Update 2019-01-26 17:34:39 +08:00
GNU 008f701029 Merge pull request #162 from cuu/master
fix translations
2019-01-26 00:17:45 +08:00
cuu f7976d4406 Merge branch 'master' of https://github.com/clockworkpi/launcher 2019-01-26 00:16:03 +08:00
cuu 9d1aa75619 fix translation 2019-01-26 00:14:57 +08:00
GNU 689a573d6e Merge pull request #161 from cuu/master
change .cpirc to fit with ubuntu
2019-01-25 12:52:54 +08:00
cuu fe8f451392 change .cpirc to fit with ubuntu 2019-01-25 12:51:05 +08:00
GNU 7ae4303d58 Merge pull request #160 from cuu/master
bluetooth on gs dev_connect bug fix
2019-01-22 10:37:52 +08:00
cuu 2beaa2e862 Merge branch 'master' of https://github.com/clockworkpi/launcher 2019-01-22 10:37:02 +08:00
cuu 9e75bc56e0 bug 2019-01-22 10:34:15 +08:00
GNU 07070fc41e Merge pull request #159 from cuu/master
add bluetooth agent,now device can paired,remembered after disconnect
2019-01-22 10:21:30 +08:00
cuu c225aa7dde add bluetooth agent,now device can paired,remembered after disconnect 2019-01-22 09:21:08 +08:00
GNU d93e514e78 Merge pull request #158 from cuu/master
auto create GameDir in CommercialSoftwarePackage
2019-01-19 19:25:33 +08:00
cuu a502612c7d Merge branch 'master' of https://github.com/clockworkpi/launcher 2019-01-19 19:24:59 +08:00
cuu ff374a7667 auto create GameDir in CommercialSoftwarePackage 2019-01-19 19:24:38 +08:00
GNU 83b56b57c3 Merge pull request #157 from cuu/master
fix bug in CommercialSoftwarePackage
2019-01-19 19:22:22 +08:00
cuu df90a133f9 Merge branch 'master' of https://github.com/clockworkpi/launcher 2019-01-19 19:21:39 +08:00
cuu dd490ec3e9 fix bug in CommercialSoftwarePackage 2019-01-19 19:20:14 +08:00
GNU 2dd7143c14 Merge pull request #156 from cuu/master
v1.24
2019-01-18 00:46:37 +08:00
cuu f999a22520 v1.24 2019-01-18 00:41:55 +08:00
GNU 7079d778aa Merge pull request #155 from cuu/master
update PICO-8.sh
2019-01-18 00:33:25 +08:00
cuu b639e81b27 update PICO-8.sh 2019-01-18 00:32:55 +08:00
GNU d13e410aa7 Merge pull request #154 from cuu/master
bug fix
2019-01-18 00:20:18 +08:00
cuu 793db0c984 bug fix 2019-01-18 00:19:50 +08:00
GNU d062c4920c Merge pull request #153 from cuu/master
bug fix
2019-01-17 22:20:11 +08:00
cuu 12c923df8a bug fix 2019-01-17 22:18:33 +08:00
GNU f33e6080b9 Merge pull request #152 from cuu/master
commercialsoftwarepackage alpha, ReunionPagesIcons combines 20_Retro Games now
2019-01-17 15:10:51 +08:00
cuu 530c08dc34 small fix in CommercialSoftwarePackage 2019-01-17 14:20:57 +08:00
cuu be872d0536 Comm software package alpha 2019-01-17 00:56:40 +08:00
cuu 565605cfef add text_bulletinboard.py 2019-01-16 12:03:40 +08:00
cuu e6c22c90e0 PICO-8 alpha 2019-01-16 01:17:02 +08:00
cuu 7e75d4856b add widget.py 2019-01-15 16:37:15 +08:00
cuu c641c8d84a ReunionPagesIcons combines 20_Retro Games now 2019-01-15 01:15:43 +08:00
cuu 0b8331d3d0 ReunionPagesIcons combines 20_Retro Games now 2019-01-15 01:05:59 +08:00
GNU f2bd7423e4 Merge pull request #151 from cuu/master
update dwm-mod and .xinitrc
2019-01-12 21:33:00 +08:00
cuu d83d9e9360 Merge branch 'master' of https://github.com/clockworkpi/launcher 2019-01-12 21:30:26 +08:00
cuu ea0eb4fb39 update dwm-mod and .xinitrc 2019-01-12 21:23:58 +08:00
GNU 765f73d51f Merge pull request #150 from cuu/master
update dwm-mod
2019-01-11 23:06:18 +08:00
cuu 7905077d13 update dwm-mod 2019-01-11 23:03:20 +08:00
GNU 8cf3486f11 Merge pull request #149 from cuu/master
update dwm-mod
2019-01-11 22:19:38 +08:00
cuu 18516efdb5 update dwm-mod 2019-01-11 22:19:00 +08:00
GNU 670cfc24d0 Merge pull request #148 from cuu/master
update dwm-mod
2019-01-11 21:20:00 +08:00
cuu 034e4e91c9 update dwm-mod 2019-01-11 21:19:29 +08:00
GNU 1b01e25ce1 Merge pull request #147 from cuu/master
gateway bug fix
2019-01-09 19:01:18 +08:00
cuu 9920166630 gateway bug fix 2019-01-09 18:59:20 +08:00
GNU b15faabefa Merge pull request #146 from cuu/master
change gateway ip address last digit calculation
2019-01-09 18:53:13 +08:00
cuu 4ad682572c Merge branch 'master' of https://github.com/clockworkpi/launcher 2019-01-08 22:29:35 +08:00
cuu 807fdfa428 change gateway ip address last digit calculation 2019-01-08 22:29:04 +08:00
GNU 4074f4bfc7 Merge pull request #145 from cuu/master
add network gateway switch
2019-01-08 16:10:24 +08:00
cuu e8dc44fb3e update gsnotify-arm 2019-01-07 22:24:31 +08:00
cuu ee3ddb54a7 update gsnotify-arm,bug fix,ShutDownWhenLowPower ignores when GS is Charging 2019-01-07 21:55:07 +08:00
cuu 4837bfcf60 gateway switch bug fix,Click() 2019-01-07 20:37:26 +08:00
cuu f3776f1c51 gateway switch bug fix 2019-01-06 22:02:08 +08:00
cuu c1228d321b add clear all gateways 2019-01-06 21:59:10 +08:00
cuu 9bd4a6e965 gateway switch bug fix 2019-01-06 21:52:35 +08:00
cuu df03f2889a gateway switch bug fix 2019-01-06 21:42:16 +08:00
cuu 06b8db3edb gateway switch bug fix 2019-01-06 21:40:54 +08:00
cuu c523b4ef3c add network gateway switch 2019-01-06 21:06:28 +08:00
GNU f84c14aecd Merge pull request #144 from cuu/master
...
2019-01-04 19:18:53 +08:00
cuu b9f8133e75 ... 2019-01-04 19:18:26 +08:00
GNU ac2221fc84 Merge pull request #143 from cuu/master
gpu driver switch bug fix
2019-01-04 19:14:55 +08:00
cuu 321c4e9643 Merge branch 'master' of https://github.com/clockworkpi/launcher 2019-01-04 19:14:21 +08:00
cuu 47f0fdab97 gpu driver switch bug fix 2019-01-04 19:13:44 +08:00
GNU 09b3c64160 Merge pull request #142 from cuu/master
fix bug in gpu driver switch
2019-01-04 19:05:24 +08:00
cuu 8b9dba21e5 fix bug in gpu driver switch 2019-01-04 19:04:55 +08:00
GNU f036a2f264 Merge pull request #141 from cuu/master
add gpu driver switch,dwm,bug fix
2019-01-04 19:00:47 +08:00
cuu f99f993b1f Merge branch 'master' of https://github.com/clockworkpi/launcher 2019-01-04 18:58:44 +08:00
cuu c88e3146ec add dwm 2019-01-04 18:57:51 +08:00
cuu 66f61e3465 add xorg,xorg_lima 2019-01-04 18:47:27 +08:00
cuu 3d60124d84 add GPU driver switch 2019-01-04 18:44:52 +08:00
cuu 70e72e7172 00_lowpower.sh 2018-12-29 11:18:26 +00:00
GNU ba76103819 Merge pull request #140 from cuu/master
combine .xinitrcs to be one
2018-12-25 23:03:43 +08:00
cuu c0aab424a6 Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-25 14:59:03 +00:00
cuu 6b866f940e combine xinitrc to be one 2018-12-25 14:58:32 +00:00
GNU 301bb3b74c Merge pull request #139 from cuu/master
update desktopbg.jpg , cut smalltext in bluetooth infopage
2018-12-21 21:40:30 +08:00
cuu 95387464bd cut smalltext in bluetooth infopage 2018-12-21 21:37:03 +08:00
cuu fb0e6c00e7 cut smalltext in bluetooth infopage 2018-12-21 21:36:32 +08:00
cuu 1d9f2fa1b6 update desktopbg.jpg 2018-12-21 14:08:45 +08:00
GNU 4b0093e02d Merge pull request #138 from cuu/master
bug fix
2018-12-20 16:25:30 +08:00
cuu 157c5554d5 Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-20 16:24:33 +08:00
cuu 2a4e951123 bluetooth bug 2018-12-20 16:19:03 +08:00
cuu d9a884520c bluetooth bug 2018-12-20 16:17:57 +08:00
cuu 36ebf2f7fc bug fix 2018-12-20 16:02:07 +08:00
GNU 3c17813469 Merge pull request #137 from cuu/master
update .xinitrc
2018-12-19 18:55:08 +08:00
cuu df344ed12b Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-19 18:52:52 +08:00
cuu bb8d251556 update .xinitrc 2018-12-19 18:49:11 +08:00
GNU de577fd528 Merge pull request #136 from cuu/master
update gsnotify-arm
2018-12-19 18:48:16 +08:00
cuu 2bd0611b28 Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-19 18:47:45 +08:00
cuu 6472377a61 update gsnotify-arm 2018-12-19 18:47:23 +08:00
GNU 8a875ee847 Merge pull request #135 from cuu/master
translations fix
2018-12-19 14:31:29 +08:00
cuu 171d4e38ef translations 2018-12-19 14:28:48 +08:00
cuu 5395f3dad7 english fix 2018-12-19 14:22:15 +08:00
GNU 98bf5df99c Merge pull request #134 from cuu/master
update twm bg and fix counter screen under hdmi bug
2018-12-18 20:04:16 +08:00
cuu 7afb6634de Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-18 20:03:47 +08:00
cuu 07060948e4 update twm bg and fix counter screen under hdmi bug 2018-12-18 20:03:15 +08:00
GNU 3f1a24fea0 Merge pull request #133 from cuu/master
soundpage bug fix
2018-12-18 19:40:09 +08:00
cuu a7ce02be8a Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-18 19:39:38 +08:00
cuu 5b7a162f18 soundpage bug fix 2018-12-18 19:39:11 +08:00
GNU accbd7524e Merge pull request #132 from cuu/master
update soundpage
2018-12-18 19:26:19 +08:00
cuu f0df9b4214 Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-18 19:25:39 +08:00
cuu 517ac01bc7 update soundpage 2018-12-18 19:25:00 +08:00
cpi 7285f38b39 rm twm.mod 2018-12-18 17:17:29 +08:00
cpi 234d59eec1 rm xbms 2018-12-18 17:01:53 +08:00
cpi 26e78d93aa update gitmodules for Pcsx 2018-12-18 08:55:57 +00:00
cpi 539468f467 twm 2018-12-18 16:47:13 +08:00
cuu b81416a93c PreparationInAdv 2018-12-18 12:12:09 +08:00
GNU a2d8555092 Merge pull request #131 from cuu/master
...
2018-12-17 18:51:16 +08:00
cuu 57bc0aba20 ... 2018-12-17 18:48:47 +08:00
GNU 03d0e7cbe2 Merge pull request #130 from cuu/master
bluetooth GenNetworkList skip mac address
2018-12-17 16:32:43 +08:00
cuu f10768f8b0 bluetooth GenNetworkList skip mac address 2018-12-17 16:32:10 +08:00
GNU 31de17e669 Merge pull request #129 from cuu/master
tiny cloud and bluetooth
2018-12-17 16:07:22 +08:00
cuu e1771e8c02 Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-17 16:05:44 +08:00
cuu c5fd06c049 tiny cloud and bluetooth 2018-12-17 16:04:23 +08:00
GNU e3ffcf3908 Merge pull request #128 from cuu/master
update awesome config ,set new background wallpaper in hdmi
2018-12-14 18:48:56 +08:00
cuu 1ebfd1cd5e Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-14 18:48:19 +08:00
cuu 329444332d update awesome config ,set new background wallpaper in hdmi 2018-12-14 18:47:44 +08:00
cuu 7b59674ed3 add desktop bg 2018-12-14 18:41:35 +08:00
GNU 13623f5c9c Merge pull request #127 from cuu/master
bug fix
2018-12-14 18:40:17 +08:00
cuu b02abf964a Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-14 18:39:37 +08:00
cuu 4d5f8d9ea3 bug fix 2018-12-14 18:39:23 +08:00
GNU 36c9ab6b15 Merge pull request #126 from cuu/master
notifications bug fix
2018-12-14 18:36:38 +08:00
cuu 8c54c38a9f Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-14 18:35:54 +08:00
cuu 6cb35eb09c notifications bug fix 2018-12-14 18:35:30 +08:00
GNU 18b566cc3d Merge pull request #125 from cuu/master
update gsnotify
2018-12-14 18:23:46 +08:00
cuu 880121cd21 update gsnotify 2018-12-14 18:21:13 +08:00
cuu 52bc2bed04 add lowpower.sh 2018-12-14 18:20:09 +08:00
cuu 425cb66d6f Notification changed 2018-12-14 17:00:40 +08:00
cuu a54465776a awesome update 2018-12-13 20:09:09 +08:00
GNU e9e59624fd Merge pull request #124 from cuu/master
1.23
2018-12-13 19:08:18 +08:00
cuu 655216e235 1.23 2018-12-13 19:03:20 +08:00
cuu d14276e31a tinycloud add usb-eth 2018-12-11 18:11:21 +08:00
GNU 65138e7586 Merge pull request #123 from cuu/master
add OnKbdReturnBackCb on wifi_list
2018-12-09 23:15:59 +08:00
cuu 5ef299dfce add OnKbdReturnBackCb on wifi_list 2018-12-09 19:09:35 +08:00
GNU 4c6b50897b Merge pull request #122 from cuu/master
disable power_save by default
2018-12-07 22:22:15 +08:00
cuu 3cd83855c6 Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-07 22:21:25 +08:00
cuu 35b1e505ee ... 2018-12-07 22:20:55 +08:00
GNU 43d57620cb Merge pull request #121 from cuu/master
translations and add launchergo switch
2018-12-07 19:48:24 +08:00
cuu e54509335a Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-12-07 19:47:01 +08:00
cuu ff4f2e8460 wifilist bug fix 2018-12-07 19:46:10 +08:00
cuu 2ceba9d8cf ... 2018-12-06 23:00:04 +08:00
cuu 114b7ab8c4 ja translations 2018-12-06 12:13:54 +08:00
cuu dd3b95b3f5 switch to launchego 2018-12-05 20:17:22 +08:00
cuu 40cafe09c5 MultiLabel add iscjk 2018-12-05 16:17:15 +08:00
cuu 493a920500 airpalne mode remove InfoPageListItem 2018-12-05 15:54:33 +08:00
cuu 88ef0f5df5 update ja lang 2018-12-05 15:38:57 +08:00
cuu ef4f6869c9 Update add LauncherLoc 2018-12-03 23:10:39 +08:00
cuu 16da52093a update Update to 2.0 2018-12-03 21:05:42 +08:00
cuu db9eeaa957 translations 2018-12-03 12:52:14 +08:00
GNU d3c04d5771 Merge pull request #120 from cuu/master
TrFont in wifilist,msgbox
2018-12-02 18:29:49 +08:00
cuu 3541c101f8 TrFont in wifilist,msgbox 2018-12-02 18:29:15 +08:00
GNU 7d3bb93eb2 Merge pull request #119 from cuu/master
Add multi languages
2018-12-02 18:09:07 +08:00
cuu 578305dfb1 ... 2018-12-02 18:04:18 +08:00
cuu 572984f294 ... 2018-12-02 18:03:20 +08:00
cuu c61f818772 ... 2018-12-02 18:03:02 +08:00
cuu eeb0a616c3 bluetooth OnloadCb,RefreshDevices will block n secs if there is no bluez daemon 2018-12-02 18:00:07 +08:00
cuu 793e0cae3a translation fixs 2018-12-02 17:42:25 +08:00
cuu a4ad0de109 translate fix 2018-12-02 17:30:48 +08:00
cuu 13dfa44c2c translate alpha now 2018-12-02 17:26:52 +08:00
cuu 7d692ef113 langs ini update 2018-12-02 14:30:29 +08:00
cuu aac0bf1944 music play list ,translate bgpng 2018-12-02 14:26:23 +08:00
cuu ea673759d9 auto create dotlang 2018-12-02 14:19:21 +08:00
cuu 746fdb8412 auto create dotlang 2018-12-02 14:18:36 +08:00
cuu 73bcdb6d44 continue translate 2018-12-02 14:12:13 +08:00
cuu 0d7a527e97 more translate 2018-12-01 20:04:36 +08:00
cuu 152b2a8ac7 add languages into settings menu 2018-12-01 14:11:27 +08:00
cuu b3aea583a5 continue translate 2018-11-30 19:08:35 +08:00
cuu 44ce359f0e .gitignore fix 2018-11-30 13:26:46 +08:00
cuu 6f45052d4c add multi languages 2018-11-30 13:26:30 +08:00
cuu c8d6e85c5b Merge branch 'master' of https://github.com/clockworkpi/launcher 2018-11-30 13:18:39 +08:00
cuu 3c6416f85b replace SkinManager() to MySkinManager 2018-11-30 13:18:21 +08:00
GNU e314631a5a Merge pull request #117 from cuu/master
Emulator skip ROM_SO checks if no needs for rom so
2018-11-19 15:50:04 +08:00
cuu 60a85739fa add return in Emulator ,Click 2018-11-17 16:40:41 +08:00
cuu 83a7547a0a Emulator skip ROM_SO checks if no needs for rom so 2018-11-17 16:30:47 +08:00
cuu be6f539f8e uuddllrrab 2018-11-10 18:48:41 +08:00
GNU bb58718df4 Merge pull request #116 from cuu/master
awesome config,missing class in table
2018-10-21 12:09:03 +08:00
cuu d175b5a1ba awesome config,missing class in table 2018-10-21 12:07:32 +08:00
cuu 8869cd570c awesome config 2018-10-21 11:57:27 +08:00
GNU 5452b6fe9c Merge pull request #115 from cuu/master
try exception on bluez dbus init
2018-10-20 15:22:18 +08:00
cuu 5e29592572 try exception on bluez dbus init 2018-10-20 15:21:47 +08:00
GNU efd9459ab3 Merge pull request #114 from cuu/master
awesome config
2018-10-17 21:43:59 +08:00
cuu 571468bb8f awesome config 2018-10-17 21:37:58 +08:00
cuu 3770686ce1 awesome theme bg path 2018-10-17 21:22:03 +08:00
cuu e9ab068799 awesome config 2018-10-17 21:18:27 +08:00
cuu e77178ea3b awesome config 2018-10-17 20:15:13 +08:00
cuu 1142728615 awesome config 2018-10-17 20:07:44 +08:00
GNU 55f7820e08 Merge pull request #113 from cuu/master
awesome configs
2018-10-17 19:54:49 +08:00
cuu 6f451bfb14 awesome config 2018-10-17 19:47:27 +08:00
cuu 0d52efc96d awesome config 2018-10-17 19:00:19 +08:00
cuu 694383765d awesome config 2018-10-17 18:53:04 +08:00
cuu 7788d7541b awesome config 2018-10-17 17:28:02 +08:00
GNU f586418ecd Merge pull request #112 from cuu/master
bug fix,keyboard
2018-10-11 03:16:01 +08:00
cuu c30aee6b3c bug fix,keyboard 2018-10-11 03:12:02 +08:00
GNU d665d739e7 Merge pull request #110 from cuu/master
add reload ui to Menu
2018-10-08 13:30:34 +08:00
cuu 7787b3e6f4 add reload ui to Menu 2018-10-08 13:28:27 +08:00
GNU f48c749368 Merge pull request #109 from cuu/master
update gsnotify-arm
2018-10-07 22:59:02 +08:00
cuu e7793f25ed update gsnotify-arm 2018-10-07 22:58:34 +08:00
GNU 69c2e8be6f Merge pull request #108 from cuu/master
update gsnotify-arm
2018-10-07 22:41:12 +08:00
cuu 8b70ef15df update gsnotify-arm 2018-10-07 22:40:12 +08:00
GNU a700ed7236 Merge pull request #107 from cuu/master
add control of gsnotify
2018-10-07 22:15:26 +08:00
cuu bacd0b8e72 add control of gsnotify 2018-10-07 22:13:12 +08:00
GNU 86694a9d06 Merge pull request #105 from cuu/master
update gsnotify
2018-09-27 21:56:42 +08:00
cuu 55f4f9df27 update gsnotify 2018-09-27 21:54:20 +08:00
GNU 1b042adb54 Merge pull request #104 from cuu/master
awesome naughty timeout
2018-09-22 18:40:42 +08:00
cuu 5cf8bb1917 awesome naughty timeout 2018-09-22 18:37:22 +08:00
GNU 723644579e Merge pull request #103 from cuu/master
prepare 2.0
2018-09-12 17:47:49 +08:00
cuu 28334adc6b ... 2018-08-30 21:15:47 +08:00
cuu 2877a138e0 awesome config bug fix 2018-08-30 21:01:04 +08:00
cuu d3148d1379 ReunionPagesIcons 2018-08-28 20:30:31 +08:00
cuu 77215d4172 add new configs 2018-08-27 16:09:03 +08:00
GNU 8186028711 Merge pull request #102 from cuu/master
remove gsnotify in run.py
2018-08-26 12:25:46 +08:00
cuu 9e787469ea remove gsnotify in run.py 2018-08-26 12:25:05 +08:00
GNU 02a90d52ce Merge pull request #101 from cuu/master
bug fix in airplane mode
2018-08-22 14:58:15 +08:00
cuu 9dbe1ca630 bug fix in airplane mode 2018-08-22 14:57:49 +08:00
GNU 0d03a717dc Merge pull request #100 from cuu/master
add Rescue in airplane mode
2018-08-22 14:47:21 +08:00
cuu 33aa7f6154 add Rescue in airplane mode 2018-08-22 14:46:49 +08:00
GNU 029e89737c Merge pull request #99 from cuu/master
cleanup re-order mess
2018-08-22 14:20:17 +08:00
cuu 478746e19d cleanup re-order mess 2018-08-22 14:19:15 +08:00
GNU 4d5a19d5bc Merge pull request #97 from ZiTAL/master
folder order
2018-08-22 14:16:57 +08:00
GNU 46eb56cb57 Merge pull request #98 from cuu/master
bluetooth
2018-08-22 14:16:40 +08:00
cuu a1bbeafd8b add bluetooth titlebar icon 2018-08-22 14:05:07 +08:00
cuu 10a91108dd delay on disconnecting 2018-08-22 11:46:43 +08:00
cuu e0e6a6e3e7 after forget,return to uplevel 2018-08-21 22:10:07 +08:00
cuu 47d08a5451 add delay after forget 2018-08-21 22:08:38 +08:00
cuu a7227fbadf add RemoveDevice bluetooth 2018-08-21 22:05:49 +08:00
cuu efb6cb8164 ... 2018-08-21 21:26:26 +08:00
cuu 500185fd9d ... 2018-08-21 21:21:09 +08:00
cuu 5eaa259ba3 add connect and disconnect 2018-08-21 21:17:34 +08:00
cuu eef5112f3e bluetooth 2018-08-21 15:06:09 +08:00
cuu cef6e9622e bluetooth 2018-08-21 15:03:17 +08:00
cuu a3b07ecadd bluetooth 2018-08-21 14:56:29 +08:00
cuu ac5cf8bb67 bluetooth 2018-08-21 14:53:05 +08:00
cuu b464c84277 bluetooth scan foot nav 2018-08-21 14:43:05 +08:00
cuu c7b1fbb30d add twm.mod 2018-08-21 14:29:29 +08:00
cuu ed1a6f3416 bluetooth scan box 2018-08-21 14:28:36 +08:00
cuu da2d61366f add bluetooth info page 2018-08-20 22:10:50 +08:00
cuu 586a76d37b fix rom alias name utf8,decode 2018-08-17 12:32:02 +08:00
cuu 315a9a12b1 bluetooth 2018-08-17 11:26:33 +08:00
zital 185330f4f2 folder order 2018-08-16 19:27:12 +02:00
cuu d245239e5d move keyboard out of wifi to be global UI parts 2018-08-16 21:23:16 +08:00
cuu 2a9bb59a35 start bluetooth 2018-08-16 21:20:00 +08:00
GNU 37e4d655b1 Merge pull request #96 from cuu/master
update gsnotify-arm
2018-08-12 22:02:31 +08:00
cuu e7dc439869 update gsnotify 2018-08-12 22:01:53 +08:00
cuu d3777d460d update gsnotify 2018-08-12 20:54:51 +08:00
cuu 81119eba34 update gsnotify-arm 2018-08-12 20:28:45 +08:00
GNU 514b08e1d6 Merge pull request #95 from cuu/master
update gsnotify
2018-08-12 19:33:37 +08:00
cuu 7b5eba3ed7 update gsnotify 2018-08-12 19:33:07 +08:00
GNU 97e9aa76d5 Merge pull request #86 from follower46/skin-cleanup
modify skin manager to allow instanced requests
2018-08-12 18:43:04 +08:00
GNU c317ba5d35 Merge pull request #94 from cuu/master
1.22
2018-08-12 16:00:43 +08:00
cuu 555cfd0c6d 1.22 2018-08-12 15:53:34 +08:00
cuu 0d0964eefe update gsnotify-arm 2018-08-12 15:52:03 +08:00
cuu bd6a30d35f update gsnotify-arm 2018-08-12 15:02:54 +08:00
cuu 7f5b30d5b3 update gsnotify 2018-08-12 14:29:23 +08:00
cuu 175ce6744a update gsnotify 2018-08-12 14:24:50 +08:00
cuu dce2cfa43f add gsnotify 2018-08-12 13:57:38 +08:00
GNU 2f92f62dae Merge pull request #92 from cuu/master
also add LK1 LK5 in PC object
2018-08-07 23:23:00 +08:00
cuu ca72939743 also add LK1 LK5 in PC object 2018-08-07 23:22:28 +08:00
GNU 33de507580 Merge pull request #91 from stephensaw/feature/keyboard-shift-key
Allow LK1 and LK5 to switch keyboard layout
2018-08-07 22:01:00 +08:00
Adam Shaw 544aafa959 Added remaining UI color changes 2018-08-06 23:35:52 -05:00
Stephen Saw 039e362b6d Allow LK1 and LK5 to switch keyboard layout 2018-08-07 01:43:23 +08:00
GNU 07e707a983 Merge pull request #90 from cuu/master
rom list decode utf8 to display cjk
2018-08-06 19:08:37 +08:00
cuu 9039646303 rom list decode utf8 to display cjk 2018-08-06 19:08:14 +08:00
GNU 84e21b9f38 Merge pull request #89 from cuu/master
missing :
2018-08-06 18:51:31 +08:00
cuu f9a6a74359 missing : 2018-08-06 18:51:05 +08:00
GNU f2e5858bd0 Merge pull request #87 from mfpierre/fix-typo
Remove typo and commented code
2018-08-06 10:08:02 +08:00
Pierre 07e7e2a5dc Remove typo and commented code 2018-08-05 21:53:06 +02:00
GNU 0b7f83dc62 Merge pull request #85 from neolao/master
Add EXCLUDE parameter for emulator config
2018-08-05 16:31:12 +08:00
Adam Shaw 47570323d8 Added simple global skin manager 2018-08-04 17:34:24 -05:00
neolao e6d2b43c25 Add EXCLUDE parameter for emulator config 2018-08-04 09:06:14 +00:00
GNU 6966fba1b4 Merge pull request #83 from follower46/wifi-extended-passwords
Added extended wifi passwords
2018-08-04 08:21:29 +08:00
GNU cdd7caebff Merge pull request #81 from neolao/master
Check item alias
2018-08-04 08:21:17 +08:00
Adam Shaw d09af8a674 Added extended wifi passwords 2018-08-03 15:47:11 -05:00
GNU 9c3286ad03 Merge pull request #82 from cuu/master
add connecting in wifi_list
2018-08-03 13:27:05 +08:00
cuu c0d314f9ef add connecting in wifi_list 2018-08-03 13:25:29 +08:00
neolao dac49f9df9 Check item alias 2018-08-02 12:36:53 +02:00
GNU d528510bca Merge pull request #79 from cuu/master
add escape
2018-07-31 11:18:39 +08:00
cuu d8be9845e4 add escape 2018-07-31 11:16:29 +08:00
GNU b0c11b5cc7 Merge pull request #78 from cuu/master
by auto detecting, ignore all *.cfg files now
2018-07-31 11:06:29 +08:00
cuu 90d7a545d6 by auto detecting, ignore all *.cfg files now 2018-07-31 11:04:16 +08:00
GNU 2276f9c1b2 Merge pull request #77 from cuu/master
mpd title list bug,auto detect retroarch-local.cfg as RETRO_CONFIG
2018-07-31 10:54:58 +08:00
cuu 5cd64c1b83 mpd title list bug,auto detect retroarch-local.cfg as RETRO_CONFIG 2018-07-31 10:54:21 +08:00
GNU fa5e474d3b Merge pull request #73 from tanrax/patch-1
Add gameboy and gameboy color support
2018-07-30 17:24:40 +08:00
Andros Fenollosa 1c3d598ffa Update action.config 2018-07-30 08:19:48 +02:00
GNU d1238a3176 Merge pull request #72 from cuu/master
add set power_save off
2018-07-30 13:50:04 +08:00
cuu c19e8bee59 add set power_save off 2018-07-29 16:04:19 +08:00
GNU 4ad8806fd1 Merge pull request #71 from cuu/master
1.21
2018-07-28 22:37:08 +08:00
cuu 36c55c08f8 1.21 2018-07-28 22:36:38 +08:00
GNU b65944ab37 Merge pull request #70 from cuu/master
update action.config
2018-07-28 22:35:10 +08:00
cuu 93983bc2f5 update action.config 2018-07-28 22:34:36 +08:00
GNU 1912b4e4af Merge pull request #69 from MrP1xel/master
Update __init__.py : adding an image
2018-07-28 10:13:51 +08:00
GNU f0fa9c8e56 Merge branch 'master' into master 2018-07-28 10:13:41 +08:00
GNU f762a10a62 Merge pull request #68 from follower46/master
Corrected broken Time binary file
2018-07-28 10:10:52 +08:00
GNU 843dda5570 Merge pull request #66 from QuantumKraken/patch-1
Update __init__.py
2018-07-28 10:10:42 +08:00
MrP1xel 19082db55a Update __init__.py
Add a picture when reboot
2018-07-27 23:43:41 +02:00
Adam Shaw 7e585ccfe4 Corrected broken Time binary file 2018-07-27 15:33:46 -05:00
QuantumKraken 41f7a04010 Update __init__.py 2018-07-27 12:56:32 -07:00
QuantumKraken 200339dddb Update __init__.py
This change adds the option to reboot with the "X" button
2018-07-27 12:55:12 -07:00
GNU 5dd47f599b Merge pull request #63 from 4k1/hotfix/v1.2_refactored
Removed unnecessary codes and fixed a bit
2018-07-27 20:47:42 +08:00
4k1 cb5b3e21ee Removed unnecessary codes and fixed a bit 2018-07-27 19:15:46 +09:00
GNU 2898fdbf68 Merge pull request #62 from cuu/master
...
2018-07-27 16:52:39 +08:00
cuu f498099b12 ... 2018-07-27 16:52:13 +08:00
GNU d8807f9386 Merge pull request #60 from follower46/master
Added Timezone selection
2018-07-27 14:44:33 +08:00
GNU 1454e43bcb Merge pull request #61 from cuu/master
spectrum adjust
2018-07-27 14:42:29 +08:00
cuu 3ace6b098b spectrum adjust 2018-07-27 14:42:03 +08:00
Adam Shaw 28584e361d Added Timezone selection 2018-07-27 00:07:45 -05:00
GNU c25c74a0bc Merge pull request #59 from cuu/master
modification in the music spectrum
2018-07-27 11:45:07 +08:00
cuu bf65f35f32 bw 10 2018-07-27 11:41:57 +08:00
cuu 7f83440229 bw 8 2018-07-27 11:24:44 +08:00
cuu 0863125269 ... 2018-07-27 11:24:15 +08:00
cuu 93d9f22b10 re-enable unix socket 2018-07-27 11:12:19 +08:00
cuu dcba607fc0 ... 2018-07-27 11:07:54 +08:00
cuu b6c142a2b9 ... 2018-07-27 11:02:48 +08:00
cuu f1961ee5d6 ... 2018-07-27 10:52:48 +08:00
cuu ce9261f409 spectrum modify 2018-07-27 10:45:07 +08:00
GNU 76b411388b Merge pull request #57 from 4k1/feature/forum#571_sync_ra_config
forum#571/Implemented to sync keymap for RetroArch
2018-07-27 09:31:10 +08:00
4k1 e7b3c881d0 forum#571/Implemented to sync keymap for RetroArch 2018-07-27 05:14:38 +09:00
268 changed files with 8096 additions and 4581 deletions
+27
View File
@@ -0,0 +1,27 @@
SCREEN=`cat /sys/class/graphics/fb0/modes`
XORG_CONF="~/launcher/.xorg.conf"
if [ -f /home/cpi/.lima ]
then
XORG_CONF="~/launcher/.xorg_lima.conf"
fi
if [ -f /tmp/autologin ]
then
rm -f /tmp/autologin
mpd ~/.mpd.conf
if [[ $SCREEN =~ .*320.* ]]
then
while :
do
startx /home/cpi/launcher/.xinitrc -- -xf86config $XORG_CONF -nocursor > /tmp/x.log 2>&1
sleep 1
done
else
while :
do
startx /home/cpi/launcher/.xinitrc hdmi -- -xf86config $XORG_CONF > /tmp/x.log 2>&1
sleep 1
done
fi
fi
+7
View File
@@ -5,3 +5,10 @@ retroarch-core-options.cfg
*.pyc
sys.py/.powerlevel
sys.py/.buttonslayout
sys.py/.lang
*.cfg
**/Jobs/*
!**/Jobs/.gitkeep
!**/Jobs/00_lowpower.sh
!**/Jobs/00_lowpower.alias
.done
+38
View File
@@ -0,0 +1,38 @@
#define Bach_width 51
#define Bach_height 60
static unsigned char Bach_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xfe,
0xf3, 0x07, 0x00, 0xf8, 0x00, 0x80, 0xff, 0xff, 0x1f, 0x00, 0xf8, 0x00,
0xe0, 0xff, 0xff, 0x3f, 0x00, 0xf8, 0x00, 0xf0, 0xff, 0xff, 0x7f, 0x00,
0xf8, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x00, 0xf8, 0x00, 0xf8, 0xff, 0xff,
0xff, 0x01, 0xf8, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x01, 0xf8, 0x00, 0xfe,
0xff, 0xff, 0xff, 0x03, 0xf8, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x07, 0xf8,
0x00, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf8, 0x80, 0xff, 0xff, 0xff, 0xbf,
0x07, 0xf8, 0x80, 0xff, 0xff, 0xff, 0x7f, 0x0f, 0xf8, 0x80, 0xff, 0xff,
0xff, 0x3f, 0x0f, 0xf8, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0x06, 0xf8, 0xc0,
0xff, 0xff, 0xff, 0x3f, 0x0e, 0xf8, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x1e,
0xf8, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x1c, 0xf8, 0xc0, 0xff, 0xff, 0xff,
0x7f, 0x3c, 0xf8, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x3c, 0xf8, 0xc0, 0xff,
0xff, 0xf8, 0x0f, 0x38, 0xf8, 0xc0, 0xff, 0xff, 0xc7, 0x23, 0x38, 0xf8,
0xe0, 0xff, 0xff, 0xc3, 0x01, 0x38, 0xf8, 0xe0, 0xff, 0xff, 0xf9, 0x03,
0x38, 0xf8, 0xe0, 0xff, 0xff, 0xff, 0x3b, 0x18, 0xf8, 0xc0, 0xff, 0xfb,
0xff, 0x33, 0x00, 0xf8, 0xc0, 0xff, 0xff, 0xff, 0xf7, 0x30, 0xf8, 0xe0,
0xff, 0xfd, 0xff, 0xe7, 0x00, 0xf8, 0xe0, 0xff, 0xfd, 0xff, 0x6f, 0x30,
0xf8, 0xc0, 0xff, 0xfc, 0xff, 0x67, 0x00, 0xf8, 0x80, 0xff, 0xfc, 0x7f,
0xc0, 0x00, 0xf8, 0xc0, 0xff, 0xf8, 0xff, 0x41, 0x00, 0xf8, 0xc0, 0xff,
0xf8, 0xff, 0x03, 0x00, 0xf8, 0x80, 0x7c, 0xf8, 0xff, 0x07, 0x00, 0xf8,
0x00, 0x7e, 0xf8, 0xff, 0x43, 0x00, 0xf8, 0x00, 0x7e, 0xf8, 0x0f, 0x00,
0x00, 0xf8, 0x00, 0x37, 0xf0, 0xff, 0x07, 0x00, 0xf8, 0x00, 0x63, 0xf0,
0xff, 0x01, 0x00, 0xf8, 0x00, 0x27, 0xf0, 0xff, 0x07, 0x00, 0xf8, 0x00,
0x06, 0xe0, 0xff, 0x0f, 0x00, 0xf8, 0x00, 0x02, 0x40, 0xff, 0x0f, 0x00,
0xf8, 0x00, 0x00, 0x90, 0xf1, 0x07, 0x00, 0xf8, 0x00, 0x00, 0x30, 0xff,
0x01, 0x00, 0xf8, 0x00, 0x00, 0xf0, 0x7e, 0x00, 0x00, 0xf8, 0x00, 0x00,
0xf0, 0x7b, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0xf8,
0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xe0, 0xff, 0x01,
0x00, 0xf8, 0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0xf8, 0x00, 0x00, 0xc0,
0xff, 0x0f, 0x00, 0xf8, 0x00, 0x00, 0xc0, 0xff, 0x07, 0x00, 0xf8, 0x00,
0x00, 0x80, 0xff, 0x03, 0x00, 0xf8, 0x00, 0x00, 0x80, 0xff, 0x00, 0x00,
0xf8, 0x00, 0x00, 0x80, 0xff, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x7f,
0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0xf8, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0xf8};
+62
View File
@@ -0,0 +1,62 @@
#define Escher_width 101
#define Escher_height 54
static unsigned char Escher_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x01, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0x01, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x7e, 0x07, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0x7f, 0x06, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x06, 0x00, 0x00, 0x00, 0xe0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x02, 0x00, 0x00, 0x00, 0xe0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00,
0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x80, 0x7f, 0x00, 0x00,
0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0xfe, 0xff, 0x0f,
0x00, 0x00, 0xe0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xe0, 0xff, 0xff,
0x7f, 0x00, 0x00, 0xe0, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x7f,
0x7f, 0xfc, 0x03, 0x00, 0xe0, 0xf8, 0x07, 0x00, 0x00, 0xc0, 0x87, 0xff,
0x6f, 0x5f, 0xee, 0x0f, 0x00, 0xe0, 0xf8, 0x1f, 0x00, 0x00, 0xf0, 0xf1,
0xff, 0xf9, 0xe9, 0xfc, 0x3e, 0x00, 0xe0, 0xf8, 0x3f, 0x00, 0x00, 0x3c,
0xf8, 0xaf, 0xe8, 0x1d, 0xe0, 0x70, 0x00, 0xe0, 0xf8, 0x7f, 0x00, 0x00,
0x3e, 0xbf, 0xac, 0x88, 0x1f, 0x00, 0x3e, 0x00, 0xe0, 0xf0, 0x0f, 0x00,
0x00, 0x97, 0x3f, 0xac, 0xc2, 0x81, 0x01, 0xbf, 0x03, 0xe0, 0xf0, 0x1f,
0x00, 0xc0, 0xe7, 0xa3, 0x00, 0xca, 0x15, 0x80, 0xc7, 0x07, 0xe0, 0xe0,
0x1f, 0x00, 0x80, 0xf1, 0x02, 0x4a, 0x88, 0x50, 0x80, 0xe3, 0x0c, 0xe0,
0xc0, 0x1f, 0x1c, 0x00, 0x3c, 0x08, 0x28, 0x55, 0x20, 0xc0, 0xf1, 0x3f,
0xe0, 0xc0, 0x1f, 0xf0, 0x80, 0x0f, 0x68, 0x51, 0x50, 0xb4, 0xe0, 0xb1,
0x7e, 0xe0, 0x80, 0x1f, 0xc0, 0xff, 0x03, 0x80, 0x54, 0x29, 0x00, 0xe8,
0xb9, 0xfc, 0xe0, 0x00, 0x3f, 0x82, 0x3f, 0x28, 0x15, 0x00, 0x20, 0x2a,
0xe0, 0xb9, 0xe7, 0xe1, 0x00, 0x3e, 0x0a, 0x20, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xe2, 0x79, 0xb3, 0xe3, 0x00, 0x3e, 0x80, 0x00, 0x40, 0x08, 0x80,
0x40, 0x01, 0xe0, 0xf9, 0xb8, 0xe3, 0x00, 0x3e, 0x01, 0x00, 0x50, 0x08,
0x00, 0x08, 0x40, 0xe0, 0xf9, 0xff, 0xe1, 0x00, 0x3e, 0x01, 0x00, 0x00,
0x00, 0x50, 0x81, 0xf0, 0xc3, 0xf9, 0xee, 0xe0, 0x00, 0x1e, 0x02, 0x08,
0x0a, 0x01, 0x00, 0x20, 0xf0, 0xc7, 0xfb, 0x7f, 0xe2, 0x00, 0x0f, 0x02,
0xbc, 0x03, 0x00, 0x0a, 0x00, 0xf0, 0xc1, 0xfb, 0xbf, 0xe3, 0x80, 0x07,
0xf0, 0xff, 0xc3, 0x02, 0x80, 0x41, 0xf1, 0x81, 0xf7, 0xf7, 0xe1, 0x80,
0x07, 0x3c, 0xc0, 0xbf, 0x5c, 0x09, 0x40, 0xf0, 0x83, 0xff, 0x7f, 0xe0,
0xc0, 0x13, 0x00, 0x00, 0xf8, 0x0f, 0x80, 0x92, 0xf0, 0x0f, 0x0f, 0x3e,
0xe0, 0xe0, 0x1f, 0x00, 0x00, 0xe3, 0x5f, 0x21, 0x16, 0xe0, 0x2f, 0xfe,
0x17, 0xe0, 0xf0, 0x1f, 0x00, 0x80, 0x01, 0xfe, 0x27, 0x0e, 0xe0, 0x27,
0xf8, 0x10, 0xe0, 0xf0, 0x07, 0x00, 0x80, 0x1b, 0xf0, 0x07, 0xe8, 0x8a,
0x15, 0x02, 0x00, 0xe0, 0xf8, 0x03, 0x00, 0x80, 0x1f, 0x80, 0xff, 0x6a,
0x00, 0xc0, 0x01, 0x00, 0xe0, 0xf8, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0xf8,
0x3f, 0xfe, 0x7f, 0x00, 0x00, 0xe0, 0xf8, 0x07, 0x00, 0x00, 0x47, 0x00,
0x00, 0x1c, 0xfc, 0x0f, 0x00, 0x00, 0xe0, 0xf8, 0x01, 0x00, 0x00, 0x3f,
0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf8, 0x00, 0x00, 0x00,
0x3e, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x08, 0x00, 0x00, 0x00, 0xe0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x07, 0x00, 0x00, 0x00, 0xe0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00,
0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00,
0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00,
0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xe0};
+46
View File
@@ -0,0 +1,46 @@
#define Linux64_width 64
#define Linux64_height 64
static unsigned char Linux64_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x0f, 0x00, 0x00,
0x00, 0x00, 0xf8, 0x1f, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01,
0xc0, 0xff, 0x00, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0xfe, 0x01, 0x00,
0x00, 0xc0, 0x1f, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
0x00, 0xf0, 0x0f, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xc0, 0x1f, 0x00,
0x00, 0xf8, 0x01, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0xfc, 0x01, 0x00,
0x00, 0x80, 0x7f, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x7f, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x01, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x03,
0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x03, 0xc0, 0x7f, 0x00, 0x00,
0x00, 0x00, 0xfc, 0x07, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07,
0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0xe0, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xf8, 0x0f, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f,
0xf0, 0x3f, 0x00, 0x00, 0xe0, 0x01, 0xf0, 0x1f, 0xf0, 0x3f, 0xe0, 0x00,
0xf8, 0x01, 0xf0, 0x1f, 0xf0, 0x3f, 0xf0, 0x01, 0xfc, 0x03, 0xf0, 0x1f,
0xf0, 0x3f, 0xf8, 0x03, 0xfe, 0x03, 0xf0, 0x1f, 0xf8, 0x7f, 0x18, 0x07,
0x0f, 0x07, 0xf0, 0x3f, 0xf8, 0x7f, 0x08, 0x07, 0x47, 0x0e, 0xf0, 0x3f,
0xf8, 0x7f, 0x08, 0x06, 0x07, 0x0e, 0xf0, 0x3f, 0xf8, 0x7f, 0x88, 0x06,
0x07, 0x0e, 0xf0, 0x3f, 0xf8, 0x7f, 0x08, 0x06, 0x06, 0x0e, 0xf0, 0x3f,
0xf8, 0x7f, 0x08, 0xfe, 0x04, 0x0e, 0xf0, 0x3f, 0xf8, 0x7f, 0x18, 0x7c,
0x06, 0x0e, 0xf0, 0x3f, 0xf8, 0xff, 0x30, 0xff, 0x9f, 0x07, 0xf0, 0x3f,
0xf8, 0xff, 0x90, 0xff, 0x7f, 0x03, 0xf0, 0x3f, 0xf0, 0xff, 0xc0, 0xff,
0xff, 0x03, 0xe0, 0x1f, 0xf0, 0xff, 0xc0, 0xff, 0xff, 0x07, 0xe0, 0x1f,
0xf0, 0xff, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0x1f, 0xf0, 0xff, 0xe0, 0xff,
0x7f, 0x06, 0xe0, 0x1f, 0xe0, 0xff, 0xe0, 0xff, 0x9f, 0x07, 0xe0, 0x0f,
0xe0, 0xff, 0xe0, 0xff, 0xcf, 0x07, 0xc0, 0x0f, 0xe0, 0xff, 0xc1, 0xff,
0xf3, 0x01, 0xc0, 0x0f, 0xc0, 0xff, 0x01, 0x7f, 0x7c, 0x0c, 0xc0, 0x07,
0xc0, 0xff, 0x19, 0x80, 0x9f, 0x0f, 0x80, 0x07, 0x80, 0xff, 0x39, 0xfc,
0xc7, 0x0f, 0x00, 0x03, 0x80, 0xff, 0x78, 0x78, 0xf0, 0x1f, 0x00, 0x03,
0x00, 0x7f, 0xf8, 0x00, 0xf8, 0x1f, 0x80, 0x01, 0x00, 0x3e, 0xf8, 0x03,
0xfe, 0x3f, 0x80, 0x01, 0x00, 0x3e, 0xf8, 0xff, 0xff, 0x3f, 0xc0, 0x00,
0x00, 0x1c, 0xf8, 0xff, 0xff, 0x7f, 0x60, 0x00, 0x00, 0x18, 0xfc, 0xff,
0xff, 0x7f, 0x30, 0x00, 0x00, 0x30, 0xfc, 0xff, 0xff, 0xff, 0x18, 0x00,
0x00, 0x60, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x00, 0x00, 0xc0, 0xff, 0xff,
0xff, 0xff, 0x06, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x0f, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+14
View File
@@ -0,0 +1,14 @@
#define am_width 32
#define am_height 32
static unsigned char am_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00,
0x63, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x7f, 0x1f, 0x00, 0x7c,
0x63, 0x3f, 0x00, 0x7e, 0x63, 0x7f, 0x00, 0x7f, 0x63, 0xff, 0x80, 0x7f,
0x63, 0xff, 0xc1, 0x7f, 0x00, 0xff, 0xe3, 0x7f, 0x00, 0xff, 0xf7, 0x7f,
0x00, 0xef, 0xff, 0x7b, 0x00, 0xcf, 0xff, 0x79, 0x00, 0x8f, 0xff, 0x78,
0x00, 0x0f, 0x7f, 0x78, 0x00, 0x0f, 0x3e, 0x78, 0x00, 0x0f, 0x1c, 0x78,
0x00, 0x0f, 0x08, 0x78, 0x00, 0x0f, 0x00, 0x78, 0x00, 0x0f, 0x00, 0x78,
0x00, 0x0f, 0x00, 0x78, 0x00, 0x0f, 0x00, 0x78, 0x00, 0x0f, 0x00, 0x78,
0x00, 0x0e, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+52
View File
@@ -0,0 +1,52 @@
#define Untitled_width 57
#define Untitled_height 73
static unsigned char Untitled_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0xf0,
0x07, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00,
0x00, 0x1f, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0xf8,
0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00,
0x00, 0xfc, 0x01, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xfc,
0x03, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x4f, 0xfe, 0x03, 0x00, 0x00, 0x00,
0x00, 0xf8, 0xdf, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x9f, 0xff,
0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff,
0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x9f,
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0x1f, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x8e, 0x0f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0f,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x3f, 0x06, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc6, 0x7e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x3e,
0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x1f, 0x0e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0e, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0xff,
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x3f, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x80, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff,
0xff, 0xff, 0x01, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xc0, 0xff, 0xff, 0xff,
0xff, 0xff, 0x03, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x80, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x80, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x01, 0x00,
0x00, 0x1f, 0xfe, 0xff, 0xff, 0x40, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff,
0xff, 0xff, 0x3f, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xfc, 0xff, 0xff, 0xff,
0xff, 0xff, 0x7f, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xf8, 0xff, 0xff, 0xff,
0xff, 0xff, 0x7f, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xf8, 0xff, 0x07, 0xff,
0xfb, 0xff, 0x7f, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00,
0xf0, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+5
View File
@@ -0,0 +1,5 @@
#define close_width 11
#define close_height 11
static unsigned char close_bits[] = {
0x00, 0x00, 0x06, 0x03, 0x8e, 0x03, 0xdc, 0x01, 0xf8, 0x00, 0x70, 0x00,
0xf8, 0x00, 0xdc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x00, 0x00};
+14
View File
@@ -0,0 +1,14 @@
#define ff_width 32
#define ff_height 32
static unsigned char ff_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f,
0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1f,
0xe0, 0xff, 0x3f, 0x1f, 0xf0, 0xff, 0x3f, 0x03, 0xf0, 0xff, 0x3f, 0x1f,
0xf0, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
0xf0, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x0f, 0x00,
0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
0xf0, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+5
View File
@@ -0,0 +1,5 @@
#define fullsize_width 11
#define fullsize_height 11
static unsigned char fullsize_bits[] = {
0x00, 0x00, 0xfc, 0x01, 0xfe, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0xfc, 0x01, 0x00, 0x00};
+5
View File
@@ -0,0 +1,5 @@
#define icon_width 11
#define icon_height 11
static unsigned char icon_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x02, 0x02, 0x02, 0x02,
0xfe, 0x03, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+28
View File
@@ -0,0 +1,28 @@
#define moose_width 45
#define moose_height 49
static unsigned char moose_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x00,
0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00,
0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00,
0x00, 0x1f, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x0f, 0x00, 0x00,
0x00, 0x07, 0xf1, 0x03, 0x00, 0x00, 0x00, 0x87, 0x71, 0x00, 0x00, 0x00,
0x00, 0xb7, 0x70, 0x00, 0x00, 0x00, 0x00, 0x57, 0x70, 0x00, 0x00, 0x00,
0x00, 0xe7, 0x71, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x71, 0x00, 0x00, 0x00,
0x00, 0x3f, 0x78, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00,
0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00,
0xf8, 0xff, 0xf1, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0xf0, 0x51, 0x00, 0x00,
0xbe, 0x3f, 0xe0, 0xff, 0x03, 0x00, 0x3e, 0x3f, 0xc0, 0xff, 0x07, 0x00,
0x1e, 0x3d, 0xc0, 0xff, 0x0f, 0x00, 0x9e, 0x3c, 0xc0, 0xff, 0x1f, 0x08,
0x5e, 0x3e, 0xc0, 0xff, 0xff, 0x07, 0x7c, 0x3e, 0xe0, 0xff, 0xff, 0x01,
0xf8, 0x3f, 0xf0, 0xff, 0x7f, 0x00, 0xf0, 0x1f, 0xf8, 0xff, 0x3f, 0x00,
0xe0, 0x0f, 0xff, 0xff, 0x3f, 0x00, 0x80, 0x87, 0xff, 0xff, 0x1f, 0x00,
0x00, 0xc0, 0xe3, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0xfb, 0xff, 0x1f, 0x00,
0x00, 0xc0, 0x7d, 0xf8, 0x0f, 0x00, 0x00, 0xe0, 0x3c, 0xf8, 0x07, 0x00,
0x00, 0xf8, 0x0c, 0xf8, 0x07, 0x00, 0x00, 0xfc, 0x1c, 0x98, 0x03, 0x00,
0x00, 0xdc, 0x1c, 0x98, 0x03, 0x00, 0x00, 0xf8, 0x3c, 0x38, 0x07, 0x00,
0x00, 0x70, 0x3c, 0x78, 0x1f, 0x00, 0x00, 0x00, 0x6c, 0xf8, 0xfe, 0x00,
0x00, 0x00, 0x6e, 0xf0, 0xfd, 0x00, 0x00, 0x00, 0x3e, 0xb0, 0xfb, 0x00,
0x00, 0x00, 0x0c, 0xe0, 0x79, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+14
View File
@@ -0,0 +1,14 @@
#define mozilla_width 32
#define mozilla_height 32
static unsigned char mozilla_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x3f, 0x02, 0xf0, 0xff, 0x7f,
0x01, 0xe2, 0xff, 0xff, 0xd9, 0xc4, 0xff, 0xff, 0xd9, 0x88, 0xff, 0xff,
0x5b, 0x16, 0xff, 0xff, 0x2f, 0x76, 0xfc, 0xff, 0x4f, 0xe4, 0xe0, 0xff,
0x19, 0xff, 0x87, 0xff, 0x31, 0xf8, 0x1f, 0xfe, 0xe3, 0xff, 0x7f, 0xf8,
0x83, 0xff, 0xff, 0xe1, 0x07, 0xff, 0xff, 0xc7, 0x0d, 0xfe, 0xff, 0x87,
0x0d, 0xfc, 0xff, 0x83, 0x09, 0xf0, 0xff, 0x81, 0x01, 0xe0, 0xff, 0x81,
0x01, 0xc0, 0xff, 0x93, 0x01, 0x00, 0xff, 0xb3, 0x01, 0x00, 0xfc, 0xbf,
0x01, 0x20, 0xe0, 0xbf, 0x03, 0x00, 0x00, 0x9c, 0x07, 0x00, 0x04, 0x80,
0x1f, 0x00, 0x18, 0x80, 0xff, 0x03, 0x40, 0xc1, 0xff, 0x3b, 0x00, 0xc0,
0x3f, 0xe0, 0x03, 0xe0, 0x01, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x1c, 0xf8,
0x02, 0x80, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f};
+5
View File
@@ -0,0 +1,5 @@
#define resize_width 11
#define resize_height 11
static unsigned char resize_bits[] = {
0x00, 0x00, 0xfc, 0x00, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
0x02, 0x03, 0x02, 0x03, 0xfc, 0x03, 0xf8, 0x01, 0x00, 0x00};
+27
View File
@@ -0,0 +1,27 @@
#define torrent_width 48
#define torrent_height 48
static unsigned char torrent_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00,
0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x0f,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x80, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00,
0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01,
0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00,
0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+14
View File
@@ -0,0 +1,14 @@
#define Untitled_width 32
#define Untitled_height 32
static unsigned char Untitled_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x1c, 0x00,
0x00, 0x36, 0x3e, 0x00, 0x00, 0x32, 0x33, 0x00, 0x00, 0x26, 0x1b, 0x00,
0x00, 0x6c, 0x19, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0xf0, 0x07, 0x00,
0x80, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0x01, 0xe0, 0x07,
0xe0, 0x00, 0xc0, 0x07, 0xe0, 0x0c, 0xc6, 0x07, 0xe0, 0x0c, 0xc6, 0x07,
0xe0, 0x00, 0xc0, 0x07, 0xe0, 0x00, 0xc0, 0x07, 0xe0, 0x00, 0xc0, 0x07,
0xe0, 0xf0, 0xc3, 0x07, 0xe0, 0xe0, 0xc1, 0x07, 0xe0, 0x00, 0x20, 0x06,
0xe0, 0x01, 0x20, 0x06, 0xe0, 0xff, 0x3f, 0x06, 0xe0, 0xff, 0xff, 0x07,
0xc0, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x00, 0x00, 0x03, 0x20, 0x00,
0x00, 0x03, 0x60, 0x00, 0x80, 0x03, 0x60, 0x00, 0x00, 0x01, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+14
View File
@@ -0,0 +1,14 @@
#define xlogo32_width 32
#define xlogo32_height 32
static unsigned char xlogo32_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfc, 0x03, 0x00, 0x20, 0xf8, 0x07, 0x00, 0x30, 0xf8, 0x07, 0x00, 0x18,
0xf0, 0x0f, 0x00, 0x0c, 0xe0, 0x1f, 0x00, 0x06, 0xc0, 0x3f, 0x00, 0x06,
0xc0, 0x3f, 0x00, 0x03, 0x80, 0x7f, 0x80, 0x01, 0x00, 0xff, 0xc0, 0x00,
0x00, 0xfe, 0x61, 0x00, 0x00, 0xfe, 0x31, 0x00, 0x00, 0xfc, 0x33, 0x00,
0x00, 0xf8, 0x1b, 0x00, 0x00, 0xf0, 0x0d, 0x00, 0x00, 0xf0, 0x0e, 0x00,
0x00, 0x60, 0x1f, 0x00, 0x00, 0xb0, 0x3f, 0x00, 0x00, 0x98, 0x7f, 0x00,
0x00, 0x98, 0x7f, 0x00, 0x00, 0x0c, 0xff, 0x00, 0x00, 0x06, 0xfe, 0x01,
0x00, 0x03, 0xfc, 0x03, 0x80, 0x01, 0xfc, 0x03, 0xc0, 0x00, 0xf8, 0x07,
0xc0, 0x00, 0xf0, 0x0f, 0x60, 0x00, 0xe0, 0x1f, 0x30, 0x00, 0xe0, 0x1f,
0x18, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00};
+140
View File
@@ -0,0 +1,140 @@
#---------------------------------
# CPI # PROJ. : twmrc
# # FILE : .twmrc
# + # VER. : 20170828.0718UTC
# + # EMAIL : hal@clockworkpi.com
# +++ # HOST : clockworkpi.com
#---------------------------------
NoGrabServer
RestartPreviousState
DecorateTransients
RandomPlacement
BorderWidth 1
NoHighlight
OpaqueMove
MenuBorderWidth 1
NoMenuShadows
NoDefaults
LeftTitleButton "~/launcher/.twm/close" = f.delete
RightTitleButton "~/launcher/.twm/iconify" = f.iconify
RightTitleButton "~/launcher/.twm/resize" = f.resize
RightTitleButton "~/launcher/.twm/fullsize" = f.fullzoom
TitleFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
ResizeFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
MenuFont "-misc-fixed-medium-r-semicondensed-*-*-120-*-*-c-*-iso8859-8"
IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*"
Color
{
BorderColor "grey30"
DefaultBackground "rgb:5/5/5"
DefaultForeground "gray80"
TitleBackground "rgb:5/5/5"
TitleForeground "gray80"
MenuBackground "rgb:5/5/5"
MenuForeground "gray80"
MenuTitleBackground "gray80"
MenuTitleForeground "rgb:5/5/5"
MenuBorderColor "gray60"
IconBackground "rgb:4/4/4"
IconForeground "gray80"
IconBorderColor "gray70"
IconManagerBackground "rgb:5/5/5"
IconManagerForeground "gray80"
}
Cursors
{
Menu "hand2"
}
ForceIcons
Icons
{
"Chrome" "~/launcher/.twm/chrome.xbm"
"xterm" "~/launcher/.twm/xlogo32"
}
MoveDelta 3
Function "move-or-lower" { f.move f.deltastop f.lower }
Function "move-or-raise" { f.move f.deltastop f.raise }
Function "move-or-iconify" { f.move f.deltastop f.iconify }
Button1 = : root : f.menu "main"
Button3 = : root : f.menu "exec"
Button1 = m : window|icon : f.function "move-or-raise"
Button2 = m : window|icon : f.iconify
Button3 = m : window|icon : f.resize
Button1 = : title : f.function "move-or-raise"
Button2 = : title : f.raiselower
Button1 = : icon : f.function "move-or-iconify"
Button2 = : icon : f.iconify
Button1 = : iconmgr : f.iconify
Button2 = : iconmgr : f.iconify
NoTitle
{
"gkrellm"
}
menu "main"
{
"CLOCKWORKPI" f.title
"Raise" f.raise
"Lower" f.lower
"Focus" f.focus
"Unfocus" f.unfocus
"-------------" f.nop
"Show Iconmgr" f.showiconmgr
"Hide Iconmgr" f.hideiconmgr
"Kill" f.destroy
"-------------" f.nop
"Restart" f.restart
"Exit" ("gray80":"#773333") f.menu "exit"
}
menu "exit"
{
"Are you sure ?" ("gray80":"#773333") f.title
"No" f.nop
"Yes" f.quit
}
menu "exec"
{
":: Applications ::" f.title
"Xterm" ("gray80":"#334455") f.exec "exec /usr/bin/xterm &"
"Xterm Orange" ("gray80":"#aa5522") f.exec "exec /usr/bin/xterm -fg '#dc8700' &"
"Xmag" f.exec "exec /usr/bin/xmag &"
"Gkrellm" f.exec "/usr/bin/gkrellm &"
"XClock" f.exec "exec /usr/bin/xclock &"
"XFig" f.exec "exec /usr/bin/xfig -nosplash &"
"Wicd client" f.exec "exec /usr/bin/wicd-client -n &"
"xpdf" f.exec "exec /usr/bin/xpdf &"
}
WindowRing
{
"xterm"
"xpdf"
}
"r" = m | c: all : f.exec "exec /usr/bin/xterm -fg '#dc8700' &"
"s" = m | c: all : f.exec "exec /usr/bin/alsamixergui &"
"t" = m | c: all : f.exec "exec /usr/bin/xterm +sb &"
"w" = m | c: all : f.exec "exec /usr/bin/wicd-client -n &"
"i" = m | s: all : f.iconify
"x" = m | s: all : f.delete
"F12" = m : all : f.fullzoom
"Tab" = m : all : f.warpring "next"
+21
View File
@@ -0,0 +1,21 @@
session=${1:-gameshell}
case $session in
hdmi )
feh --bg-center ~/launcher/sys.py/gameshell/wallpaper/desktopbg.jpg
exec ~/launcher/load.sh &
exec ~/launcher/sys.py/gsnotify/gsnotify-arm daemon &
#exec /usr/bin/twm -f ~/launcher/.twmrc
exec ~/launcher/dwm-mod
;;
gameshell )
feh --bg-center ~/launcher/sys.py/gameshell/wallpaper/loading.png
exec ~/launcher/load.sh &
exec ~/launcher/sys.py/gsnotify/gsnotify-arm &
#exec awesome -c ~/launcher/awesome/rc.lua
exec ~/launcher/dwm-mod -w
;;
*)
exec $1;;
esac
+7
View File
@@ -0,0 +1,7 @@
Section "Device"
Identifier "Allwinner A10/A13 FBDEV"
Driver "fbturbo"
Option "fbdev" "/dev/fb0"
Option "SwapbuffersWait" "true"
EndSection
+7
View File
@@ -0,0 +1,7 @@
Section "Device"
Identifier "Allwinner A10/A13 FBDEV"
Driver "modesetting"
Option "fbdev" "/dev/fb0"
Option "SwapbuffersWait" "true"
EndSection
+4 -4
View File
@@ -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>.
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
love MANUAL.love gameshell
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
love OPERATION.love gameshell
Binary file not shown.
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
love MAIL.love gameshell
@@ -1,174 +0,0 @@
# -*- coding: utf-8 -*-
import pygame
import commands
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.fonts import fonts
from UI.util_funcs import midRect
from UI.keys_def import CurKeys
from UI.scroller import ListScroller
from UI.icon_pool import MyIconPool
from UI.icon_item import IconItem
from UI.multi_icon_item import MultiIconItem
from UI.multilabel import MultiLabel
class ButtonsLayoutPage(Page):
_FootMsg = ["Nav.","","","Back","Toggle"]
_MyList = []
_ListFontObj = fonts["varela13"]
_AList = {}
_Scrolled = 0
_BGwidth = 320
_BGheight = 240-24-20
_DrawOnce = False
_Scroller = None
_EasingDur = 30
_dialog_index = 0
def __init__(self):
Page.__init__(self)
self._Icons = {}
def GenList(self):
self._MyList = []
def Init(self):
if self._Screen != None:
if self._Screen._CanvasHWND != None and self._CanvasHWND == None:
self._HWND = self._Screen._CanvasHWND
self._CanvasHWND = pygame.Surface( (self._Screen._Width,self._BGheight) )
self._PosX = self._Index*self._Screen._Width
self._Width = self._Screen._Width ## equal to screen width
self._Height = self._Screen._Height
DialogBoxs = MultiIconItem()
DialogBoxs._ImgSurf = MyIconPool._Icons["buttonslayout"]
DialogBoxs._MyType = ICON_TYPES["STAT"]
DialogBoxs._Parent = self
DialogBoxs._IconWidth = 300
DialogBoxs._IconHeight = 150
DialogBoxs.Adjust(0,0,134,372,0)
self._Icons["DialogBoxs"] = DialogBoxs
self.GenList()
self._Scroller = ListScroller()
self._Scroller._Parent = self
self._Scroller._PosX = self._Width - 10
self._Scroller._PosY = 2
self._Scroller.Init()
self._Scroller.SetCanvasHWND(self._HWND)
def ScrollDown(self):
dis = 10
if abs(self._Scrolled) < (self._BGheight - self._Height)/2 + 0:
self._PosY -= dis
self._Scrolled -= dis
def ScrollUp(self):
dis = 10
if self._PosY < 0:
self._PosY += dis
self._Scrolled += dis
def GetButtonsLayoutMode(self):
lm = "xbox"
try:
with open(".buttonslayout", "r") as f:
lm = f.read()
except:
None
if lm not in ["xbox","snes"]:
lm = "xbox"
return lm
def ToggleMode(self):
if self.GetButtonsLayoutMode() == "xbox":
with open(".buttonslayout", "w") as f:
f.write("snes")
self._dialog_index = 1
self._Screen.Draw()
self._Screen.SwapAndShow()
else:
with open(".buttonslayout", "w") as f:
f.write("xbox")
self._dialog_index = 0
self._Screen.Draw()
self._Screen.SwapAndShow()
def OnLoadCb(self):
self._Scrolled = 0
self._PosY = 0
self._DrawOnce = False
if self.GetButtonsLayoutMode() == "xbox":
self._dialog_index = 0
else:
self._dialog_index = 1
def OnReturnBackCb(self):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
def KeyDown(self,event):
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["B"]:
self.ToggleMode()
def Draw(self):
self.ClearCanvas()
self._Icons["DialogBoxs"].NewCoord(0,30)
self._Icons["DialogBoxs"]._IconIndex = self._dialog_index
self._Icons["DialogBoxs"].DrawTopLeft()
if self._HWND != None:
self._HWND.fill((255,255,255))
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )
class APIOBJ(object):
_Page = None
def __init__(self):
pass
def Init(self,main_screen):
self._Page = ButtonsLayoutPage()
self._Page._Screen = main_screen
self._Page._Name ="Buttons Layout"
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)
@@ -1,172 +0,0 @@
# -*- coding: utf-8 -*-
import pygame
#from libs.roundrects import aa_round_rect
import alsaaudio
## local UI import
from UI.constants import Width,Height,ICON_TYPES
from UI.page import Page,PageSelector
from UI.icon_item import IconItem
from UI.label import Label
from UI.fonts import fonts
from UI.util_funcs import midRect
from UI.keys_def import CurKeys
from UI.slider import Slider
from UI.multi_icon_item import MultiIconItem
from UI.icon_pool import MyIconPool
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] ]
def __init__(self):
Slider.__init__(self)
def Init(self):
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)
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
def Further(self):
self._Value+=1
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.OnChangeCB != None:
if callable(self.OnChangeCB):
self.OnChangeCB( vol )
def StepBack(self):
self._Value-=1
if self._Value < 0:
self._Value = 0
vol = self.snd_segs[self._Value][0]
if self.OnChangeCB != None:
if callable(self.OnChangeCB):
self.OnChangeCB( vol )
def Draw(self):
self._BGpng.NewCoord(self._Width/2,self._Height/2 )
self._BGpng.Draw()
self._Scale.NewCoord(self._Width/2,self._Height/2)
self._Scale._IconIndex = self._Value
self._Scale.Draw()
class SoundPage(Page):
_MySlider = None
_FootMsg = ["Nav","","","Back","Enter"]
def Init(self):
self._CanvasHWND = self._Screen._CanvasHWND
self._Width = self._Screen._Width
self._Height = self._Screen._Height
self._MySlider = SoundSlider()
self._MySlider._Parent = self
self._MySlider.SetCanvasHWND(self._CanvasHWND)
self._MySlider.OnChangeCB = self.WhenSliderDrag
self._MySlider.Init()
try:
m = alsaaudio.Mixer()
self._MySlider.SetValue(m.getvolume()[0])
except Exception,e:
print(str(e))
self._MySlider.SetValue(0)
def OnLoadCb(self):
try:
m = alsaaudio.Mixer()
self._MySlider.SetValue(m.getvolume()[0])
except Exception,e:
print(str(e))
def WhenSliderDrag(self,value): ##value 0-100
if value < 0 or value > 100:
return
m = alsaaudio.Mixer()
m.setvolume(int(value))
def KeyDown(self,event):
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Right"]:
self._MySlider.Further()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Left"]:
self._MySlider.StepBack()
self._Screen.Draw()
self._Screen.SwapAndShow()
def Draw(self):
self.ClearCanvas()
self._MySlider.Draw()
@@ -1,6 +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
SO_URL=http://buildbot.libretro.com/nightly/linux/armhf/latest/mame2003_plus_libretro.so.zip
File diff suppressed because it is too large Load Diff
@@ -1,6 +0,0 @@
ROM=/home/cpi/games/MGBA
ROM_SO=/home/cpi/apps/emulators/mgba_libretro.so
EXT=gba,gbx
LAUNCHER=retroarch -L
TITLE=MGBA Roms
SO_URL=http://buildbot.libretro.com/nightly/linux/armhf/latest/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=http://buildbot.libretro.com/nightly/linux/armhf/latest/nestopia_libretro.so.zip
@@ -7,9 +7,9 @@ from libs.roundrects import aa_round_rect
from UI.constants import ICON_TYPES
from UI.page import Page
from UI.label import Label
from UI.fonts import fonts
from UI.icon_item import IconItem
from UI.util_funcs import midRect
from UI.skin_manager import MySkinManager
# a item for List
# - - - - - - - - - - - --
@@ -31,7 +31,7 @@ class ListItemIcon(IconItem):
class ListItemLabel(Label):
_ActiveColor = pygame.Color(175,90,0)
_ActiveColor = MySkinManager.GiveColor('Active')
_Active = False
def Draw(self):
@@ -116,7 +116,7 @@ class ListItem(object):
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
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)
if self._Playing == True:
self._Labels["Text"]._Active =True
@@ -127,7 +127,7 @@ class ListItem(object):
if self._PlayingProcess > 0:
seek_posx = int(self._Width * self._PlayingProcess/100.0)
pygame.draw.line(self._Parent._CanvasHWND,(255,169,169),(self._PosX,self._PosY+self._Height-2),(self._PosX+seek_posx,self._PosY+self._Height-2),2)
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Active'),(self._PosX,self._PosY+self._Height-2),(self._PosX+seek_posx,self._PosY+self._Height-2),2)
else:
self._Labels["Text"].Draw()
@@ -15,11 +15,12 @@ from beeprint import pp
from UI.constants import Width,Height,ICON_TYPES
from UI.page import Page,PageSelector
from UI.label import Label
from UI.fonts import fonts
from UI.util_funcs import midRect
from UI.keys_def import CurKeys
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.icon_item import IconItem
from UI.icon_pool import MyIconPool
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from threading import Thread
@@ -34,21 +35,27 @@ class PIFI(object):
_FIRST_SELECTED_BIN = 5
_NUMBER_OF_SELECTED_BINS = 1024
_samples_buffer = None
def __init__(self):
self.sampleSize = self._SAMPLE_SIZE
self.samplingRate = self._SAMPLING_RATE
def GetSpectrum(self,fifoFile,trim_by=10,log_scale=False,div_by=100):
def GetSpectrum(self,fifoFile,trim_by=4,log_scale=False,div_by=100):
try:
rawSamples = os.read(fifoFile,self.sampleSize) # will return empty lines (non-blocking)
if len(rawSamples) < 1:
# print("Read error")
return rawSamples
# print("Read error")
pass
else:
self._samples_buffer = rawSamples
except Exception,e:
pass
if self._samples_buffer == None:
return ""
data = numpy.fromstring(rawSamples, dtype=numpy.int16)
data = numpy.fromstring(self._samples_buffer, dtype=numpy.int16)
data = data * numpy.hanning(len(data))
@@ -72,11 +79,11 @@ class MPDSpectrumPage(Page):
_Selector=None
_FootMsg = ["Nav","","","Back",""]
_MyList = []
_ListFont = fonts["veramono12"]
_SongFont = fonts["notosanscjk12"]
_ListFont = MyLangManager.TrFont("veramono12")
_SongFont = MyLangManager.TrFont("notosanscjk12")
_PIFI = None
_FIFO = None
_Color = pygame.Color(126,206,244)
_Color = MySkinManager.GiveColor('Front')
_GobjectIntervalId = -1
_Queue = None
_KeepReading = True
@@ -156,21 +163,22 @@ class MPDSpectrumPage(Page):
self._song_title = Label()
self._song_title.SetCanvasHWND(self._RollCanvas)
self._song_title.Init("Untitled",self._SongFont,(255,255,255))
self._song_title.Init("Untitled",self._SongFont,MySkinManager.GiveColor('Text'))
self._title = Label()
self._title.SetCanvasHWND(self._CanvasHWND)
self._title.Init("Title:",self._ListFont,(255,255,255))
self._title.Init("Title:",self._ListFont,MySkinManager.GiveColor('Text'))
self._time = Label()
self._time.SetCanvasHWND(self._CanvasHWND)
self._time.Init("Time:",self._ListFont,(255,255,255))
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,(255,255,255))
self._time2.Init("00:00-00:00", self._ListFont,
MySkinManager.GiveColor('Text'))
self.Start()
@@ -201,7 +209,7 @@ class MPDSpectrumPage(Page):
#print("sleeping... 0.01")
time.sleep(0.01)
self.read_retry+=1
if self.read_retry > 40:
if self.read_retry > 20:
os.close(self._FIFO)
self._FIFO = os.open(self._PIFI._MPD_FIFO, os.O_RDONLY | os.O_NONBLOCK)
self.read_retry = 0
@@ -221,7 +229,7 @@ class MPDSpectrumPage(Page):
def ClearCanvas(self):
self._CanvasHWND.fill((0,0,0))
self._CanvasHWND.fill(MySkinManager.GiveColor('Black'))
def SgsSmooth(self):
passes = 1
@@ -257,7 +265,7 @@ class MPDSpectrumPage(Page):
def KeyDown(self,event):
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
if IsKeyMenuOrB(event.key):
try:
os.close(self._FIFO)
self._FIFO = None
@@ -273,13 +281,6 @@ class MPDSpectrumPage(Page):
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Start"]:
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Enter"]:
pass
def Draw(self):
self.ClearCanvas()
@@ -335,7 +336,7 @@ class MPDSpectrumPage(Page):
if self._RollCanvas != None:
# self._RollCanvas.fill((111,22,33))
self._RollCanvas.fill((0,0,0))
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
@@ -354,12 +355,14 @@ class MPDSpectrumPage(Page):
if len(spects) == 0:
return
# print("spects:",spects)
step = int( round( len( spects ) / meterNum) )
# print(len(spects))
self._bbs = []
a = numpy.logspace(0, 1, num=meterNum,endpoint=True)
for i in range(0,meterNum):
index = int(i*step)
index = int(a[i] * step)
total = 0
value = spects[index]
@@ -379,7 +382,7 @@ class MPDSpectrumPage(Page):
value = 0
value = value/32768.0
value = value * 100
value = value * 123
value = value % (self._Height-gap-margin_bottom)
if len(self._vis_values) < len(self._bby):
@@ -389,7 +392,8 @@ class MPDSpectrumPage(Page):
self._vis_values[i] = value
except Empty:
except Exception,e:
print(e)
return
else: # got line
if len(self._vis_values) == 0:
@@ -406,9 +410,9 @@ class MPDSpectrumPage(Page):
else:
self._capYPositionArray[i] = value
pygame.draw.rect(self._CanvasHWND,(255,255,255),(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,(255,255,255),(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,19 +2,20 @@
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
from UI.page import Page,PageSelector
from UI.label import Label
from UI.fonts import fonts
from UI.icon_item import IconItem
from UI.util_funcs import midRect
from UI.keys_def import CurKeys
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.multi_icon_item import MultiIconItem
from UI.icon_pool import MyIconPool
from UI.scroller import ListScroller
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from list_item import ListItem
@@ -48,7 +49,7 @@ class MusicLibStack:
return len(self.stack)
class ListPageSelector(PageSelector):
_BackgroundColor = pygame.Color(131,199,219)
_BackgroundColor = MySkinManager.GiveColor('Line')
def __init__(self):
self._PosX = 0
@@ -71,19 +72,19 @@ 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):
_Icons = {}
_Selector=None
_FootMsg = ["Nav","Scan","","Back","Add to Playlist"]
_FootMsg = ["Nav","","Scan","Back","Add to Playlist"]
_MyList = []
_SwapMyList = []
_ListFont = fonts["notosanscjk15"]
_ListFont = MyLangManager.TrFont("notosanscjk15")
_MyStack = None
_Scroller = None
@@ -183,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("Please upload data over Wi-Fi", fonts["varela22"])
self._BGpng.SetLableColor(pygame.Color(204,204,204))
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)
@@ -194,35 +195,6 @@ class MusicLibListPage(Page):
self._Scroller._PosY = 2
self._Scroller.Init()
def ScrollUp(self,Step=1):
if len(self._MyList) == 0:
return
tmp = self._PsIndex
self._PsIndex -= Step
if self._PsIndex < 0:
self._PsIndex = 0
dy = tmp-self._PsIndex
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY < 0:
for i in range(0, len(self._MyList)):
self._MyList[i]._PosY += self._MyList[i]._Height*dy
def ScrollDown(self,Step=1):
if len(self._MyList) == 0:
return
tmp = self._PsIndex
self._PsIndex +=Step
if self._PsIndex >= len(self._MyList):
self._PsIndex = len(self._MyList) -1
dy = self._PsIndex - tmp
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY +cur_li._Height > self._Height:
for i in range(0,len(self._MyList)):
self._MyList[i]._PosY -= self._MyList[i]._Height*dy
def Click(self):
if len(self._MyList) == 0:
return
@@ -253,7 +225,7 @@ class MusicLibListPage(Page):
def KeyDown(self,event):
if event.key == CurKeys["Menu"] or event.key == CurKeys["Left"] or event.key == CurKeys["A"]:
if IsKeyMenuOrB(event.key) or event.key == CurKeys["Left"]:
self.ReturnToUpLevelPage()
self._Screen.Draw()
@@ -270,12 +242,12 @@ class MusicLibListPage(Page):
"""
if event.key == CurKeys["Right"]:
self.ScrollDown(Step=5)
self.FScrollDown(Step=5)
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Left"]:
self.ScrollUp(Step=5)
self.FScrollUp(Step=5)
self._Screen.Draw()
self._Screen.SwapAndShow()
"""
@@ -285,7 +257,7 @@ class MusicLibListPage(Page):
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Enter"]:
if IsKeyStartOrA(event.key):
self.Click()
def Draw(self):
@@ -3,17 +3,18 @@ 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
from UI.page import Page,PageSelector
from UI.icon_item import IconItem
from UI.label import Label
from UI.fonts import fonts
from UI.util_funcs import midRect
from UI.keys_def import CurKeys
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.icon_pool import MyIconPool
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from UI.scroller import ListScroller
@@ -22,7 +23,7 @@ from list_item import ListItem
import myvars
class ListPageSelector(PageSelector):
_BackgroundColor = pygame.Color(131,199,219)
_BackgroundColor = MySkinManager.GiveColor('Line')
def __init__(self):
self._PosX = 0
@@ -50,18 +51,18 @@ 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):
_Icons = {}
_Selector=None
_FootMsg = ["Nav","RTA","Remove","Back","Play/Pause"]
_FootMsg = ["Nav","Remove","RTA","Back","Play/Pause"]
_MyList = []
_ListFont = fonts["notosanscjk15"]
_ListFont = MyLangManager.TrFont("notosanscjk15")
_Scroller = None
_CurSongTime="0:0"
@@ -97,7 +98,11 @@ class PlayListPage(Page):
li._Fonts["normal"] = self._ListFont
if "title" in v:
li.Init( v["title"])
if isinstance(v["title"], (list,)):
li.Init(" | ".join(v["title"]))
else:
li.Init( v["title"])
if "file" in v:
li._Path = v["file"]
@@ -178,8 +183,8 @@ class PlayListPage(Page):
self._BGpng._ImgSurf = MyIconPool._Icons["heart"]
self._BGpng._MyType = ICON_TYPES["STAT"]
self._BGpng._Parent = self
self._BGpng.AddLabel("my favourites", fonts["varela18"])
self._BGpng.SetLableColor(pygame.Color(204,204,204))
self._BGpng.AddLabel(MyLangManager.Tr("my favorite music"), MyLangManager.TrFont("varela18"))
self._BGpng.SetLableColor(MySkinManager.GiveColor('Text'))
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
self._Scroller = ListScroller()
@@ -246,7 +251,7 @@ class PlayListPage(Page):
self.SyncScroll()
def KeyDown(self,event):
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
if IsKeyMenuOrB(event.key):
if myvars.Poller != None:
myvars.Poller.stop()
self._CurSongTime=""
@@ -277,7 +282,7 @@ class PlayListPage(Page):
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Enter"]:
if IsKeyStartOrA(event.key):
self.Click()
if event.key == CurKeys["X"]: # start spectrum
@@ -1,31 +1,34 @@
# -*- coding: utf-8 -*-
import pygame
import validators
import commands
from UI.constants import Width,Height,ICON_TYPES
from UI.simple_name_space import SimpleNamespace
from UI.page import Page
from UI.label import Label
from UI.fonts import fonts
from UI.icon_item import IconItem
from UI.icon_pool import MyIconPool
from UI.keys_def import CurKeys
from UI.keys_def import CurKeys, IsKeyMenuOrB
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from libs.DBUS import is_wifi_connected_now,get_wifi_ip
class TinyCloudPage(Page):
_FootMsg = ["Nav.","","","Back",""]
_FootMsg = ["Nav","","","Back",""]
_MyList = []
_ListFontObj = fonts["varela13"]
_ListFontObj = MyLangManager.TrFont("veramono13")
_ListLabelFontObj = MyLangManager.TrFont("varela13")
_AList = {}
_Labels = {}
_Coords = {}
_URLColor = pygame.Color(51,166,255)
_TextColor = pygame.Color(83,83,83)
_URLColor = MySkinManager.GiveColor('URL')
_TextColor = MySkinManager.GiveColor('Text')
_Scrolled = 0
_PngSize = {}
@@ -59,32 +62,39 @@ class TinyCloudPage(Page):
self._Coords["forssh"] = SimpleNamespace()
self._Coords["forssh"].x = self._Coords["forID"].x
self._Coords["forssh"].y = 47
self._Coords["forssh"].y = 36
self._Coords["ssh_addr"] = SimpleNamespace()
self._Coords["ssh_addr"].x = self._Coords["forID"].x
self._Coords["ssh_addr"].y = 65
self._Coords["ssh_addr"].y = 54
self._Coords["forwin"] = SimpleNamespace()
self._Coords["forwin"].x = self._Coords["forID"].x
self._Coords["forwin"].y = 101
self._Coords["forwin"].y = 80
self._Coords["samba_games"] = SimpleNamespace()
self._Coords["samba_games"].x = self._Coords["forID"].x
self._Coords["samba_games"].y = 118
self._Coords["samba_games"].y = 97
self._Coords["samba_music"] = SimpleNamespace()
self._Coords["samba_music"].x = self._Coords["samba_games"].x
self._Coords["samba_music"].y = 136
self._Coords["samba_music"].y = 115
self._Coords["for_airplay"] = SimpleNamespace()
self._Coords["for_airplay"].x = self._Coords["forID"].x
self._Coords["for_airplay"].y = 173
self._Coords["for_airplay"].y = 140
self._Coords["airplay_name"] = SimpleNamespace()
self._Coords["airplay_name"].x = 68
self._Coords["airplay_name"].y = self._Coords["for_airplay"].y
self._Coords["for-usb-eth"] = SimpleNamespace()
self._Coords["for-usb-eth"].x = self._Coords["forID"].x
self._Coords["for-usb-eth"].y = 163
self._Coords["usb-eth-addr"] = SimpleNamespace()
self._Coords["usb-eth-addr"].x = 112
self._Coords["usb-eth-addr"].y = self._Coords["for-usb-eth"].y
self._Coords["bg"] = SimpleNamespace()
self._Coords["bg"].x = self._Width/2
@@ -108,17 +118,27 @@ 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_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:
l = Label()
@@ -141,8 +161,8 @@ class TinyCloudPage(Page):
self._Width = self._Screen._Width ## equal to screen width
self._Height = self._Screen._Height
self._PngSize["bg"] = (253,132)
self._PngSize["online"] = (75,122)
self._PngSize["bg"] = (253,114)
#self._PngSize["online"] = (75,122)
bgpng = IconItem()
bgpng._ImgSurf = MyIconPool._Icons["needwifi_bg"]
@@ -152,6 +172,7 @@ class TinyCloudPage(Page):
self._Icons["bg"] = bgpng
"""
onlinepng = IconItem()
onlinepng._ImgSurf = MyIconPool._Icons["online"]
onlinepng._MyType = ICON_TYPES["STAT"]
@@ -159,16 +180,14 @@ 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):
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
if self._FootMsg[3] == "Back":
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
return
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
def Draw(self):
if self._DrawOnce == False:
@@ -176,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()
@@ -190,6 +209,12 @@ class TinyCloudPage(Page):
self._Labels["key_and_pass"].Draw()
else:
self._Labels["for-usb-eth"].NewCoord(self._Coords["for-usb-eth"].x+55, self._Coords["for-usb-eth"].y)
self._Labels["for-usb-eth"].Draw()
self._Labels["usb-eth-addr"].NewCoord(self._Coords["usb-eth-addr"].x+55, self._Coords["usb-eth-addr"].y)
self._Labels["usb-eth-addr"].Draw()
self._Icons["bg"].NewCoord(self._Coords["bg"].x, self._Coords["bg"].y)
self._Icons["bg"].Draw()
@@ -197,7 +222,7 @@ class TinyCloudPage(Page):
self._DrawOnce = True
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 ) )
@@ -210,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):
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
exit 0
@@ -12,15 +12,16 @@ 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.fonts import fonts
from UI.util_funcs import midRect
from UI.keys_def import CurKeys
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
@@ -79,7 +80,7 @@ class InfoPageListItem(object):
class AboutPage(Page):
_FootMsg = ["Nav.","","","Back",""]
_MyList = []
_ListFontObj = fonts["varela13"]
_ListFontObj = MyLangManager.TrFont("varela13")
_AList = {}
@@ -207,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 = []
@@ -216,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
@@ -229,7 +255,7 @@ class AboutPage(Page):
li._PosY = start_y + last_height
li._Width = Width
li._Fonts["normal"] = self._ListFontObj
li._Fonts["small"] = fonts["varela12"]
li._Fonts["small"] = MySkinManager.GiveFont("varela12")
if self._AList[u]["label"] != "":
li.Init( self._AList[u]["label"] )
@@ -240,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)
@@ -248,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)
@@ -267,6 +293,9 @@ class AboutPage(Page):
self.CpuMhz()
self.Uname()
self.LauncherVersion()
self.OsImageVersion()
self.GenList()
self._Scroller = ListScroller()
@@ -278,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
@@ -300,7 +329,7 @@ class AboutPage(Page):
self._Screen.SwapAndShow()
def KeyDown(self,event):
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
@@ -321,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 ) )
@@ -12,74 +12,20 @@ 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.fonts import fonts
from UI.util_funcs import midRect
from UI.keys_def import CurKeys
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.multi_icon_item import MultiIconItem
from UI.lang_manager import MyLangManager
from UI.skin_manager import MySkinManager
from UI.multilabel import MultiLabel
class InfoPageListItem(object):
_PosX = 0
_PosY = 0
_Width = 0
_Height = 20
_Labels = {}
_Icons = {}
_Fonts = {}
_LinkObj = None
def __init__(self):
self._Labels = {}
self._Icons = {}
self._Fonts = {}
def SetSmallText(self,text):
l = MultiLabel()
l.SetCanvasHWND(self._Parent._CanvasHWND)
l.Init(text,self._Fonts["small"])
self._Labels["Small"] = l
#if self._Labels["Small"]._Width > self._Width:
# self._Width = self._Labels["Small"]._Width
if self._Labels["Small"]._Height >= self._Height:
self._Height = self._Labels["Small"]._Height+10
def Init(self,text):
#self._Fonts["normal"] = fonts["veramono12"]
l = Label()
l._PosX = 10
l.SetCanvasHWND(self._Parent._CanvasHWND)
l.Init(text,self._Fonts["normal"])
self._Labels["Text"] = l
def Draw(self):
self._Labels["Text"]._PosY = self._PosY
self._Labels["Text"].Draw()
if "Small" in self._Labels:
self._Labels["Small"]._PosX = self._Labels["Text"]._Width + 16
self._Labels["Small"]._PosY = self._PosY
self._Labels["Small"].Draw()
class AirplanePage(Page):
_FootMsg = ["Nav.","","","Back","Toggle"]
_FootMsg = ["Nav","","Rescue","Back","Toggle"]
_MyList = []
_ListFontObj = fonts["varela13"]
_ListFontObj = MyLangManager.TrFont("varela13")
_AList = {}
@@ -117,7 +63,7 @@ class AirplanePage(Page):
self._Height = self._Screen._Height
"""
airwire = IconItem()
airwire._ImgSurf = MyIconPool._Icons["airwire"]
airwire._MyType = ICON_TYPES["STAT"]
@@ -131,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
@@ -161,6 +108,8 @@ class AirplanePage(Page):
self._Scroller.Init()
self._Scroller.SetCanvasHWND(self._HWND)
self.OnLoadCb()
def ScrollDown(self):
dis = 10
if abs(self._Scrolled) < (self._BGheight - self._Height)/2 + 0:
@@ -175,7 +124,7 @@ class AirplanePage(Page):
def ToggleModeAni(self): ## with animation
out = commands.getstatusoutput('sudo rfkill list | grep yes | cut -d " " -f3')
if out[1] == "yes":
if "yes" in out[1]:
data = self.EasingData(0,43)
for _,v in enumerate(data):
self._airwire_y -= v
@@ -205,25 +154,31 @@ class AirplanePage(Page):
def ToggleMode(self):
out = commands.getstatusoutput('sudo rfkill list | grep yes | cut -d " " -f3')
print out
if out[1] == "yes":
self._Screen._MsgBox.SetText("Turning On")
if "yes" in out[1]:
self._Screen._MsgBox.SetText("TurningOn")
self._Screen._MsgBox.Draw()
commands.getstatusoutput("sudo rfkill unblock all")
self._Screen._TitleBar._InAirPlaneMode = False
else:
self._Screen._MsgBox.SetText("Turning Off")
self._Screen._MsgBox.SetText("TurningOff")
self._Screen._MsgBox.Draw()
commands.getstatusoutput("sudo rfkill block all")
self._Screen._TitleBar._InAirPlaneMode = True
def UnBlockAll(self):
self._Screen._MsgBox.SetText("TurningOn")
self._Screen._MsgBox.Draw()
commands.getstatusoutput("sudo rfkill unblock all")
self._Screen._TitleBar._InAirPlaneMode = False
def OnLoadCb(self):
self._Scrolled = 0
self._PosY = 0
self._DrawOnce = False
out = commands.getstatusoutput('sudo rfkill list | grep yes | cut -d " " -f3')
if out[1] == "yes":
if "yes" in out[1]:
self._Screen._TitleBar._InAirPlaneMode = True
self._airwire_y = 50+43
self._dialog_index = 1
@@ -239,12 +194,12 @@ class AirplanePage(Page):
self._Screen.SwapAndShow()
def KeyDown(self,event):
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["B"]:
if IsKeyStartOrA(event.key):
self.ToggleModeAni()
"""
self.ToggleMode()
@@ -265,23 +220,36 @@ class AirplanePage(Page):
self._Screen.Draw()
self._Screen.SwapAndShow()
"""
if event.key == CurKeys["X"]:
self.UnBlockAll()
self._Screen.SwapAndShow()
pygame.time.delay(1000)
self._Screen.Draw()
self._Screen.SwapAndShow()
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 ) )
@@ -0,0 +1,815 @@
# -*- coding: utf-8 -*-
import re
import pygame
#import math
import commands
import dbus
from beeprint import pp
from libs.roundrects import aa_round_rect
from libs.DBUS import bus, adapter,devices
#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
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.multi_icon_item import MultiIconItem
from UI.skin_manager import MySkinManager
from UI.confirm_page import ConfirmPage
from UI.info_page_list_item import InfoPageListItem
from UI.multilabel import MultiLabel
from UI.lang_manager import MyLangManager
from UI.keyboard import Keyboard
from net_item import NetItem
from agent import BleAgent,BleAgentPairPage
class BleForgetConfirmPage(ConfirmPage):
_ConfirmText = MyLangManager.Tr("ConfirmForgetQ")
def KeyDown(self,event):
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if IsKeyStartOrA(event.key):
self.SnapMsg(MyLangManager.Tr("Deleting"))
self._Screen.Draw()
self._Screen.SwapAndShow()
try:
#self._Parent._Adapter.RemoveDevice()
print("try to RemoveDevice")
except Exception,e:
print(str(e))
pygame.time.delay(400)
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
def Draw(self):
#self.ClearCanvas()
self.DrawBG()
for i in self._MyList:
i.Draw()
self.Reset()
class BleInfoPageSelector(PageSelector):
_BackgroundColor = MySkinManager.GiveColor('Line')
def __init__(self):
self._PosX = 0
self._PosY = 0
self._Height = 0
def AnimateDraw(self,x2,y2):
pass
def Draw(self):
idx = self._Parent._PsIndex
if idx < len( self._Parent._MyList):
x = self._PosX+2
y = self._Parent._MyList[idx]._PosY+1
h = self._Parent._MyList[idx]._Height -3
self._PosX = x
self._PosY = y
self._Height = h
#aa_round_rect(self._Parent._CanvasHWND,
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width-4,h),0)
class BleInfoPage(Page):
_FootMsg = ["Nav","Forget","Disconnect","Back",""]
_MyList = []
_ListFontObj = MyLangManager.TrFont("varela15")
_ListSmFontObj = MySkinManager.GiveFont("varela12") # small font
_ListSm2FontObj= MySkinManager.GiveFont("varela11")
_AList = {}
_Path = ""
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 = BleInfoPageSelector()
ps._Parent = self
self._Ps = ps
self._PsIndex = 0
#_AList is an object
self.GenList()
self._Scroller = ListScroller()
self._Scroller._Parent = self
self._Scroller._PosX = 2
self._Scroller._PosY = 2
self._Scroller.Init()
self._ConfirmPage1 = BleForgetConfirmPage()
self._ConfirmPage1._Screen = self._Screen
self._ConfirmPage1._Name = "ConfirmForget"
self._ConfirmPage1._Parent = self
self._ConfirmPage1.Init()
def GenList(self):
if self._AList== None:
return
self._MyList = []
self._PsIndex = 0
start_x = 0
start_y = 0
for i,v in enumerate( self._AList):
#print(i,v) # (0, dbus.String(u'AddressType'))
li = InfoPageListItem()
li._Parent = self
li._PosX = start_x
li._PosY = start_y + i*InfoPageListItem._Height
li._Width = Width
li._Fonts["normal"] = self._ListFontObj
if v == "UUIDs":
li._Fonts["small"] = self._ListSm2FontObj
else:
li._Fonts["small"] = self._ListSmFontObj
li.Init( str(v) )
li._Flag = v
if v =="UUIDs":
if len(self._AList[v]) > 1:
pp(self._AList[v][0])
sm_text = str(self._AList[v][0])
else:
sm_text = "<empty>"
else:
sm_text = str(self._AList[v])
if sm_text == "0":
sm_text="No"
elif sm_text == "1":
sm_text="Yes"
sm_text = sm_text[:20]
li.SetSmallText(sm_text)
li._PosX = 2
self._MyList.append(li)
def TryToForget(self):
global adapter
proxy_obj = bus.get_object("org.bluez", self._Path)
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
self._Screen._MsgBox.SetText("Forgeting")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
try:
adapter.RemoveDevice(dev)
except Exception,e:
err_name = e.get_dbus_name()
if err_name == "org.freedesktop.DBus.Error.NoReply":
self._Screen._MsgBox.SetText("DBus noreply")
else:
self._Screen._MsgBox.SetText("Forget failed")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
pygame.time.delay(500)
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
def TryToDisconnect(self):
global bus
if "Connected" in self._AList:
if self._AList["Connected"] == 0:
return
proxy_obj = bus.get_object("org.bluez", self._Path)
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
self._Screen._FootBar.UpdateNavText("Disconnecting")
self._Screen._MsgBox.SetText("Disconnecting")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
try:
dev.Disconnect()
except Exception,e:
err_name = e.get_dbus_name()
if err_name == "org.freedesktop.DBus.Error.NoReply":
self._Screen._MsgBox.SetText("DBus noreply")
else:
self._Screen._MsgBox.SetText("Disconnect failed")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
pygame.time.delay(500)
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
self._Screen._FootBar.ResetNavText()
def Click(self):
if self._PsIndex >= len(self._MyList):
return
cur_li = self._MyList[self._PsIndex]
print(cur_li._Flag)
if cur_li._Flag in self._AList:
print(self._AList[ cur_li._Flag ])
def OnLoadCb(self):
if self._AList != None:
if "Connected" in self._AList:
if self._AList["Connected"] == 1:
self._FootMsg[1] = "Disconnect"
else:
self._FootMsg[1] = ""
self.GenList()
def OnReturnBackCb(self):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
def KeyDown(self,event):
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
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()
if IsKeyStartOrA(event.key):
self.Click()
if event.key == CurKeys["X"]:
self.TryToDisconnect()
if event.key == CurKeys["Y"]:
self.TryToForget()
def Draw(self):
if len(self._MyList) == 0:
return
self.ClearCanvas()
if len(self._MyList) * InfoPageListItem._Height > self._Height:
self._Ps._Width = self._Width - 10
self._Ps._PosX = 9
self._Ps.Draw()
for i in self._MyList:
i.Draw()
self._Scroller.UpdateSize(len(self._MyList)*InfoPageListItem._Height, self._PsIndex*InfoPageListItem._Height)
self._Scroller.Draw()
else:
self._Ps._Width = self._Width
self._Ps.Draw()
for i in self._MyList:
i.Draw()
class BleListSelector(PageSelector):
_BackgroundColor = MySkinManager.GiveColor('Line')
def __init__(self):
self._PosX = 0
self._PosY = 0
self._Height = 0
def AnimateDraw(self,x2,y2):
pass
def Draw(self):
idx = self._Parent._PsIndex
if idx < len( self._Parent._MyList):
x = self._Parent._MyList[idx]._PosX+2
y = self._Parent._MyList[idx]._PosY+1
h = self._Parent._MyList[idx]._Height -3
self._PosX = x
self._PosY = y
self._Height = h
#aa_round_rect(self._Parent._CanvasHWND,
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor, (x,y,self._Width-4,h),0 )
class BleListMessageBox(Label):
_Parent = None
def Draw(self):
my_text = self._FontObj.render( self._Text,True,self._Color)
w = my_text.get_width()
h = my_text.get_height()
x = (self._Parent._Width - w)/2
y = (self._Parent._Height - h)/2
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('Text'),(x-padding,y-padding, w+padding*2,h+padding*2),1)
self._CanvasHWND.blit(my_text,(x,y,w,h))
class BluetoothPage(Page):
_MyList = []
#Wicd dbus part
_Adapter = None
_Dbus = None
_Devices = None
_BlePassword = ""
_Connecting = False
_Scanning = False
_PrevState = None
_Selector = None
_ShowingMessageBox = False
_MsgBox = None
_ConnectTry = 0
_BlockCb = None
_LastStatusMsg = ""
_FootMsg = ["Nav","Info","Scan","Back","TryConnect"]
_Scroller = None
_ListFontObj = MyLangManager.TrFont("notosanscjk15")
_InfoPage = None
_ADAPTER_DEV = "hci0"
_Offline = False
_Leader = None
def __init__(self):
Page.__init__(self)
self._MyList = []
self._CanvasHWND = None
def ShowBox(self,msg):
self._MsgBox._Text = msg
self._ShowingMessageBox = True
self._Screen.Draw()
self._MsgBox.Draw()
self._Screen.SwapAndShow()
def HideBox(self):
self.Draw()
self._ShowingMessageBox = False
self._Screen.SwapAndShow()
def Init(self):
self._PosX = self._Index * self._Screen._Width
self._Width = self._Screen._Width
self._Height = self._Screen._Height
#self._CanvasHWND = pygame.Surface((self._Width,self._Height))
self._CanvasHWND = self._Screen._CanvasHWND
ps = BleListSelector()
ps._Parent = self
ps._Width = Width - 12
self._Ps = ps
self._PsIndex = 0
msgbox = BleListMessageBox()
msgbox._CanvasHWND = self._CanvasHWND
msgbox.Init(" ",MyLangManager.TrFont("veramono12"))
msgbox._Parent = self
self._MsgBox = msgbox
self._Scroller = ListScroller()
self._Scroller._Parent = self
self._Scroller._PosX = 2
self._Scroller._PosY = 2
self._Scroller.Init()
self.GenNetworkList()
self._InfoPage = BleInfoPage()
self._InfoPage._Screen = self._Screen
self._InfoPage._Name = "BluetoothInfo"
self._InfoPage.Init()
def print_normal(self,address, properties):
print("[ " + address + " ]")
for key in properties.keys():
value = properties[key]
if type(value) is dbus.String:
value = unicode(value).encode('ascii', 'replace')
if (key == "Class"):
print(" %s = 0x%06x" % (key, value))
else:
print(" %s = %s" % (key, value))
print()
properties["Logged"] = True
def skip_dev(self,old_dev, new_dev):
if not "Logged" in old_dev:
return False
if "Name" in old_dev:
return True
if not "Name" in new_dev:
return True
return False
def DbusPropertiesChanged(self, interface, changed, invalidated, path):
global devices
print("DbusPropertiesChanged")
if interface != "org.bluez.Device1":
return
if path in devices:
dev = devices[path]
if self.skip_dev(dev, changed):
return
devices[path] = dict(devices[path].items() + changed.items())
else:
devices[path] = changed
if "Address" in devices[path]:
address = devices[path]["Address"]
else:
address = "<unknown>"
self._Devices = devices
self.print_normal(address, devices[path])
self.RefreshDevices()
self.GenNetworkList()
self._Screen.Draw()
self._Screen.SwapAndShow()
def ShutDownConnecting(self):
print("Bluetooth Shutdown connecting...")
def AbortedAndReturnToUpLevel(self):
self.HideBox()
self._Screen._FootBar.ResetNavText()
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
def CheckIfBluetoothConnecting(self):
return True
def TryConnect(self):
global bus
if self._PsIndex >= len(self._MyList):
return
cur_li = self._MyList[self._PsIndex]
print(cur_li._Path)
if "Connected" in cur_li._Atts:
if cur_li._Atts["Connected"] == 1:
return
proxy_obj = bus.get_object("org.bluez", cur_li._Path)
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
self._Screen._FootBar.UpdateNavText("Connecting")
self.ShowBox(MyLangManager.Tr("Connecting"))
self._Leader._MyAgent.device_obj = dev
self._Leader._MyAgent.dev_path = cur_li._Path
try:
dev.Pair(reply_handler=self._Leader._MyAgent.pair_reply,
error_handler=self._Leader._MyAgent.pair_error,timeout=60000)
except Exception,e:
print(str(e))
#self.HideBox()
#self._Screen._FootBar.ResetNavText()
def RefreshDevices(self):
global devices
devices = {}
try:
proxy_obj = bus.get_object("org.bluez", "/")
manager = dbus.Interface(proxy_obj,"org.freedesktop.DBus.ObjectManager")
objects = manager.GetManagedObjects()
for path, interfaces in objects.iteritems():
if "org.bluez.Device1" in interfaces:
devices[path] = interfaces["org.bluez.Device1"] ## like /org/bluez/hci0/dev_xx_xx_xx_yy_yy_yy
except Exception,e:
print(str(e))
devices={}
self._Devices = devices
def GenNetworkList(self):
self._MyList = []
start_x = 0
start_y = 0
counter = 0
for i,v in enumerate(self._Devices):
if "Name" in self._Devices[v]:
if len(self._Devices[v]["Name"]) < 2:
continue
if re.match("[0-9a-f]{2}([-:]?)[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$", self._Devices[v]["Name"].lower()): ## skip xx:xx:xx:xx:xx
continue
else:
continue
ni = NetItem()
ni._Parent = self
ni._PosX = start_x
ni._PosY = start_y + counter* NetItem._Height
ni._Width = Width
ni._FontObj = self._ListFontObj
ni.Init(v,self._Devices[v])
counter += 1
self._MyList.append(ni)
self._PsIndex = 0
def Rescan(self):
if self._Screen._CurrentPage != self:
return
self._Scanning = True
self.ShowBox(MyLangManager.Tr("BluetoothScanning"))
self._Screen._FootBar.UpdateNavText("Scanning")
proxy_obj = self._Dbus.get_object("org.bluez", "/org/bluez/" + self._ADAPTER_DEV)
adapter_props = dbus.Interface(proxy_obj,"org.freedesktop.DBus.Properties")
discoverying = adapter_props.Get("org.bluez.Adapter1", "Discovering")
print("discoverying", discoverying)
if self._Adapter!= None:
try:
self._Adapter.StopDiscovery()
except Exception,e:
print(str(e))
try:
self._Adapter.StartDiscovery()
except Exception,e:
err_name = e.get_dbus_name()
if err_name == "org.freedesktop.DBus.Error.NoReply":
print("start discovery timeout")
else:
print("start discovery unknown err: ", str(e))
def OnReturnBackCb(self):
self.RefreshDevices()
self.GenNetworkList()
def OnLoadCb(self):
self._Offline = False
if self._Screen._TitleBar._InAirPlaneMode == False:
out = commands.getstatusoutput("hcitool dev | grep hci0 |cut -f3") ## bluetooth maybe dead after airplane mode
if len(out[1]) < 17:
self._Offline = True
print("Bluetooth OnLoadCb ,can not find hci0 alive,try to reboot")
else:
self.RefreshDevices()
self.GenNetworkList()
else:
self._Offline = True
def KeyDown(self,event):
if IsKeyMenuOrB(event.key):
if self._Offline == True:
self.AbortedAndReturnToUpLevel()
return
if self._Adapter != None:
try:
self._Adapter.StopDiscovery()
except Exception,e:
print(str(e))
_connecting = self.CheckIfBluetoothConnecting()
if _connecting:
self.ShutDownConnecting()
self.ShowBox(MyLangManager.Tr("ShutDownConnecting"))
self.AbortedAndReturnToUpLevel()
else:
self.AbortedAndReturnToUpLevel()
else:
self.HideBox()
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
self._Screen._FootBar.ResetNavText()
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()
if event.key == CurKeys["X"]:
if self._Offline == False:
self.Rescan()
if event.key == CurKeys["Y"]:
if len(self._MyList) == 0:
return
if self._Offline == True:
return
self._InfoPage._AList = self._MyList[self._PsIndex]._Atts
self._InfoPage._Path = self._MyList[self._PsIndex]._Path
self._Screen.PushPage(self._InfoPage)
self._Screen.Draw()
self._Screen.SwapAndShow()
if IsKeyStartOrA(event.key):
if self._Offline == False:
self.TryConnect()
def Draw(self):
self.ClearCanvas()
if len(self._MyList) == 0:
return
if len(self._MyList) * NetItem._Height > self._Height:
self._Ps._Width = self._Width - 11
self._Ps.Draw()
for i in self._MyList:
i.Draw()
self._Scroller.UpdateSize( len(self._MyList)*NetItem._Height, self._PsIndex*NetItem._Height)
self._Scroller.Draw()
else:
self._Ps._Width = self._Width
self._Ps.Draw()
for i in self._MyList:
i.Draw()
BUS_NAME = 'org.bluez'
AGENT_INTERFACE = 'org.bluez.Agent1'
AGENT_PATH = "/gameshell/bleagent"
class APIOBJ(object):
_Page = None
_PairPage = None
_Page3 = None
_Prompts = {} # string key,string value
_PromptType = None
_MyAgent = None
def __init__(self):
self._Prompts["PIN"]=""
self._Prompts["PASS"]=""
def OnKbdReturnBackCb(self):
if self._PromptType == None:
return
else:
if self._PromptType in self._Prompts:
inputed = "".join(self._Page3._Textarea._MyWords)
self._Prompts[self._PromptType] = inputed
self._PromptType = None ##clear
def Ask(self,prompt,prompt_type=None):
self._Screen.PushPage(self._Page3)
self._Page3.SetPassword("")
self._Page3._Name = prompt
self._Page3._Caller = self
self._Screen.Draw()
self._Screen.SwapAndShow()
if prompt_type != None:
self._PromptType = prompt_type
def RegisterMyAgent(self):
global AGENT_PATH, bus,devices,adapter
capability = "KeyboardDisplay"
self._MyAgent = BleAgent(bus, AGENT_PATH)
self._MyAgent._Leader = self
obj = bus.get_object(BUS_NAME, "/org/bluez");
manager = dbus.Interface(obj, "org.bluez.AgentManager1")
manager.RegisterAgent(AGENT_PATH, capability)
print("BleAgent %s registered" % AGENT_PATH)
def Init(self,main_screen):
global bus,devices,adapter
self._Page = BluetoothPage()
self._Page._Dbus = bus
self._Page._Devices = devices
self._Page._Adapter = adapter
self._Page._Screen = main_screen
self._Page._Name ="Bluetooth"
self._Page._Leader = self
self._Page.Init()
self._PairPage = BleAgentPairPage()
self._PairPage._Screen = main_screen
self._PairPage._Name = "Bluetooth"
self._PairPage.Init()
self._Page3= Keyboard()
self._Page3._Name = "Enter"
self._Page3._Screen = main_screen
self._Page3.Init()
bus.add_signal_receiver(self._Page.DbusPropertiesChanged,
dbus_interface = "org.freedesktop.DBus.Properties",
signal_name = "PropertiesChanged",
arg0 = "org.bluez.Device1",
path_keyword = "path")
self.RegisterMyAgent()
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)
@@ -0,0 +1,224 @@
# -*- coding: utf-8 -*-
import pygame
#import math
#import commands
import dbus
#from beeprint import pp
from libs.roundrects import aa_round_rect
from UI.page import Page,PageSelector
from UI.keys_def import CurKeys, IsKeyMenuOrB
from libs.DBUS import bus, adapter,devices
BUS_NAME = 'org.bluez'
AGENT_INTERFACE = 'org.bluez.Agent1'
AGENT_PATH = "/gameshell/bleagent"
class Rejected(dbus.DBusException):
_dbus_error_name = "org.bluez.Error.Rejected"
class BleAgent(dbus.service.Object):
device_obj = None
_Leader = None
dev_path = ""
def set_trusted(self,path):
global BUS_NAME
props = dbus.Interface(bus.get_object(BUS_NAME, path),
"org.freedesktop.DBus.Properties")
props.Set("org.bluez.Device1", "Trusted", True)
def dev_connect(self,path):
global BUS_NAME
dev = dbus.Interface(bus.get_object(BUS_NAME, path),
"org.bluez.Device1")
print("dev_connect %s" % path)
try:
dev.Connect()
except Exception,e:
print(str(e))
@dbus.service.method(AGENT_INTERFACE,in_signature="", out_signature="")
def Release(self):
print("Agent release")
@dbus.service.method(AGENT_INTERFACE,in_signature="os", out_signature="")
def AuthorizeService(self, device, uuid):
print("AuthorizeService (%s, %s)" % (device, uuid)) ## directly authrized
return
@dbus.service.method(AGENT_INTERFACE,in_signature="o", out_signature="s")
def RequestPinCode(self, device):
print("RequestPinCode (%s)" % (device))
set_trusted(device)
return "0000"
@dbus.service.method(AGENT_INTERFACE,in_signature="o", out_signature="u")
def RequestPasskey(self, device):
print("RequestPasskey (%s)" % (device))
set_trusted(device)
passkey = "000000"
return dbus.UInt32(passkey)
@dbus.service.method(AGENT_INTERFACE,in_signature="ouq", out_signature="")
def DisplayPasskey(self, device, passkey, entered):
print("DisplayPasskey (%s, %06u entered %u)" % (device, passkey, entered))
self._Leader._PairPage.ShowPassKey(device,passkey,entered)
@dbus.service.method(AGENT_INTERFACE,in_signature="os", out_signature="")
def DisplayPinCode(self, device, pincode):
print("DisplayPinCode (%s, %s)" % (device, pincode))
self._Leader._PairPage.ShowPinCode(device,pincode)
@dbus.service.method(AGENT_INTERFACE,in_signature="ou", out_signature="")
def RequestConfirmation(self, device, passkey):
print("RequestConfirmation (%s, %06d)" % (device, passkey))
set_trusted(device)
return
@dbus.service.method(AGENT_INTERFACE,in_signature="o", out_signature="")
def RequestAuthorization(self, device):
print("RequestAuthorization (%s)" % (device))
return
@dbus.service.method(AGENT_INTERFACE,in_signature="", out_signature="")
def Cancel(self):
print("Cancel")
def pair_reply(self):
print("Device paired under Agent")
self.set_trusted(self.dev_path)
self.dev_connect(self.dev_path)
self._Leader._PairPage._dev_obj = self.device_obj
self._Leader._PairPage.PairReplyCb()
def pair_error(self,error):
global adapter
err_msg = ""
err_name = error.get_dbus_name()
print(err_name)
if err_name == "org.freedesktop.DBus.Error.NoReply" and self.device_obj:
err_msg = "Timed out. Cancelling pairing"
print(err_msg)
self.device_obj.CancelPairing()
elif err_name == "org.bluez.Error.AuthenticationCanceled":
err_msg = "Authentication Canceled"
elif err_name == "org.bluez.Error.ConnectionAttemptFailed":
err_msg = "Page Timeout"
elif err_name == "org.bluez.Error.AlreadyExists":
err_msg ="Already Exists"
try:
adapter.RemoveDevice(self.device_obj)
except Exception,e:
print("pair_error forget err:",str(e))
elif err_name == "org.bluez.Error.AuthenticationFailed":
err_msg = "Authentication Failed"
else:
err_msg = "Pair error"
print( err_name,str(error) )
self.device_obj = None
self._Leader._PairPage.PairErrorCb(err_msg)
class BleAgentPairPage(Page):
##show pin/password
##show prompt
_Pin = ""
_Pass = ""
_dev_obj = None
_FootMsg = ["Nav","","","Back",""]
def Init(self):
self._PosX = self._Index * self._Screen._Width
self._Width = self._Screen._Width
self._Height = self._Screen._Height
#self._CanvasHWND = pygame.Surface((self._Width,self._Height))
self._CanvasHWND = self._Screen._CanvasHWND
def ShowPinCode(self,device,pincode):
print("ShowPinCode %s %s" % (device,pincode))
if self._Screen.CurPage() != self:
self._Screen.PushPage(self)
self.ClearCanvas()
self._Screen.Draw()
self._Screen.SwapAndShow()
self._Pin = "%s" % pincode
txt = self.Pin
if len(self._Pin) > 0:
txt = "Pin code: %s" % self._Pin
self._Screen._MsgBox.SetText(txt)
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
def ShowPassKey(self,device,passkey,entered):
print("ShowPassKey %06u %u" % (passkey,entered))
if self._Screen.CurPage() != self:
self._Screen.PushPage(self)
self.ClearCanvas()
self._Screen.Draw()
self._Screen.SwapAndShow()
self._Pass = "%06u" % passkey
if len(self._Pass) > 0:
txt = "Pair code: %s" % self._Pass
self._Screen._MsgBox.SetText(txt)
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
def PairReplyCb(self):
self.ClearCanvas()
self._Screen.Draw()
self._Screen.SwapAndShow()
self._Screen._MsgBox.SetText("Device paired")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
pygame.time.delay(1500)
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
self._Screen._FootBar.ResetNavText()
def PairErrorCb(self,error=None):
self.ClearCanvas()
self._Screen.Draw()
self._Screen.SwapAndShow()
self._Screen._MsgBox.SetText(error)
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
pygame.time.delay(1500)
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
self._Screen._FootBar.ResetNavText()
def KeyDown(self,event):
if IsKeyMenuOrB(event.key):
if self._dev_obj != None:
try:
self._dev_obj.CancelPairing()
except Exception,e:
print(str(e))
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
def Draw(self):
pass
#self.ClearCanvas()
@@ -0,0 +1,128 @@
# -*- coding: utf-8 -*-
import pygame
## local UI import
from UI.page import Page
from UI.label import Label
from UI.icon_item import IconItem
from UI.multi_icon_item import MultiIconItem
from UI.icon_pool import MyIconPool
from UI.skin_manager import MySkinManager
class NetItemMultiIcon(MultiIconItem):
_CanvasHWND = None
_Parent = None
_Width = 18
_Height = 18
def Draw(self):
self._CanvasHWND.blit(self._ImgSurf,(self._PosX,self._PosY+(self._Parent._Height-self._Height)/2,self._Width,self._Height),
(0,self._IconIndex*self._IconHeight,self._IconWidth,self._IconHeight))
class NetItemIcon(IconItem):
_CanvasHWND = None
_Parent = None
_Width = 18
_Height = 18
def Draw(self):
self._CanvasHWND.blit(self._ImgSurf,(self._PosX,self._PosY+(self._Parent._Height-self._Height)/2,self._Width,self._Height))
class NetItem(object):
_PosX = 0
_PosY = 0
_Width = 0
_Height = 30
_Atts = {}
_Channel="" # '10'
_Stren = "" ## 19%
_Parent = None
_IsActive = False
_Icons = {} ## wifi strength and security icons
_Labels = {}
_FontObj = None
_RSSI = 0
_MacAddr=""
_Path = "" #/org/bluez/hci0/dev_34_88_5D_97_FF_26
def __init__(self):
self._Labels = {}
self._Icons = {}
def SetActive(self,act):
self._IsActive = act
def Init(self, path, object):
self._Path = path
self._Atts = object
is_active=False
if "Address" in object:
self._MacAddr = object["Address"]
if "Connected" in object:
if object["Connected"] == 1:
is_active=True
if is_active:
self.SetActive(is_active)
name_label = Label()
name_label._PosX = 12
name_label._CanvasHWND = self._Parent._CanvasHWND
mac_addr = self._MacAddr
if "Name" in object:
if len(object["Name"]) > 3:
mac_addr = object["Name"]
if "RSSI" in object:
print(object["RSSI"])
self._RSSI = int(object["RSSI"])
mac_addr = mac_addr[:34]
name_label.Init(mac_addr,self._FontObj)
self._Labels["mac_addr"] = name_label
done_icon = NetItemIcon()
done_icon._ImgSurf = MyIconPool._Icons["done"]
done_icon._CanvasHWND = self._Parent._CanvasHWND
done_icon._Parent = self
self._Icons["done"] = done_icon
## reuse the resource from TitleBar
#pp(theString)
def Connect(self,notworkentry=None):
""" Execute connection. """
#dev = dbus.Interface(bus.get_object("org.bluez", "/org/bluez/hci0/dev_"+"34_88_5D_97_FF_26"), "org.bluez.Device1")
proxy_obj = self._Parent._Dbus.get_object("org.bluez",self._Path)
dev = self._Parent._Dbus.Interface(proxy_obj, "org.bluez.Device1")
dev.Connect()
def Draw(self):
#pygame.draw.line(self._Parent._CanvasHWND,(169,169,169),(self._PosX,self._PosY),(self._PosX+self._Width,self._PosY),1)
for i in self._Labels:
self._Labels[i]._PosY = self._PosY + (self._Height - self._Labels[i]._Height)/2
self._Labels[i].Draw()
if self._IsActive:
self._Icons["done"].NewCoord(320-22,self._PosY)
self._Icons["done"].Draw()
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),
(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
@@ -10,25 +10,23 @@ from UI.constants import Width,Height,ICON_TYPES
from UI.page import Page,PageSelector
from UI.label import Label
from UI.icon_item import IconItem
from UI.fonts import fonts
from UI.util_funcs import midRect
from UI.keys_def import CurKeys
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 = {}
@@ -39,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
@@ -79,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):
@@ -161,7 +161,7 @@ class BrightnessPage(Page):
def KeyDown(self,event):
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
@@ -0,0 +1,267 @@
# -*- coding: utf-8 -*-
import pygame
import commands
import shutil
import os
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.keys_def import CurKeys, GetButtonsLayoutMode, SetButtonsLayoutMode, IsKeyStartOrA, 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.confirm_page import ConfirmPage
class UpdateConfirmPage(ConfirmPage):
_ConfirmText = "Apply to RetroArch?"
_RetroArchConf = "/home/cpi/.config/retroarch/retroarch.cfg"
_LayoutMode = "Unknown"
def ModifyRetroArchConf(self,keys):
try:
with open(self._RetroArchConf, mode="r") as f:
confarr = f.readlines()
except:
return "retroarch.cfg cannot open."
bka = bkb = bkx = bky = False
try:
for i, ln in enumerate(confarr):
lnk = ln.split("=")[0].strip()
if lnk == "input_player1_a":
confarr[i] = "input_player1_a = \"" + keys[0] + "\"\n"
bka = True
if lnk == "input_player1_b":
confarr[i] = "input_player1_b = \"" + keys[1] + "\"\n"
bkb = True
if lnk == "input_player1_x":
confarr[i] = "input_player1_x = \"" + keys[2] + "\"\n"
bkx = True
if lnk == "input_player1_y":
confarr[i] = "input_player1_y = \"" + keys[3] + "\"\n"
bky = True
except:
return "retroarch.cfg cannot parse."
if bka and bkb and bkx and bky:
None
else:
return "retroarch.cfg validation error."
try:
with open(self._RetroArchConf, mode="w") as f:
confarr = f.writelines(confarr)
except:
return "retroarch.cfg cannot write."
return "Completed! Your RA keymap: " + self._LayoutMode.upper()
def KeyDown(self,event):
def finalizeWithDialog(msg):
self._Screen._MsgBox.SetText(msg)
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
return
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if IsKeyStartOrA(event.key):
if self._LayoutMode == "xbox":
keymap = ["j","k","u","i"]
elif self._LayoutMode == "snes":
keymap = ["k","j","i","u"]
else:
finalizeWithDialog("Internal error.")
return
print("mode: " + self._LayoutMode)
if not os.path.isfile(self._RetroArchConf):
finalizeWithDialog("retroarch.cfg was not found.")
return
try:
shutil.copyfile(self._RetroArchConf, self._RetroArchConf + ".blbak")
except:
finalizeWithDialog("Cannot create .blbak")
return
finalizeWithDialog(self.ModifyRetroArchConf(keymap))
return
def OnReturnBackCb(self):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
def Draw(self):
self.ClearCanvas()
self.DrawBG()
for i in self._MyList:
i.Draw()
self.Reset()
class ButtonsLayoutPage(Page):
_FootMsg = ["Nav.","","UpdateRetroArch","Back","Toggle"]
_MyList = []
_AList = {}
_Scrolled = 0
_BGwidth = 320
_BGheight = 240-24-20
_DrawOnce = False
_Scroller = None
_ConfirmPage = None
_EasingDur = 30
_dialog_index = 0
def __init__(self):
Page.__init__(self)
self._Icons = {}
def GenList(self):
self._MyList = []
def Init(self):
if self._Screen != None:
if self._Screen._CanvasHWND != None and self._CanvasHWND == None:
self._HWND = self._Screen._CanvasHWND
self._CanvasHWND = pygame.Surface( (self._Screen._Width,self._BGheight) )
self._PosX = self._Index*self._Screen._Width
self._Width = self._Screen._Width ## equal to screen width
self._Height = self._Screen._Height
DialogBoxs = MultiIconItem()
DialogBoxs._ImgSurf = MyIconPool._Icons["buttonslayout"]
DialogBoxs._MyType = ICON_TYPES["STAT"]
DialogBoxs._Parent = self
DialogBoxs._IconWidth = 300
DialogBoxs._IconHeight = 150
DialogBoxs.Adjust(0,0,134,372,0)
self._Icons["DialogBoxs"] = DialogBoxs
self.GenList()
self._Scroller = ListScroller()
self._Scroller._Parent = self
self._Scroller._PosX = self._Width - 10
self._Scroller._PosY = 2
self._Scroller.Init()
self._Scroller.SetCanvasHWND(self._HWND)
self._ConfirmPage = UpdateConfirmPage()
self._ConfirmPage._LayoutMode = GetButtonsLayoutMode()
self._ConfirmPage._Screen = self._Screen
self._ConfirmPage._Name = "Overwrite RA conf"
self._ConfirmPage._Parent = self
self._ConfirmPage.Init()
def ScrollDown(self):
dis = 10
if abs(self._Scrolled) < (self._BGheight - self._Height)/2 + 0:
self._PosY -= dis
self._Scrolled -= dis
def ScrollUp(self):
dis = 10
if self._PosY < 0:
self._PosY += dis
self._Scrolled += dis
def ToggleMode(self):
if GetButtonsLayoutMode() == "xbox":
SetButtonsLayoutMode("snes")
self._dialog_index = 1
self._Screen.Draw()
self._Screen.SwapAndShow()
else:
SetButtonsLayoutMode("xbox")
self._dialog_index = 0
self._Screen.Draw()
self._Screen.SwapAndShow()
def OnLoadCb(self):
self._Scrolled = 0
self._PosY = 0
self._DrawOnce = False
self._dialog_index = 0 if GetButtonsLayoutMode() == "xbox" else 1
def OnReturnBackCb(self):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
def KeyDown(self,event):
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if IsKeyStartOrA(event.key):
self.ToggleMode()
if event.key == CurKeys["X"]:
self._ConfirmPage._LayoutMode = GetButtonsLayoutMode()
self._Screen.PushPage(self._ConfirmPage)
self._Screen.Draw()
self._Screen.SwapAndShow()
def Draw(self):
self.ClearCanvas()
self._Icons["DialogBoxs"].NewCoord(0,30)
self._Icons["DialogBoxs"]._IconIndex = self._dialog_index
self._Icons["DialogBoxs"].DrawTopLeft()
if self._HWND != None:
self._HWND.fill((255,255,255))
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )
class APIOBJ(object):
_Page = None
def __init__(self):
pass
def Init(self,main_screen):
self._Page = ButtonsLayoutPage()
self._Page._Screen = main_screen
self._Page._Name ="Buttons Layout"
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)
@@ -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)
@@ -0,0 +1,350 @@
# -*- coding: utf-8 -*-
import os
import pygame
import platform
import commands
#import glob
#from beeprint import pp
from libs.roundrects import aa_round_rect
## local UI import
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
from UI.page import Page,PageSelector
from UI.label import Label
from UI.util_funcs import midRect,FileExists
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.multilabel import MultiLabel
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from UI.info_page_list_item import InfoPageListItem
from UI.info_page_selector import InfoPageSelector
from libs.DBUS import is_wifi_connected_now
import config
class ListPageSelector(InfoPageSelector):
def Draw(self):
idx = self._Parent._PsIndex
if idx < len(self._Parent._MyList):
x = self._Parent._MyList[idx]._PosX+2 ## ++
y = self._Parent._MyList[idx]._PosY+1
h = self._Parent._MyList[idx]._Height -3
self._PosX = x
self._PosY = y
self._Height = h
#aa_round_rect(self._Parent._CanvasHWND,
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width-4,h) ,0)
class PageListItem(InfoPageListItem):
_PosX = 0
_PosY = 0
_Width = 0
_Height = 30
_Labels = {}
_Icons = {}
_Fonts = {}
_LinkObj = None
_Active = False
_Value = ""
def Draw(self):
self._Labels["Text"]._PosY = self._PosY+ (self._Height- self._Labels["Text"]._Height)/2
if self._Active == True:
self._Parent._Icons["done"].NewCoord( self._Parent._Width-30,self._PosY+5)
self._Parent._Icons["done"].Draw()
self._Labels["Text"].Draw(self._Active)
if "Small" in self._Labels:
self._Labels["Small"]._PosX = self._Width - self._Labels["Small"]._Width -10
self._Labels["Small"]._PosY = self._PosY + (self._Height- self._Labels["Small"]._Height)/2
self._Labels["Small"].Draw()
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
class GateWayPage(Page):
_FootMsg = ["Nav","Clear All","","Back","Select"]
_MyList = []
_ListFont = MyLangManager.TrFont("notosanscjk15")
_AList = {}
_Scrolled = 0
_BGwidth = 320
_BGheight = 240-24-20
_DrawOnce = False
_Scroller = None
_InfoPage = None
def __init__(self):
Page.__init__(self)
self._Icons = {}
def GenList(self):
self._MyList = []
start_x = 0
start_y = 0
last_height = 0
drivers = [["usb0","USB Ethernet"],
["wlan0","Wi-Fi"]]
for i,u in enumerate( drivers ):
#print(i,u)
li = PageListItem()
li._Parent = self
li._PosX = start_x
li._PosY = start_y + last_height
li._Width = Width
li._Fonts["normal"] = self._ListFont
li._Active = False
li._Value = u[0]
li.Init( u[1] )
last_height += li._Height
self._MyList.append(li)
def Init(self):
if self._Screen != None:
if self._Screen._CanvasHWND != None and self._CanvasHWND == None:
self._HWND = self._Screen._CanvasHWND
self._CanvasHWND = pygame.Surface( (self._Screen._Width,self._BGheight) )
self._PosX = self._Index*self._Screen._Width
self._Width = self._Screen._Width ## equal to screen width
self._Height = self._Screen._Height
done = IconItem()
done._ImgSurf = MyIconPool._Icons["done"]
done._MyType = ICON_TYPES["STAT"]
done._Parent = self
self._Icons["done"] = done
ps = ListPageSelector()
ps._Parent = self
self._Ps = ps
self._PsIndex = 0
self.GenList()
self._Scroller = ListScroller()
self._Scroller._Parent = self
self._Scroller._PosX = self._Width - 10
self._Scroller._PosY = 2
self._Scroller.Init()
self._Scroller.SetCanvasHWND(self._HWND)
def Click(self):
if len(self._MyList) == 0:
return
cur_li = self._MyList[self._PsIndex]
if cur_li._Active == True:
out = commands.getstatusoutput("sudo ip route | grep default | cut -d \" \" -f3")
if len(out[1]) > 7:
self._Screen._MsgBox.SetText(out[1])
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
return
print(cur_li._Value)
if "arm" in platform.machine():
for i in self._MyList:
i._Active = False
self._Screen._MsgBox.SetText("Applying")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
cur_li._Active = self.ApplyGateWay(cur_li._Value)
pygame.time.delay(1000)
self._Screen.Draw()
self._Screen.SwapAndShow()
else:
self._Screen._MsgBox.SetText("Do it in GameShell")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
def ClearAllGateways(self):
self._Screen._MsgBox.SetText("Cleaning up")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
os.system("sudo ip route del 0/0")
pygame.time.delay(800)
for i in self._MyList:
i._Active = False
self._Screen.Draw()
self._Screen.SwapAndShow()
def ApplyGateWay(self,gateway):
os.system("sudo ip route del 0/0")
if gateway== "usb0":
out = commands.getstatusoutput("sudo ifconfig usb0 | grep inet | tr -s \" \"| cut -d \" \" -f3")
if len(out[1]) > 7:
if "error" not in out[1]:
parts = out[1].split(".")
if len(parts) == 4:##IPv4
tp3 = int(parts[3])
tmp = tp3
if tp3 == 0:
tmp = int(parts[3]) + 1
elif tp3 == 1:
tmp = int(parts[3]) + 1
elif tp3 > 1:
tmp = int(parts[3]) - 1
parts[3] = str(tmp)
ipaddress = ".".join(parts)
os.system("sudo route add default gw "+ipaddress)
return True
else:
if is_wifi_connected_now():
os.system("sudo dhclient wlan0")
return True
else:
self._Screen._MsgBox.SetText("Wi-Fi is not connected")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
return False
return False
def OnLoadCb(self):
self._Scrolled = 0
self._PosY = 0
self._DrawOnce = False
## grep Driver /etc/xorg.conf | tr -s " " | cut -d " " -f3
## "fbturbo"
## "modesetting"
thedrv = ""
if "arm" in platform.machine():
out = commands.getstatusoutput("sudo ip route | grep default")
if len(out[1]) > 7:
if "usb0" in out[1]:
thedrv = "usb0"
elif "wlan0" in out[1]:
thedrv = "wlan0"
for i in self._MyList:
i._Active = False
if thedrv != "":
for i in self._MyList:
if thedrv in i._Value:
i._Active = True
## if usb0 and wlan0 all actived, clear all
def OnReturnBackCb(self):
pass
"""
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
"""
def KeyDown(self,event):
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if IsKeyStartOrA(event.key):
self.Click()
if event.key == CurKeys["Y"]:
self.ClearAllGateways()
if event.key == CurKeys["Up"]:
self.ScrollUp()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Down"]:
self.ScrollDown()
self._Screen.Draw()
self._Screen.SwapAndShow()
def Draw(self):
self.ClearCanvas()
if len(self._MyList) == 0:
return
else:
if len(self._MyList) * PageListItem._Height > self._Height:
self._Ps._Width = self._Width - 11
self._Ps.Draw()
for i in self._MyList:
if i._PosY > self._Height + self._Height/2:
break
if i._PosY < 0:
continue
i.Draw()
self._Scroller.UpdateSize( len(self._MyList)*PageListItem._Height, self._PsIndex*PageListItem._Height)
self._Scroller.Draw()
else:
self._Ps._Width = self._Width
self._Ps.Draw()
for i in self._MyList:
if i._PosY > self._Height + self._Height/2:
break
if i._PosY < 0:
continue
i.Draw()
if self._HWND != None:
self._HWND.fill((255,255,255))
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )
class APIOBJ(object):
_Page = None
def __init__(self):
pass
def Init(self,main_screen):
self._Page = GateWayPage()
self._Page._Screen = main_screen
self._Page._Name ="Gateway switch"
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)
@@ -0,0 +1,309 @@
# -*- coding: utf-8 -*-
import os
import pygame
#import math
#mport subprocess
import glob
#from beeprint import pp
from libs.roundrects import aa_round_rect
## local UI import
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
from UI.page import Page,PageSelector
from UI.label import Label
from UI.util_funcs import midRect
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.multilabel import MultiLabel
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from UI.info_page_list_item import InfoPageListItem
from UI.info_page_selector import InfoPageSelector
import config
class ListPageSelector(InfoPageSelector):
def Draw(self):
idx = self._Parent._PsIndex
if idx < len(self._Parent._MyList):
x = self._Parent._MyList[idx]._PosX+2 ## ++
y = self._Parent._MyList[idx]._PosY+1
h = self._Parent._MyList[idx]._Height -3
self._PosX = x
self._PosY = y
self._Height = h
#aa_round_rect(self._Parent._CanvasHWND,
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width-4,h) ,0)
class PageListItem(InfoPageListItem):
_PosX = 0
_PosY = 0
_Width = 0
_Height = 30
_Labels = {}
_Icons = {}
_Fonts = {}
_LinkObj = None
_Active = False
_Value = ""
def Draw(self):
self._Labels["Text"]._PosY = self._PosY+ (self._Height- self._Labels["Text"]._Height)/2
if self._Active == True:
self._Parent._Icons["done"].NewCoord( self._Parent._Width-30,self._PosY+5)
self._Parent._Icons["done"].Draw()
self._Labels["Text"].Draw(self._Active)
if "Small" in self._Labels:
self._Labels["Small"]._PosX = self._Width - self._Labels["Small"]._Width -10
self._Labels["Small"]._PosY = self._PosY + (self._Height- self._Labels["Small"]._Height)/2
self._Labels["Small"].Draw()
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
class LanguagesPage(Page):
_FootMsg = ["Nav","","","Back","Select"]
_MyList = []
_ListFont = MyLangManager.TrFont("notosanscjk15")
_AList = {}
_Scrolled = 0
_BGwidth = 320
_BGheight = 240-24-20
_DrawOnce = False
_Scroller = None
_InfoPage = None
def __init__(self):
Page.__init__(self)
self._Icons = {}
def GenList(self):
self._MyList = []
start_x = 0
start_y = 0
last_height = 0
files_path = [os.path.basename(x) for x in sorted(glob.glob('langs/*.ini'))]
for i,u in enumerate( files_path ):
#print(i,u)
li = PageListItem()
li._Parent = self
li._PosX = start_x
li._PosY = start_y + last_height
li._Width = Width
li._Fonts["normal"] = self._ListFont
li._Active = False
li._Value = u.decode("utf8")
lang_name = u.split("_")[1]
lang_name = lang_name.split(".")[0]
li.Init( lang_name.decode("utf8") )
last_height += li._Height
self._MyList.append(li)
def Init(self):
if self._Screen != None:
if self._Screen._CanvasHWND != None and self._CanvasHWND == None:
self._HWND = self._Screen._CanvasHWND
self._CanvasHWND = pygame.Surface( (self._Screen._Width,self._BGheight) )
self._PosX = self._Index*self._Screen._Width
self._Width = self._Screen._Width ## equal to screen width
self._Height = self._Screen._Height
done = IconItem()
done._ImgSurf = MyIconPool._Icons["done"]
done._MyType = ICON_TYPES["STAT"]
done._Parent = self
self._Icons["done"] = done
ps = ListPageSelector()
ps._Parent = self
self._Ps = ps
self._PsIndex = 0
self.GenList()
self._Scroller = ListScroller()
self._Scroller._Parent = self
self._Scroller._PosX = self._Width - 10
self._Scroller._PosY = 2
self._Scroller.Init()
self._Scroller.SetCanvasHWND(self._HWND)
def ScrollDown(self):
if len(self._MyList) == 0:
return
self._PsIndex +=1
if self._PsIndex >= len(self._MyList):
self._PsIndex = len(self._MyList) -1
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY +cur_li._Height > self._Height:
for i in range(0,len(self._MyList)):
self._MyList[i]._PosY -= self._MyList[i]._Height
def ScrollUp(self):
if len(self._MyList) == 0:
return
self._PsIndex -= 1
if self._PsIndex < 0:
self._PsIndex = 0
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY < 0:
for i in range(0, len(self._MyList)):
self._MyList[i]._PosY += self._MyList[i]._Height
def Click(self):
if len(self._MyList) == 0:
return
cur_li = self._MyList[self._PsIndex]
if cur_li._Active == True:
return
for i in self._MyList:
i._Active = False
cur_li._Active = True
print(cur_li._Value)
with open(".lang","w") as f:
f.write(cur_li._Value)
self._Screen._MsgBox.SetText("Applying")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
MyLangManager.UpdateLang()
pygame.event.post( pygame.event.Event(RESTARTUI, message="")) ##Restart Launcher
pygame.time.delay(1000)
self._Screen.Draw()
self._Screen.SwapAndShow()
def OnLoadCb(self):
self._Scrolled = 0
self._PosY = 0
self._DrawOnce = False
with open(".lang", "r") as f:
thelang = f.read()
thelang = thelang.strip()
if thelang == "":
thelang = "English"
for i in self._MyList:
if thelang in i._Value:
i._Active = True
def OnReturnBackCb(self):
pass
"""
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
"""
def KeyDown(self,event):
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if IsKeyStartOrA(event.key):
self.Click()
if event.key == CurKeys["Up"]:
self.ScrollUp()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Down"]:
self.ScrollDown()
self._Screen.Draw()
self._Screen.SwapAndShow()
def Draw(self):
self.ClearCanvas()
if len(self._MyList) == 0:
return
else:
if len(self._MyList) * PageListItem._Height > self._Height:
self._Ps._Width = self._Width - 11
self._Ps.Draw()
for i in self._MyList:
if i._PosY > self._Height + self._Height/2:
break
if i._PosY < 0:
continue
i.Draw()
self._Scroller.UpdateSize( len(self._MyList)*PageListItem._Height, self._PsIndex*PageListItem._Height)
self._Scroller.Draw()
else:
self._Ps._Width = self._Width
self._Ps.Draw()
for i in self._MyList:
if i._PosY > self._Height + self._Height/2:
break
if i._PosY < 0:
continue
i.Draw()
if self._HWND != None:
self._HWND.fill((255,255,255))
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )
class APIOBJ(object):
_Page = None
def __init__(self):
pass
def Init(self,main_screen):
self._Page = LanguagesPage()
self._Page._Screen = main_screen
self._Page._Name ="Languages"
self._Page.Init()
def API(self,main_screen):
if main_screen !=None:
main_screen.PushPage(self._Page)
main_screen.Draw()
main_screen.SwapAndShow()
OBJ = APIOBJ()
def Init(main_screen):
OBJ.Init(main_screen)
def API(main_screen):
OBJ.API(main_screen)
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
import os
import pygame
#import math
#mport subprocess
import platform
#from beeprint import pp
from libs.roundrects import aa_round_rect
## local UI import
from UI.lang_manager import MyLangManager
class APIOBJ(object):
_Page = None
def __init__(self):
pass
def Init(self,main_screen):
pass
def API(self,main_screen):
if main_screen !=None:
main_screen._MsgBox.SetText("Rebooting to LauncherGo")
main_screen._MsgBox.Draw()
main_screen.SwapAndShow()
pygame.time.delay(300)
if "arm" in platform.machine():
os.system("sed -i s/launcher/launchergo/g ~/.bashrc" )
os.system("sudo reboot")
OBJ = APIOBJ()
def Init(main_screen):
OBJ.Init(main_screen)
def API(main_screen):
OBJ.API(main_screen)
+302
View File
@@ -0,0 +1,302 @@
# -*- coding: utf-8 -*-
import os
import pygame
import platform
#import commands
import glob
#from beeprint import pp
from libs.roundrects import aa_round_rect
## local UI import
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
from UI.page import Page,PageSelector
from UI.label import Label
from UI.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
from UI.icon_item import IconItem
from UI.multilabel import MultiLabel
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from UI.info_page_list_item import InfoPageListItem
from UI.info_page_selector import InfoPageSelector
import config
class ListPageSelector(InfoPageSelector):
def Draw(self):
idx = self._Parent._PsIndex
if idx < len(self._Parent._MyList):
x = self._Parent._MyList[idx]._PosX+2 ## ++
y = self._Parent._MyList[idx]._PosY+1
h = self._Parent._MyList[idx]._Height -3
self._PosX = x
self._PosY = y
self._Height = h
aa_round_rect(self._Parent._CanvasHWND,
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
class PageListItem(InfoPageListItem):
_PosX = 0
_PosY = 0
_Width = 0
_Height = 30
_Labels = {}
_Icons = {}
_Fonts = {}
_LinkObj = None
_Active = False
_Value = ""
def Draw(self):
self._Labels["Text"]._PosY = self._PosY+ (self._Height- self._Labels["Text"]._Height)/2
if self._Active == True:
self._Parent._Icons["done"].NewCoord( self._Parent._Width-30,self._PosY+5)
self._Parent._Icons["done"].Draw()
self._Labels["Text"].Draw(self._Active)
if "Small" in self._Labels:
self._Labels["Small"]._PosX = self._Width - self._Labels["Small"]._Width -10
self._Labels["Small"]._PosY = self._PosY + (self._Height- self._Labels["Small"]._Height)/2
self._Labels["Small"].Draw()
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
class GPUDriverPage(Page):
_FootMsg = ["Nav","","","Back","Select"]
_MyList = []
_ListFont = MyLangManager.TrFont("notosanscjk12")
_AList = {}
_Scrolled = 0
_BGwidth = 320
_BGheight = 240-24-20
_DrawOnce = False
_Scroller = None
_InfoPage = None
def __init__(self):
Page.__init__(self)
self._Icons = {}
def GenList(self):
self._MyList = []
start_x = 0
start_y = 0
last_height = 0
drivers = [["fbturbo","FBTURBO driver (Software Rendering)"],
["modesetting","LIMA driver (Experimental GPU Rendering)"]]
for i,u in enumerate( drivers ):
#print(i,u)
li = PageListItem()
li._Parent = self
li._PosX = start_x
li._PosY = start_y + last_height
li._Width = Width
li._Fonts["normal"] = self._ListFont
li._Active = False
li._Value = u[0]
li.Init( u[1] )
last_height += li._Height
self._MyList.append(li)
def Init(self):
if self._Screen != None:
if self._Screen._CanvasHWND != None and self._CanvasHWND == None:
self._HWND = self._Screen._CanvasHWND
self._CanvasHWND = pygame.Surface( (self._Screen._Width,self._BGheight) )
self._PosX = self._Index*self._Screen._Width
self._Width = self._Screen._Width ## equal to screen width
self._Height = self._Screen._Height
done = IconItem()
done._ImgSurf = MyIconPool.GiveIconSurface("done")
done._MyType = ICON_TYPES["STAT"]
done._Parent = self
self._Icons["done"] = done
ps = ListPageSelector()
ps._Parent = self
self._Ps = ps
self._PsIndex = 0
self.GenList()
self._Scroller = ListScroller()
self._Scroller._Parent = self
self._Scroller._PosX = self._Width - 10
self._Scroller._PosY = 2
self._Scroller.Init()
self._Scroller.SetCanvasHWND(self._HWND)
def Click(self):
if len(self._MyList) == 0:
return
cur_li = self._MyList[self._PsIndex]
if cur_li._Active == True:
return
print(cur_li._Value)
if "arm" in platform.machine():
for i in self._MyList:
i._Active = False
cur_li._Active = True
self._Screen._MsgBox.SetText("Applying")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
if "modesetting" in cur_li._Value: ## enable lima
os.system("touch %s/.lima" % os.path.expanduser('~') )
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")
else:
self._Screen._MsgBox.SetText("Do it in GameShell")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
def OnLoadCb(self):
self._Scrolled = 0
self._PosY = 0
self._DrawOnce = False
## grep Driver /etc/xorg.conf | tr -s " " | cut -d " " -f3
## "fbturbo"
## "modesetting"
thedrv = ""
if "arm" in platform.machine():
if FileExists("%s/.lima" % os.path.expanduser('~')):
thedrv = "modesetting"
else:
thedrv = "fbturbo"
if thedrv == "":
thedrv = "fbturbo"
for i in self._MyList:
i._Active = False
for i in self._MyList:
if thedrv in i._Value:
i._Active = True
def OnReturnBackCb(self):
pass
"""
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
"""
def KeyDown(self,event):
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if IsKeyStartOrA(event.key):
self.Click()
if event.key == CurKeys["Up"]:
self.ScrollUp()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Down"]:
self.ScrollDown()
self._Screen.Draw()
self._Screen.SwapAndShow()
def Draw(self):
self.ClearCanvas()
if len(self._MyList) == 0:
return
else:
if len(self._MyList) * PageListItem._Height > self._Height:
self._Ps._Width = self._Width - 11
self._Ps.Draw()
for i in self._MyList:
if i._PosY > self._Height + self._Height/2:
break
if i._PosY < 0:
continue
i.Draw()
self._Scroller.UpdateSize( len(self._MyList)*PageListItem._Height, self._PsIndex*PageListItem._Height)
self._Scroller.Draw()
else:
self._Ps._Width = self._Width
self._Ps.Draw()
for i in self._MyList:
if i._PosY > self._Height + self._Height/2:
break
if i._PosY < 0:
continue
i.Draw()
if self._HWND != None:
self._HWND.fill(MySkinManager.GiveColor("White"))
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )
class APIOBJ(object):
_Page = None
def __init__(self):
pass
def Init(self,main_screen):
self._Page = GPUDriverPage()
self._Page._Screen = main_screen
self._Page._Name ="GPU Driver Switch"
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)
@@ -0,0 +1,264 @@
# -*- 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
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.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 NotifyJobListItem(InfoPageListItem):
_CanvasHWND = None
def Init(self,text):
#self._Fonts["normal"] = fonts["veramono12"]
self._CanvasHWND = self._Parent._CanvasHWND
l = Label()
l._PosX = 10
l.SetCanvasHWND(self._Parent._CanvasHWND)
l.Init(text,self._Fonts["normal"])
self._Labels["Text"] = l
done_icon = IconItem()
done_icon._ImgSurf = MyIconPool._Icons["done"]
done_icon._CanvasHWND = self._Parent._CanvasHWND
done_icon._Parent = self
self._Icons["done"] = done_icon
def Draw(self):
if self._ReadOnly == False:
self._Labels["Text"].SetColor(MySkinManager.GiveColor("ReadOnlyText"))
else:
self._Labels["Text"].SetColor(MySkinManager.GiveColor("Text"))
self._Labels["Text"]._PosX = self._Labels["Text"]._PosX + self._PosX
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
self._Labels["Text"].Draw()
self._Labels["Text"]._PosX = self._Labels["Text"]._PosX - self._PosX
if "Small" in self._Labels:
self._Labels["Small"]._PosX = self._Width - self._Labels["Small"]._Width-5
self._Labels["Small"]._PosY = self._PosY + (self._Height - self._Labels["Small"]._Height)/2
self._Labels["Small"].Draw()
if self._ReadOnly:
self._Icons["done"].NewCoord(self._Width - 25,5)
self._Icons["done"].Draw()
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
class NotificationPage(Page):
_FootMsg = ["Nav","","","Back","Toggle"]
_MyList = []
_ListFontObj = MyLangManager.TrFont("varela13")
_AList = {}
_Scrolled = 0
_BGwidth = 320
_BGheight = 240-24-20
_DrawOnce = False
_Scroller = None
_EasingDur = 30
_GSNOTIFY_JOBS = "gsnotify/Jobs"
_GSNOTIFY_SOCKET="/tmp/gsnotify.sock"
_Config =None
_AllowedExts = [".sh",".lsp",".lua",".bin",".py",".js"]
def __init__(self):
Page.__init__(self)
self._Icons = {}
if "arm" in platform.machine():
os.system( "git config --global core.filemode false" )
def GenList(self):
self._MyList = []
## map ini to self._AList
files_path = glob.glob(self._GSNOTIFY_JOBS+"/*")
start_x = 10
start_y = 0
counter = 0
for i,v in enumerate( files_path):
filename, file_extension = os.path.splitext(v)
alias_file = filename + ".alias"
if file_extension in self._AllowedExts:
li = NotifyJobListItem()
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")
if IsExecutable(v):
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()
def Click(self):
if len(self._MyList) == 0:
return
cur_li = self._MyList[self._PsIndex]
#print("Click ",cur_li._Flag)
if IsExecutable(cur_li._Flag):
os.system("chmod -x "+cur_li._Flag)
else:
os.system("chmod +x "+cur_li._Flag)
self.GenList()
def OnLoadCb(self):
self._Scrolled = 0
self._PosY = 0
self._DrawOnce = False
self.GenList()
def OnReturnBackCb(self):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
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.Click()
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 = NotificationPage()
self._Page._Screen = main_screen
self._Page._Name ="Notify"
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)
@@ -4,16 +4,15 @@ import pygame
#UI lib
from UI.constants import RUNSYS
from UI.keys_def import CurKeys
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.confirm_page import ConfirmPage
from UI.lang_manager import MyLangManager
import config
class PowerOffConfirmPage(ConfirmPage):
_ConfirmText = "Confirm Power OFF?"
_ConfirmText = MyLangManager.Tr("Confirm Power OFF?")
def CheckBattery(self):
try:
f = open(config.Battery)
@@ -41,13 +40,13 @@ class PowerOffConfirmPage(ConfirmPage):
def KeyDown(self,event):
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["B"]:
if IsKeyStartOrA(event.key):
if self.CheckBattery() < 20:
cmdpath = "feh --bg-center gameshell/wallpaper/gameover.png;"
else:
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
import os
import pygame
#import math
#mport subprocess
@@ -12,18 +12,19 @@ from libs.roundrects import aa_round_rect
from UI.constants import Width,Height,ICON_TYPES,POWEROPT
from UI.page import Page,PageSelector
from UI.label import Label
from UI.fonts import fonts
from UI.util_funcs import midRect
from UI.keys_def import CurKeys
from UI.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.multilabel import MultiLabel
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
import config
class ListPageSelector(PageSelector):
_BackgroundColor = pygame.Color(131,199,219)
_BackgroundColor = MySkinManager.GiveColor('Line')
def __init__(self):
self._PosX = 0
@@ -46,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
@@ -83,7 +84,7 @@ class PageListItem(object):
l = Label()
l._PosX = 10
l.SetCanvasHWND(self._Parent._CanvasHWND)
text = MyLangManager.Tr(text)
l.Init(text,self._Fonts["normal"])
self._Labels["Text"] = l
@@ -102,13 +103,13 @@ class PageListItem(object):
self._Labels["Small"]._PosY = self._PosY + (self._Height- self._Labels["Small"]._Height)/2
self._Labels["Small"].Draw()
pygame.draw.line(self._Parent._CanvasHWND,(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)
class InfoPage(Page):
_FootMsg = ["Nav.","","","Back",""]
_FootMsg = ["Nav","","","Back",""]
_MyList = []
_ListFontObj = fonts["varela15"]
_ListFontObj = MyLangManager.TrFont("varela15")
_AList = {}
_Time1 = 40
@@ -122,22 +123,22 @@ class InfoPage(Page):
m = int(secs/60)
s = secs % 60
if m > 1:
min_str = "%d minutes " % m
min_str = ("%d "+MyLangManager.Tr("minutes")+" ") % m
else:
min_str = "%d minute " % m
min_str = ("%d "+MyLangManager.Tr("minute")+" ") % m
if s == 1:
sec_str = "%d second" % s
sec_str = ("%d "+MyLangManager.Tr("second")) % s
elif s > 1:
sec_str = "%d seconds" % s
sec_str = ("%d "+MyLangManager.Tr("seconds")) % s
elif secs > 0:
if secs > 1:
sec_str = "%d seconds" % secs
sec_str = ("%d "+MyLangManager.Tr("seconds")) % secs
else:
sec_str = "%d second" % secs
sec_str = ("%d "+MyLangManager.Tr("second")) % secs
elif secs == 0:
sec_str = "Never"
sec_str = MyLangManager.Tr("Never")
return min_str + sec_str
@@ -155,7 +156,7 @@ class InfoPage(Page):
time1 = {}
time1["key"] = "time1"
if self._Time1 == 0:
time1["value"] = "Never"
time1["value"] = MyLangManager.Tr("Never")
else:
time1["value"] = "%d secs" % self._Time1
time1["label"] = "Screen dimming"
@@ -163,7 +164,7 @@ class InfoPage(Page):
time2 = {}
time2["key"] = "time2"
if self._Time2 == 0:
time2["value"] = "Never"
time2["value"] = MyLangManager.Tr("Never")
else:
time2["value"] = "%d secs" % self._Time2
@@ -173,7 +174,7 @@ class InfoPage(Page):
time3["key"] = "time3"
if self._Time3 == 0:
time3["value"] = "Never"
time3["value"] = MyLangManager.Tr("Never")
else:
time3["value"] = "%d secs" % self._Time3
time3["label"] = "Power OFF"
@@ -188,17 +189,17 @@ class InfoPage(Page):
start_y = 0
for i,v in enumerate( self._AList):
print(v)
#print(v)
li = PageListItem()
li._Parent = self
li._PosX = start_x
li._PosY = start_y + i*PageListItem._Height
li._Width = Width
li._Fonts["normal"] = self._ListFontObj
li._Fonts["small"] = fonts["varela12"]
li._Fonts["small"] = MyLangManager.TrFont("varela12")
if self._AList[v]["label"] != "":
li.Init( self._AList[v]["label"] )
li.Init( self._AList[v]["label"] )
else:
li.Init( self._AList[v]["key"] )
@@ -266,7 +267,7 @@ class InfoPage(Page):
"""
def KeyDown(self,event):
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
@@ -288,9 +289,9 @@ class InfoPage(Page):
i.Draw()
class PowerOptionsPage(Page):
_FootMsg = ["Nav.","","Detail","Back","Select"]
_FootMsg = ["Nav","Detail","","Back","Select"]
_MyList = []
_ListFont = fonts["notosanscjk15"]
_ListFont = MyLangManager.TrFont("notosanscjk15")
_AList = {}
@@ -400,30 +401,6 @@ class PowerOptionsPage(Page):
self._InfoPage._Screen = self._Screen
self._InfoPage._Name = "Power option detail"
self._InfoPage.Init()
def ScrollDown(self):
if len(self._MyList) == 0:
return
self._PsIndex +=1
if self._PsIndex >= len(self._MyList):
self._PsIndex = len(self._MyList) -1
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY +cur_li._Height > self._Height:
for i in range(0,len(self._MyList)):
self._MyList[i]._PosY -= self._MyList[i]._Height
def ScrollUp(self):
if len(self._MyList) == 0:
return
self._PsIndex -= 1
if self._PsIndex < 0:
self._PsIndex = 0
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY < 0:
for i in range(0, len(self._MyList)):
self._MyList[i]._PosY += self._MyList[i]._Height
def Click(self):
if len(self._MyList) == 0:
@@ -443,7 +420,12 @@ class PowerOptionsPage(Page):
config.PowerLevel = cur_li._Value
self._Screen._MsgBox.SetText("Applying...")
if config.PowerLevel!= "supersaving":
os.system("sudo iw wlan0 set power_save off > /dev/null")
else:
os.system("sudo iw wlan0 set power_save on > /dev/null")
self._Screen._MsgBox.SetText("Applying")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
@@ -478,12 +460,12 @@ class PowerOptionsPage(Page):
self._Screen.SwapAndShow()
"""
def KeyDown(self,event):
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["B"]:
if IsKeyStartOrA(event.key):
self.Click()
if event.key == CurKeys["Up"]:
@@ -0,0 +1,167 @@
# -*- coding: utf-8 -*-
import pygame
#from libs.roundrects import aa_round_rect
import alsaaudio
## local UI import
from UI.constants import Width,Height,ICON_TYPES
from UI.page import Page,PageSelector
from UI.icon_item import IconItem
from UI.label import Label
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
_Parent = None
_VolumeLabel =None
def __init__(self):
Slider.__init__(self)
def Init(self):
self._Width = self._Parent._Width
self._Height = self._Parent._Height
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
if vol >= 0 and vol <= 100:
self._Value = vol
def Further(self):
self._Value+=5
if self._Value > 100:
self._Value = 100
if self.OnChangeCB != None:
if callable(self.OnChangeCB):
self.OnChangeCB( self._Value )
def StepBack(self):
self._Value-=5
if self._Value < 0:
self._Value = 0
if self.OnChangeCB != None:
if callable(self.OnChangeCB):
self.OnChangeCB( self._Value )
def Draw(self):
start_x = 82
start_y = self._Parent._Screen._Height/2-5
height = 30
width = 4
seg = self._Value / 5
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._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):
_MySlider = None
_FootMsg = ["Nav","","","Back","Enter"]
def Init(self):
self._CanvasHWND = self._Screen._CanvasHWND
self._Width = self._Screen._Width
self._Height = self._Screen._Height
self._MySlider = SoundSlider()
self._MySlider._Parent = self
self._MySlider.SetCanvasHWND(self._CanvasHWND)
self._MySlider.OnChangeCB = self.WhenSliderDrag
self._MySlider.Init()
try:
m = alsaaudio.Mixer()
self._MySlider.SetValue(m.getvolume()[0])
except Exception,e:
print(str(e))
self._MySlider.SetValue(0)
def OnLoadCb(self):
try:
m = alsaaudio.Mixer()
self._MySlider.SetValue(m.getvolume()[0])
except Exception,e:
print(str(e))
def WhenSliderDrag(self,value): ##value 0-100
if value < 0 or value > 100:
return
m = alsaaudio.Mixer()
m.setvolume(int(value))
def KeyDown(self,event):
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Right"]:
self._MySlider.Further()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Left"]:
self._MySlider.StepBack()
self._Screen.Draw()
self._Screen.SwapAndShow()
def Draw(self):
self.ClearCanvas()
self._MySlider.Draw()
@@ -6,15 +6,13 @@ import os
## local UI import
from UI.page import Page
from UI.skin_manager import MySkinManager
from UI.constants import ICON_TYPES,Width,Height
from UI.icon_item import IconItem
from UI.icon_pool import MyIconPool
from UI.label import Label
from UI.fonts import fonts
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 = pygame.Color(51,166,255)
_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]), fonts["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),fonts["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",fonts["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_, (193,193,193),5,0,(193,193,193))
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, (126,206,244),5,0,(126,206,244))
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):
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
import pygame
## local UI import
import pages
import myvars
def Init(main_screen):
pages.InitTimezoneListPage(main_screen)
def API(main_screen):
if main_screen !=None:
main_screen.PushCurPage()
main_screen.SetCurPage(myvars.TimezoneListPage)
main_screen.Draw()
main_screen.SwapAndShow()
@@ -0,0 +1,112 @@
# -*- coding: utf-8 -*-
import pygame
from libs.roundrects import aa_round_rect
## local UI import
from UI.constants import ICON_TYPES
from UI.page import Page
from UI.label import Label
from UI.icon_item import IconItem
from UI.util_funcs import midRect
from UI.skin_manager import MySkinManager
# a item for List
# - - - - - - - - - - - --
# | Icon Text..... > |
# ------------------------
import myvars # icons_path
class ListItemIcon(IconItem):
_CanvasHWND = None
_Parent = None
_Width = 18
_Height = 18
def Draw(self):
self._CanvasHWND.blit(self._ImgSurf,(self._PosX,self._PosY+(self._Parent._Height-self._Height)/2,self._Width,self._Height))
class ListItemLabel(Label):
_ActiveColor = MySkinManager.GiveColor('Active')
_Active = False
def Draw(self):
self._FontObj.set_bold(self._Active)
my_text = self._FontObj.render( self._Text,True,self._Color)
self._CanvasHWND.blit(my_text,(self._PosX,self._PosY,self._Width,self._Height))
class ListItem(object):
_PosX = 0
_PosY = 0
_Width = 0
_Height = 30
_Labels = {}
_Icons = {}
_Fonts = {}
_MyType = ICON_TYPES["EXE"]
_LinkObj = None
_Path = ""
_Active = False
_Parent = None
_Text = ""
def __init__(self):
self._Labels = {}
self._Icons = {}
self._Fonts = {}
def Init(self,text):
self._Text = text
l = ListItemLabel()
l._PosX = 22
l.SetCanvasHWND(self._Parent._CanvasHWND)
if self._MyType == ICON_TYPES["DIR"]:
l.Init(text,self._Fonts["normal"])
self._Path = text
else:
l.Init(text,self._Fonts["normal"])
self._Path = text
self._Labels["Text"] = l
def NewCoord(self,x,y):
self._PosX = x
self._PosY = y
def Draw(self):
if self._MyType == ICON_TYPES["DIR"] and self._Path != "[..]":
self._Parent._Icons["sys"]._IconIndex = 0
self._Parent._Icons["sys"].NewCoord(self._PosX+12,self._PosY+ (self._Height - self._Parent._Icons["sys"]._Height)/2+self._Parent._Icons["sys"]._Height/2)
self._Parent._Icons["sys"].Draw()
if self._MyType == ICON_TYPES["FILE"]:
self._Parent._Icons["sys"]._IconIndex = 1
self._Parent._Icons["sys"].NewCoord(self._PosX+12,self._PosY+ (self._Height - self._Parent._Icons["sys"]._Height)/2+self._Parent._Icons["sys"]._Height/2)
self._Parent._Icons["sys"].Draw()
if self._Active == True:
self._Labels["Text"]._Active = True
else:
self._Labels["Text"]._Active = False
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
self._Labels["Text"].Draw()
+16
View File
@@ -0,0 +1,16 @@
import logzero
def get_logger():
# Set a custom formatter
log_format = '%(color)s[%(levelname)1.1s ' \
'%(asctime)s.%(msecs)03d %(module)s:%(lineno)d]' \
'%(end_color)s %(message)s'
formatter = logzero.LogFormatter(fmt=log_format)
logzero.setup_default_logger(formatter=formatter)
logzero.logfile(
'logzero.log',
maxBytes=1e6,
backupCount=3
)
return logzero.logger
@@ -0,0 +1,5 @@
TimePage = None
TimezoneListPage = None
+13
View File
@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
from timezone_lib_list_page import TimezoneListPage
import myvars
def InitTimePage(main_screen):
myvars.TimePage = None
def InitTimezoneListPage(main_screen):
myvars.TimezoneListPage = TimezoneListPage()
myvars.TimezoneListPage._Screen = main_screen
myvars.TimezoneListPage._Name = "Timezone Selection"
myvars.TimezoneListPage.Init()
@@ -0,0 +1,304 @@
# -*- coding: utf-8 -*-
import os
import subprocess
import pygame
from libs.roundrects import aa_round_rect
## local UI import
from UI.constants import Width,Height,ICON_TYPES
from UI.page import Page,PageSelector
from UI.label import Label
from UI.icon_item import IconItem
from UI.util_funcs import midRect
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.multi_icon_item import MultiIconItem
from UI.icon_pool import MyIconPool
from UI.scroller import ListScroller
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from list_item import ListItem
import myvars
class TimeLibStack:
def __init__(self):
self.stack = list()
def Push(self,data):
if data not in self.stack:
self.stack.append(data)
return True
return False
def Pop(self):
if len(self.stack)<=0:
return None,False
return self.stack.pop(),True
def Last(self):
idx = len(self.stack) -1
if idx < 0:
return "/usr/share/zoneinfo/posix"
else:
return self.stack[ idx ]
def Length(self):
return len(self.stack)
class ListPageSelector(PageSelector):
_BackgroundColor = MySkinManager.GiveColor('Line')
def __init__(self):
self._PosX = 0
self._PosY = 0
self._Height = 0
self._Width = Width
def AnimateDraw(self,x2,y2):
pass
def Draw(self):
idx = self._Parent._PsIndex
if idx < len(self._Parent._MyList):
x = self._Parent._MyList[idx]._PosX+2
y = self._Parent._MyList[idx]._PosY+1
h = self._Parent._MyList[idx]._Height -3
self._PosX = x
self._PosY = y
self._Height = h
#aa_round_rect(self._Parent._CanvasHWND,
# (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width-4,h),0)
class TimezoneListPage(Page):
_Icons = {}
_Selector=None
_FootMsg = ["Nav","","","Back","Select"]
_MyList = []
_SwapMyList = []
_ListFont = MyLangManager.TrFont("notosanscjk15")
_MyStack = None
_Scroller = None
_BGpng = None
_BGwidth = 56
_BGheight = 70
def __init__(self):
Page.__init__(self)
self._Icons = {}
self._CanvasHWND = None
self._MyList = []
self._SwapMyList = []
self._MyStack = TimeLibStack()
def buildDirectoryList(self, path):
elements = [
{
'name': f,
'file_path': os.path.join(path, f),
'is_file': os.path.isfile(os.path.join(path, f))
}
for f in os.listdir(path)
]
return elements
def SyncList(self,path):
alist = self.buildDirectoryList(path)
if not alist:
print("buildDirectoryList empty")
return
self._MyList = []
self._SwapMyList = []
start_x = 0
start_y = 0
hasparent = 0
if self._MyStack.Length() > 0:
hasparent = 1
li = ListItem()
li._Parent = self
li._PosX = start_x
li._PosY = start_y
li._Width = Width
li._Fonts["normal"] = self._ListFont
li._MyType = ICON_TYPES["DIR"]
li.Init("[..]")
self._MyList.append(li)
for i,v in enumerate(sorted(alist)):
li = ListItem()
li._Parent = self
li._PosX = start_x
li._PosY = start_y + (i+hasparent)*ListItem._Height
li._Width = Width
li._Fonts["normal"] = self._ListFont
li._MyType = ICON_TYPES["FILE"]
if not v['is_file']:
li._MyType = ICON_TYPES["DIR"]
else:
li._MyType = ICON_TYPES["FILE"]
li.Init( v['name'] )
li._Path = v["file_path"]
self._MyList.append(li)
for i in self._MyList:
self._SwapMyList.append(i)
def Init(self):
self._PosX = self._Index * self._Screen._Width
self._Width = self._Screen._Width
self._Height = self._Screen._Height
self._CanvasHWND = self._Screen._CanvasHWND
ps = ListPageSelector()
ps._Parent = self
self._Ps = ps
self._PsIndex = 0
self.SyncList("/usr/share/zoneinfo/posix")
icon_for_list = MultiIconItem()
icon_for_list._ImgSurf = MyIconPool._Icons["sys"]
icon_for_list._MyType = ICON_TYPES["STAT"]
icon_for_list._Parent = self
icon_for_list.Adjust(0,0,18,18,0)
self._Icons["sys"] = icon_for_list
self._BGpng = IconItem()
self._BGpng._ImgSurf = MyIconPool._Icons["empty"]
self._BGpng._MyType = ICON_TYPES["STAT"]
self._BGpng._Parent = self
self._BGpng.AddLabel("No timezones found on system!", MyLangManager.TrFont("varela22"))
self._BGpng.SetLableColor(MySkinManager.GiveColor('Disabled'))
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
self._Scroller = ListScroller()
self._Scroller._Parent = self
self._Scroller._PosX = self._Width - 10
self._Scroller._PosY = 2
self._Scroller.Init()
def Click(self):
if len(self._MyList) == 0:
return
cur_li = self._MyList[self._PsIndex]
if cur_li._MyType == ICON_TYPES["DIR"]:
if cur_li._Path == "[..]":
self._MyStack.Pop()
self.SyncList( self._MyStack.Last() )
self._PsIndex = 0
else:
self._MyStack.Push( self._MyList[self._PsIndex]._Path )
self.SyncList( self._MyStack.Last() )
self._PsIndex = 0
if cur_li._MyType == ICON_TYPES["FILE"]: ## set the current timezone
subprocess.call(['sudo', 'cp', cur_li._Path, '/etc/localtime'])
#copyfile(cur_li._Path, '/etc/localtime')
print("add" , cur_li._Path)
self._Screen.Draw()
self._Screen.SwapAndShow()
def Rescan(self):
self.SyncList("/usr/share/zoneinfo/posix")
self._PsIndex = 0
def KeyDown(self,event):
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
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()
if event.key == CurKeys["Right"]:
self.FScrollDown(Step=5)
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Left"]:
self.FScrollUp(Step=5)
self._Screen.Draw()
self._Screen.SwapAndShow()
if IsKeyStartOrA(event.key):
self.Click()
def Draw(self):
self.ClearCanvas()
if len(self._MyList) == 0:
self._BGpng.NewCoord(self._Width/2,self._Height/2)
self._BGpng.Draw()
return
else:
if len(self._MyList) * ListItem._Height > self._Height:
self._Ps._Width = self._Width - 11
self._Ps.Draw()
for i in self._MyList:
if False:
i._Active = True
else:
i._Active = False
if i._PosY > self._Height + self._Height/2:
break
if i._PosY < 0:
continue
i.Draw()
self._Scroller.UpdateSize( len(self._MyList)*ListItem._Height, self._PsIndex*ListItem._Height)
self._Scroller.Draw()
else:
self._Ps._Width = self._Width
self._Ps.Draw()
for i in self._MyList:
if False:
i._Active = True
else:
i._Active = False
if i._PosY > self._Height + self._Height/2:
break
if i._PosY < 0:
continue
i.Draw()
@@ -9,22 +9,27 @@ import gobject
## local UI import
from UI.page import Page
from UI.constants import ICON_TYPES,Width,Height,RUNEVT
from UI.constants import ICON_TYPES,Width,Height,RUNEVT,RUNSH
from UI.icon_item import IconItem
from UI.icon_pool import MyIconPool
from UI.label import Label
from UI.fonts import fonts
from UI.util_funcs import midRect,CmdClean,get_git_revision_short_hash
from UI.keys_def import CurKeys
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.confirm_page import ConfirmPage
from UI.download import Download
from UI.download_process_page import DownloadProcessPage
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from UI.info_page_list_item import InfoPageListItem
from libs.roundrects import aa_round_rect
from libs.DBUS import is_wifi_connected_now
import config
LauncherLoc = "/home/cpi/launcher"
class UpdateDownloadPage(DownloadProcessPage):
_MD5 = ""
@@ -38,7 +43,7 @@ class UpdateDownloadPage(DownloadProcessPage):
if filename.endswith(".tar.gz"):
#/home/cpi/apps/[launcher]
cmdpath = "tar zxf " + CmdClean(filename) + " -C /home/cpi/apps ;rm -rf "+ filename
cmdpath = "tar zxf " + CmdClean(filename) + " -C /home/cpi/ ;rm -rf "+ filename
pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
self.ReturnToUpLevelPage()
@@ -59,7 +64,7 @@ class UpdateDownloadPage(DownloadProcessPage):
print(filename)
os.system("rm -rf %s" % CmdClean(filename))
self._Screen._MsgBox.SetText("Download failed")
self._Screen._MsgBox.SetText("DownloadFailed")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
return False
@@ -104,22 +109,22 @@ class UpdateConfirmPage(ConfirmPage):
_GIT = False
def KeyDown(self,event):
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
global LauncherLoc
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["B"]:
if IsKeyStartOrA(event.key):
if self._GIT == True:
cmdpath = "feh --bg-center /home/cpi/apps/launcher/sys.py/gameshell/wallpaper/updating.png; cd /home/cpi/apps/launcher ;git pull; git reset --hard %s ; feh --bg-center /home/cpi/apps/launcher/sys.py/gameshell/wallpaper/loading.png " % self._Version
pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
self._GIT = False
cmdpath = "%s/update.sh %s" % (LauncherLoc,self._Version)
pygame.event.post( pygame.event.Event(RUNSH, message=cmdpath))
return
if self._DownloadPage == None:
self._DownloadPage = UpdateDownloadPage()
self._DownloadPage._Screen = self._Screen
self._DownloadPage._Name = "Downloading..."
self._DownloadPage._Name = "Downloading"
self._DownloadPage.Init()
self._DownloadPage._MD5 = self._MD5
@@ -147,65 +152,14 @@ class UpdateConfirmPage(ConfirmPage):
self.Reset()
class InfoPageListItem(object):
_PosX = 0
_PosY = 0
_Width = 0
_Height = 30
_Labels = {}
_Icons = {}
_Fonts = {}
_LinkObj = None
def __init__(self):
self._Labels = {}
self._Icons = {}
self._Fonts = {}
def SetSmallText(self,text):
l = Label()
l._PosX = 40
l.SetCanvasHWND(self._Parent._CanvasHWND)
l.Init(text,self._Fonts["small"])
self._Labels["Small"] = l
def Init(self,text):
#self._Fonts["normal"] = fonts["veramono12"]
l = Label()
l._PosX = 10
l.SetCanvasHWND(self._Parent._CanvasHWND)
l.Init(text,self._Fonts["normal"])
self._Labels["Text"] = l
def Draw(self):
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
self._Labels["Text"].Draw()
if "Small" in self._Labels:
self._Labels["Small"]._PosX = self._Width - self._Labels["Small"]._Width-5
self._Labels["Small"]._PosY = self._PosY + (self._Height - self._Labels["Small"]._Height)/2
self._Labels["Small"].Draw()
pygame.draw.line(self._Parent._CanvasHWND,(169,169,169),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
class UpdatePage(Page):
_Icons = {}
_FootMsg = ["Nav.","Check Update","","Back",""]
_FootMsg = ["Nav","","Check Update","Back",""]
_ListFontObj = fonts["varela15"]
_ListFontObj = MyLangManager.TrFont("varela15")
_ConfirmPage = None
_AList = {}
_MyList = []
def __init__(self):
Page.__init__(self)
self._Icons = {}
@@ -222,7 +176,7 @@ class UpdatePage(Page):
li._PosY = start_y + i*InfoPageListItem._Height
li._Width = Width
li._Fonts["normal"] = self._ListFontObj
li._Fonts["small"] = fonts["varela12"]
li._Fonts["small"] = MySkinManager.GiveFont("varela12")
if self._AList[v]["label"] != "":
li.Init( self._AList[v]["label"] )
@@ -255,7 +209,8 @@ class UpdatePage(Page):
self.GenList()
def CheckUpdate(self):
self._Screen._MsgBox.SetText("Checking update...")
global LauncherLoc
self._Screen._MsgBox.SetText("CheckingUpdate")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
@@ -279,12 +234,12 @@ class UpdatePage(Page):
self._Screen.PushPage(self._ConfirmPage)
self._Screen.Draw()
self._ConfirmPage.SnapMsg("Confirm Update to %s ?" % json_["version"] )
self._ConfirmPage.SnapMsg(MyLangManager.Tr("ConfirmUpdateToFQ") % json_["version"] )
self._Screen.SwapAndShow()
elif "gitversion" in json_: ### just use git to run update
cur_dir = os.getcwd()
os.chdir("/home/cpi/apps/launcher")
os.chdir(LauncherLoc)
current_git_version = get_git_revision_short_hash()
current_git_version = current_git_version.strip("\n")
current_git_version = current_git_version.strip("\t")
@@ -298,11 +253,11 @@ class UpdatePage(Page):
self._Screen.PushPage(self._ConfirmPage)
self._Screen.Draw()
self._ConfirmPage.SnapMsg("Update to %s ?" % json_["gitversion"] )
self._ConfirmPage.SnapMsg(MyLangManager.Tr("UpdateToFQ") % json_["gitversion"] )
self._Screen.SwapAndShow()
else:
self._Screen.Draw()
self._Screen._MsgBox.SetText("Launcher is up to date")
self._Screen._MsgBox.SetText("LauncherIsUpToDate")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
pygame.time.delay(765)
@@ -321,7 +276,7 @@ class UpdatePage(Page):
pass
def KeyDown(self,event):
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
@@ -333,12 +288,12 @@ class UpdatePage(Page):
self._Screen.SwapAndShow()
else:
self._Screen.Draw()
self._Screen._MsgBox.SetText("Checking update failed")
self._Screen._MsgBox.SetText("CheckingUpdateFailed")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
else:
self._Screen.Draw()
self._Screen._MsgBox.SetText("Please Check your Wi-Fi connection")
self._Screen._MsgBox.SetText("CheckWifiConnection")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
@@ -359,7 +314,7 @@ class APIOBJ(object):
self._UpdatePage = UpdatePage()
self._UpdatePage._Screen = main_screen
self._UpdatePage._Name ="Update"
self._UpdatePage._Name = "Update"
self._UpdatePage.Init()
def API(self,main_screen):
@@ -13,7 +13,8 @@ except:
def Init(main_screen):
pages.InitPasswordPage(main_screen)
pages.InitScanPage(main_screen)
myvars.PasswordPage._Caller = myvars.ScanPage
def API(main_screen):
if main_screen != None:
@@ -5,11 +5,11 @@ import pygame
## local UI import
from UI.page import Page
from UI.label import Label
from UI.fonts import fonts
from UI.icon_item import IconItem
from UI.multi_icon_item import MultiIconItem
from UI.icon_pool import MyIconPool
from UI.skin_manager import MySkinManager
from UI.widget import Widget
class NetItemMultiIcon(MultiIconItem):
_CanvasHWND = None
@@ -32,10 +32,7 @@ class NetItemIcon(IconItem):
self._CanvasHWND.blit(self._ImgSurf,(self._PosX,self._PosY+(self._Parent._Height-self._Height)/2,self._Width,self._Height))
class NetItem(object):
_PosX = 0
_PosY = 0
_Width = 0
class NetItem(Widget):
_Height = 30
_Bssid="" # 50:3A:A0:51:18:3C
@@ -140,13 +137,13 @@ class NetItem(object):
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
@@ -194,6 +191,6 @@ class NetItem(object):
self._Icons["wifistatus"].NewCoord(self._Width-23,self._PosY)
self._Icons["wifistatus"].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)
@@ -16,7 +16,7 @@
## local UI import
from libs.DBUS import bus,daemon,wireless,wired
from keyboard import Keyboard
from UI.keyboard import Keyboard
from wifi_list import WifiList
import myvars
@@ -10,80 +10,34 @@ from wicd import misc
from UI.constants import Width,Height
from UI.page import Page,PageSelector
from UI.label import Label
from UI.fonts import fonts
from UI.util_funcs import midRect,SwapAndShow
from UI.keys_def import CurKeys
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.scroller import ListScroller
from UI.confirm_page import ConfirmPage
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from UI.info_page_list_item import InfoPageListItem
from UI.info_page_selector import InfoPageSelector
from libs.DBUS import is_wifi_connected_now
from net_item import NetItem
import myvars
class InfoPageListItem(object):
_PosX = 0
_PosY = 0
_Width = 0
_Height = 30
_Labels = {}
_Icons = {}
_Fonts = {}
_LinkObj = None
def __init__(self):
self._Labels = {}
self._Icons = {}
self._Fonts = {}
def SetSmallText(self,text):
l = Label()
l._PosX = 40
l.SetCanvasHWND(self._Parent._CanvasHWND)
l.Init(text,self._Fonts["small"])
self._Labels["Small"] = l
def Init(self,text):
#self._Fonts["normal"] = fonts["veramono12"]
l = Label()
l._PosX = 10
l.SetCanvasHWND(self._Parent._CanvasHWND)
l.Init(text,self._Fonts["normal"])
self._Labels["Text"] = l
def Draw(self):
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
self._Labels["Text"].Draw()
if "Small" in self._Labels:
self._Labels["Small"]._PosX = self._Width - self._Labels["Small"]._Width-5
self._Labels["Small"]._PosY = self._PosY + (self._Height - self._Labels["Small"]._Height)/2
self._Labels["Small"].Draw()
pygame.draw.line(self._Parent._CanvasHWND,(169,169,169),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
class WifiDisconnectConfirmPage(ConfirmPage):
_ConfirmText = "Confirm Disconnect?"
_ConfirmText = MyLangManager.Tr("ConfirmDisconnectQ")
def KeyDown(self,event):
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["B"]:
self.SnapMsg("Disconnecting...")
if IsKeyStartOrA(event.key):
self.SnapMsg(MyLangManager.Tr("Disconnecting"))
self._Screen.Draw()
self._Screen.SwapAndShow()
@@ -104,36 +58,10 @@ class WifiDisconnectConfirmPage(ConfirmPage):
self.Reset()
class WifiInfoPageSelector(PageSelector):
_BackgroundColor = pygame.Color(131,199,219)
def __init__(self):
self._PosX = 0
self._PosY = 0
self._Height = 0
self._Width = Width
def AnimateDraw(self,x2,y2):
pass
def Draw(self):
idx = self._Parent._PsIndex
if idx < len(self._Parent._MyList):
x = 2
y = self._Parent._MyList[idx]._PosY+1
h = self._Parent._MyList[idx]._Height -3
self._PosX = x
self._PosY = y
self._Height = h
aa_round_rect(self._Parent._CanvasHWND,
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
class WifiInfoPage(Page):
_FootMsg = ["Nav.","Disconnect","","Back",""]
_FootMsg = ["Nav","","","Back",""]
_MyList = []
_ListFontObj = fonts["varela15"]
_ListFontObj = MyLangManager.TrFont("varela15")
_Wireless = None
_Daemon = None
@@ -165,7 +93,7 @@ class WifiInfoPage(Page):
li._PosY = start_y + i*InfoPageListItem._Height
li._Width = Width
li._Fonts["normal"] = self._ListFontObj
li._Fonts["small"] = fonts["varela12"]
li._Fonts["small"] = MyLangManager.TrFont("varela12")
if self._AList[v]["label"] != "":
li.Init( self._AList[v]["label"] )
@@ -187,8 +115,9 @@ class WifiInfoPage(Page):
self._Width = self._Screen._Width ## equal to screen width
self._Height = self._Screen._Height
ps = WifiInfoPageSelector()
ps = InfoPageSelector()
ps._Parent = self
ps._PosX = 2
self._Ps = ps
self._PsIndex = 0
@@ -212,30 +141,6 @@ class WifiInfoPage(Page):
self._DisconnectConfirmPage._Name = "Confirm Disconnect"
self._DisconnectConfirmPage._Parent = self
self._DisconnectConfirmPage.Init()
def ScrollUp(self):
if len(self._MyList) == 0:
return
self._PsIndex -= 1
if self._PsIndex < 0:
self._PsIndex = 0
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY < 0:
for i in range(0, len(self._MyList)):
self._MyList[i]._PosY += self._MyList[i]._Height
def ScrollDown(self):
if len(self._MyList) == 0:
return
self._PsIndex +=1
if self._PsIndex >= len(self._MyList):
self._PsIndex = len(self._MyList) -1
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY +cur_li._Height > self._Height:
for i in range(0,len(self._MyList)):
self._MyList[i]._PosY -= self._MyList[i]._Height
def Click(self):
cur_li = self._MyList[self._PsIndex]
@@ -253,9 +158,9 @@ class WifiInfoPage(Page):
def OnLoadCb(self):
if self._Wireless.GetCurrentNetworkID(self._Wireless.GetIwconfig()) == self._NetworkId \
and self._Wireless.GetWirelessIP('') is not None:
self._FootMsg[1] = "Disconnect"
self._FootMsg[2] = "Disconnect"
else:
self._FootMsg[1] = ""
self._FootMsg[2] = ""
self.GenList()
@@ -265,7 +170,7 @@ class WifiInfoPage(Page):
self._Screen.SwapAndShow()
def KeyDown(self,event):
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
@@ -280,7 +185,7 @@ class WifiInfoPage(Page):
self._Screen.SwapAndShow()
if event.key == CurKeys["Enter"]:
if IsKeyStartOrA(event.key):
self.Click()
if event.key == CurKeys["X"]:
@@ -297,12 +202,10 @@ class WifiInfoPage(Page):
class WifiListSelector(PageSelector):
_BackgroundColor = pygame.Color(131,199,219)
_BackgroundColor = MySkinManager.GiveColor('Line')
def __init__(self):
self._PosX = 0
self._PosY = 0
self._Height = 0
pass
def AnimateDraw(self,x2,y2):
pass
@@ -310,17 +213,16 @@ class WifiListSelector(PageSelector):
def Draw(self):
idx = self._Parent._PsIndex
if idx < len( self._Parent._WirelessList):
x = self._Parent._WirelessList[idx]._PosX+11
y = self._Parent._WirelessList[idx]._PosY+1
h = self._Parent._WirelessList[idx]._Height -3
if idx < len( self._Parent._MyList):
x = self._Parent._MyList[idx]._PosX+11
y = self._Parent._MyList[idx]._PosY+1
h = self._Parent._MyList[idx]._Height -3
self._PosX = x
self._PosY = y
self._Height = h
aa_round_rect(self._Parent._CanvasHWND,
(x,y,self._Width,h),self._BackgroundColor,4,0,self._BackgroundColor)
pygame.draw.rect(self._Parent._CanvasHWND,self._BackgroundColor,(x,y,self._Width,h),0)
class WifiListMessageBox(Label):
@@ -333,14 +235,14 @@ class WifiListMessageBox(Label):
x = (self._Parent._Width - w)/2
y = (self._Parent._Height - h)/2
padding = 10
pygame.draw.rect(self._CanvasHWND,(255,255,255),(x-padding,y-padding, w+padding*2,h+padding*2))
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),(x-padding,y-padding, w+padding*2,h+padding*2))
pygame.draw.rect(self._CanvasHWND,(0,0,0),(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))
class WifiList(Page):
_WirelessList = []
_MyList = []
#Wicd dbus part
_Wireless = None
_Daemon = None
@@ -360,16 +262,17 @@ class WifiList(Page):
_BlockCb = None
_LastStatusMsg = ""
_FootMsg = ["Nav.","Scan","Info","Back","Enter"]
_FootMsg = ["Nav","Info","Scan","Back","Enter"]
_EncMethods = None
_Scroller = None
_ListFontObj = fonts["notosanscjk15"]
_ListFontObj = MyLangManager.TrFont("notosanscjk15")
_InfoPage = None
_CurBssid = ""
def __init__(self):
Page.__init__(self)
self._WirelessList = []
self._MyList = []
self._CanvasHWND = None
def ShowBox(self,msg):
@@ -386,7 +289,7 @@ class WifiList(Page):
self._Screen.SwapAndShow()
def GenNetworkList(self):
self._WirelessList = []
self._MyList = []
start_x = 0
start_y = 0
@@ -405,7 +308,7 @@ class WifiList(Page):
#ni._Bssid = self._Wireless.GetWirelessProperty(network_id,"bssid")
ni.Init(network_id,is_active)
self._WirelessList.append(ni)
self._MyList.append(ni)
self._PsIndex = 0
@@ -443,7 +346,7 @@ class WifiList(Page):
return
self._Scanning = True
self.ShowBox("Wifi scanning...")
self.ShowBox(MyLangManager.Tr("Wifi scanning"))
self._BlockingUI = True
print("dbus says start scan...")
@@ -466,8 +369,8 @@ class WifiList(Page):
if info != None:
if len(info) > 3:
_id = int(info[3])
if _id < len(self._WirelessList):
self._WirelessList[_id].UpdateStrenLabel( str(info[2]))
if _id < len(self._MyList):
self._MyList[_id].UpdateStrenLabel( str(info[2]))
self._PrevWicdState = state
@@ -485,6 +388,7 @@ class WifiList(Page):
"""
if wireless_connecting:
if not fast:
iwconfig = self._Wireless.GetIwconfig()
else:
@@ -498,7 +402,6 @@ class WifiList(Page):
self._Screen._FootBar.UpdateNavText(self._LastStatusMsg)
SwapAndShow()
#self._ConnectTry+=1
return True
@@ -536,7 +439,7 @@ class WifiList(Page):
dbus.UInt32(2L)
['192.168.31.141', 'TP-LINK4G', '88', '0', '72.2 Mb/s']
"""
pp(info)
# pp(info)
self.UpdateNetList(state,info)
if info != None:
self._Screen.Draw()
@@ -587,7 +490,14 @@ class WifiList(Page):
return True
def ConfigWireless(self,password):
netid = self._PsIndex
for i,v in enumerate(self._MyList):
if v._Bssid == self._CurBssid:
netid = i
break
print(netid," ", password)
"""
self._Wireless.SetWirelessProperty(netid,"dhcphostname","GameShell")
@@ -610,8 +520,9 @@ class WifiList(Page):
self._Wireless.SetWirelessProperty(netid,"apsk",password)
self._Wireless.SetWirelessProperty(netid,"automatic",1)
self.ShowBox(MyLangManager.Tr("Connecting"))
self._WirelessList[netid].Connect()
self._MyList[netid].Connect()
print("after Connect")
self.UpdateStatus()
@@ -645,50 +556,50 @@ class WifiList(Page):
"""
return results
def ScrollUp(self):
if len(self._WirelessList) == 0:
return
self._PsIndex-=1
if self._PsIndex < 0:
self._PsIndex = 0
cur_ni = self._WirelessList[self._PsIndex]
if cur_ni._PosY < 0:
for i in range(0,len(self._WirelessList)):
self._WirelessList[i]._PosY += self._WirelessList[i]._Height
def ScrollDown(self):
if len(self._WirelessList) == 0:
return
self._PsIndex+=1
if self._PsIndex >= len(self._WirelessList):
self._PsIndex = len(self._WirelessList) -1
cur_ni = self._WirelessList[self._PsIndex]
if cur_ni._PosY + cur_ni._Height > self._Height:
for i in range(0,len(self._WirelessList)):
self._WirelessList[i]._PosY -= self._WirelessList[i]._Height
def AbortedAndReturnToUpLevel(self):
self.HideBox()
self._Screen._FootBar.ResetNavText()
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
def OnKbdReturnBackCb(self):
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
def KeyDown(self,event):
if self._BlockingUI == True:
print("UI blocking ...")
return
# if self._BlockingUI == True:
# print("UI blocking ...")
# return
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
if IsKeyMenuOrB(event.key):
if self._Wireless != None:
wireless_connecting = self._Wireless.CheckIfWirelessConnecting()
if wireless_connecting:
self.ShutDownConnecting()
self.ShowBox("ShutDownConnecting...")
self.ShowBox(MyLangManager.Tr("ShutDownConnecting"))
self._BlockingUI=True
self._BlockCb = self.AbortedAndReturnToUpLevel
else:
@@ -708,13 +619,14 @@ class WifiList(Page):
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["Enter"]: ## enter to set password,enter is B on GM
if len(self._WirelessList) == 0:
if IsKeyStartOrA(event.key): ## enter to set password,enter is B on GM
if len(self._MyList) == 0:
return
wicd_wirelss_encrypt_pwd = self.GetWirelessEncrypt(self._PsIndex)
self._CurBssid = self._MyList[self._PsIndex]._Bssid
if self._WirelessList[self._PsIndex]._IsActive:
wicd_wirelss_encrypt_pwd = self.GetWirelessEncrypt(self._PsIndex)
if self._MyList[self._PsIndex]._IsActive:
self.ShowBox( self._Wireless.GetWirelessIP('') )
else:
self._Screen.PushCurPage()
@@ -724,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)
@@ -744,7 +656,7 @@ class WifiList(Page):
self.Rescan(False)
if event.key == CurKeys["Y"]:
if len(self._WirelessList) == 0:
if len(self._MyList) == 0:
return
self._InfoPage._NetworkId = self._PsIndex
@@ -774,7 +686,7 @@ class WifiList(Page):
msgbox = WifiListMessageBox()
msgbox._CanvasHWND = self._CanvasHWND
msgbox.Init(" ",fonts["veramono12"])
msgbox.Init(" ",MyLangManager.TrFont("veramono12"))
msgbox._Parent = self
self._MsgBox = msgbox
@@ -807,19 +719,19 @@ class WifiList(Page):
self._InfoPage = WifiInfoPage()
self._InfoPage._Screen = self._Screen
self._InfoPage._Name = "Wifi info"
self._InfoPage._Name = MyLangManager.Tr("Wifi info")
self._InfoPage.Init()
def Draw(self):
self.ClearCanvas()
if len(self._WirelessList) == 0:
if len(self._MyList) == 0:
return
self._Ps.Draw()
for i in self._WirelessList:
for i in self._MyList:
i.Draw()
self._Scroller.UpdateSize( len(self._WirelessList)*NetItem._Height, self._PsIndex*NetItem._Height)
self._Scroller.UpdateSize( len(self._MyList)*NetItem._Height, self._PsIndex*NetItem._Height)
self._Scroller.Draw()
@@ -7,7 +7,8 @@ import pygame
## local UI import
from UI.page import Page
from UI.label import Label
from UI.fonts import fonts
from UI.lang_manager import MyLangManager
from UI.skin_manager import MySkinManager
# a item for List
# - - - - - - - - - - - --
@@ -34,9 +35,6 @@ class ListItem(object):
self._Icons = {}
self._Fonts = {}
def Init(self,text):
#self._Fonts["normal"] = fonts["veramono12"]
@@ -44,7 +42,7 @@ class ListItem(object):
l = Label()
l._PosX = 16
l.SetCanvasHWND(self._Parent._CanvasHWND)
text = MyLangManager.Tr(text)
l.Init(text,self._Fonts["normal"])
self._Labels["Text"] = l
@@ -54,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)
@@ -9,43 +9,17 @@ from libs.roundrects import aa_round_rect
from UI.constants import Width,Height
from UI.page import Page,PageSelector
from UI.label import Label
from UI.fonts import fonts
from UI.util_funcs import midRect,FileExists
from UI.keys_def import CurKeys
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.scroller import ListScroller
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from UI.info_page_selector import InfoPageSelector
from list_item import ListItem
import myvars
class ListPageSelector(PageSelector):
_BackgroundColor = pygame.Color(131,199,219)
def __init__(self):
self._PosX = 0
self._PosY = 0
self._Height = 0
self._Width = Width
def AnimateDraw(self,x2,y2):
pass
def Draw(self):
idx = self._Parent._PsIndex
if idx < len(self._Parent._MyList):
x = 2
y = self._Parent._MyList[idx]._PosY+1
h = self._Parent._MyList[idx]._Height -3
self._PosX = x
self._PosY = y
self._Height = h
aa_round_rect(self._Parent._CanvasHWND,
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
class ListPage(Page):
_Icons = {}
@@ -53,7 +27,7 @@ class ListPage(Page):
_FootMsg = ["Nav","","","Back","Enter"]
_MyList = []
_ListFontObj = fonts["varela15"]
_ListFontObj = MyLangManager.TrFont("varela15")
_Scroller = None
@@ -70,22 +44,31 @@ class ListPage(Page):
self._CanvasHWND = self._Screen._CanvasHWND
ps = ListPageSelector()
ps = InfoPageSelector()
ps._Parent = self
ps._PosX = 2
self._Ps = ps
self._PsIndex = 0
# "" pkgname, label
alist = [["","Airplane","Airplane Mode"],
["","PowerOptions","Power Options"],
["","Wifi","Wi-Fi"],
["","Sound","Sound Volume"],
["","Bluetooth","Bluetooth"],
["","Sound","Sound Volume"],
["","Brightness","BackLight Brightness"],
["","Storage",""],
["","Time","Timezone"],
["","Languages","Languages"],
["","Notification","Notification"],
["","Update", ""],
["","Cores", "Retroarch cores manager"],
["","About", "About"],
["","PowerOFF","Power off"],
["","ButtonsLayout","Buttons Layout"],]
["","PowerOFF","Power OFF"],
["","ButtonsLayout","Buttons Layout"],
#["","LauncherGo","Switch to LauncherGo"],
["","Lima","GPU Driver Switch"],
["","GateWay","Network Gateway Switch"]]
start_x = 0
start_y = 0
@@ -121,30 +104,6 @@ class ListPage(Page):
self._Scroller._PosY = 2
self._Scroller.Init()
def ScrollUp(self):
if len(self._MyList) == 0:
return
self._PsIndex -= 1
if self._PsIndex < 0:
self._PsIndex = 0
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY < 0:
for i in range(0, len(self._MyList)):
self._MyList[i]._PosY += self._MyList[i]._Height
def ScrollDown(self):
if len(self._MyList) == 0:
return
self._PsIndex +=1
if self._PsIndex >= len(self._MyList):
self._PsIndex = len(self._MyList) -1
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY +cur_li._Height > self._Height:
for i in range(0,len(self._MyList)):
self._MyList[i]._PosY -= self._MyList[i]._Height
def Click(self):
cur_li = self._MyList[self._PsIndex]
if cur_li._LinkObj != None:
@@ -155,7 +114,7 @@ class ListPage(Page):
def KeyDown(self,event):
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
@@ -170,7 +129,7 @@ class ListPage(Page):
self._Screen.SwapAndShow()
if event.key == CurKeys["Enter"]:
if IsKeyStartOrA(event.key):
self.Click()
def Draw(self):
@@ -4,15 +4,16 @@ import pygame
#UI lib
from UI.constants import RUNSYS
from UI.keys_def import CurKeys
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from UI.confirm_page import ConfirmPage
from UI.lang_manager import MyLangManager
import config
class PowerOffConfirmPage(ConfirmPage):
_ConfirmText = "Confirm Power OFF?"
_ConfirmText = MyLangManager.Tr("Awaiting Input")
_FootMsg = ["Nav","","Reboot","Cancel","Shutdown"]
def CheckBattery(self):
try:
@@ -41,13 +42,12 @@ class PowerOffConfirmPage(ConfirmPage):
def KeyDown(self,event):
if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]:
if IsKeyMenuOrB(event.key):
self.ReturnToUpLevelPage()
self._Screen.Draw()
self._Screen.SwapAndShow()
if event.key == CurKeys["B"]:
if IsKeyStartOrA(event.key):
if self.CheckBattery() < 20:
cmdpath = "feh --bg-center gameshell/wallpaper/gameover.png;"
else:
@@ -59,7 +59,12 @@ class PowerOffConfirmPage(ConfirmPage):
cmdpath += "sudo halt -p"
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
if event.key == CurKeys["X"]:
cmdpath = "feh --bg-center gameshell/wallpaper/seeyou.png;"
cmdpath += "sleep 3;"
cmdpath += "sudo reboot"
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
class APIOBJ(object):
@@ -71,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()
-1
View File
@@ -1 +0,0 @@
retroarch -L /home/cpi/apps/emulators/nxengine_libretro.so /home/cpi/games/nxengine/cavestory/data
-1
View File
@@ -1 +0,0 @@
retroarch
-1
View File
@@ -1 +0,0 @@
chocolate-doom -iwad /home/cpi/games/FreeDM/freedoom1.wad
+499
View File
@@ -0,0 +1,499 @@
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup").widget
-- Load Debian menu entries
-- require("debian.menu")
local capi = { screen = screen,
client = client }
local ipairs = ipairs
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!",
text = awesome.startup_errors,timeout=3 })
end
-- Handle runtime errors after startup
do
local in_error = false
awesome.connect_signal("debug::error", function (err)
-- Make sure we don't go into an endless error loop
if in_error then return end
in_error = true
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, an error happened!",
text = tostring(err),timeout=3 })
in_error = false
end)
end
-- }}}
theme_base = "/home/cpi/launcher/awesome"
-- Themes define colours, icons, font and wallpapers.
beautiful.init(theme_base .. "/themes/default/theme.lua")
-- This is used later as the default terminal and editor to run.
terminal = "xterm"
editor = os.getenv("EDITOR") or "editor"
editor_cmd = terminal .. " -e " .. editor
-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key,
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
-- However, you can use another modifier like Mod1, but it may interact with others.
modkey = "Mod4"
-- Table of layouts to cover with awful.layout.inc, order matters.
awful.layout.layouts = {
awful.layout.suit.floating,
awful.layout.suit.tile,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
awful.layout.suit.fair,
awful.layout.suit.fair.horizontal,
-- awful.layout.suit.spiral,
-- awful.layout.suit.spiral.dwindle,
--awful.layout.suit.max,
--awful.layout.suit.max.fullscreen,
awful.layout.suit.magnifier,
awful.layout.suit.corner.nw,
-- awful.layout.suit.corner.ne,
-- awful.layout.suit.corner.sw,
-- awful.layout.suit.corner.se,
}
-- }}}
-- {{{ Helper functions
local function tableHasKey(table,key)
return table[key] ~= nil
end
local function client_menu_toggle_fn()
local instance = nil
return function ()
if instance and instance.wibox.visible then
instance:hide()
instance = nil
else
instance = awful.menu.clients({ theme = { width = 250 } })
end
end
end
-- }}}
-- {{{ Menu
-- Create a launcher widget and a main menu
myawesomemenu = {
{ "edit config", editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart },
{ "quit", function() awesome.quit() end}
}
mymenu = {
{ "xterm" , "xterm"},
{ "xclock", "xclock"}
}
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "MyStuff", mymenu },
{ "open terminal", terminal }
}
})
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
menu = mymainmenu })
-- Menubar configuration
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
-- }}}
-- Keyboard map indicator and switcher
mykeyboardlayout = awful.widget.keyboardlayout()
-- Create a textclock widget
mytextclock = wibox.widget.textclock()
-- Create a wibox for each screen and add it
local taglist_buttons = awful.util.table.join(
awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end),
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
)
local tasklist_buttons = awful.util.table.join(
awful.button({ }, 1, function (c)
if c == client.focus then
c.minimized = true
else
-- Without this, the following
-- :isvisible() makes no sense
c.minimized = false
if not c:isvisible() and c.first_tag then
c.first_tag:view_only()
end
-- This will also un-minimize
-- the client, if needed
client.focus = c
c:raise()
end
end),
awful.button({ }, 3, client_menu_toggle_fn()),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
end))
local function set_wallpaper(s)
-- Wallpaper
if beautiful.wallpaper then
local wallpaper = beautiful.wallpaper
local wallpaperpc = beautiful.wallpaperpc
-- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then
wallpaper = wallpaper(s)
end
-- wallpaper only in PC
if s.geometry.width > 320 then
gears.wallpaper.centered(wallpaperpc, s, 1)
end
end
end
local function get_screen(s)
return s and screen[s]
end
function awful.widget.tasklist.filter.currenttags_without_gs(c, screen)
screen = get_screen(screen)
-- Only print client on the same screen as this widget
if get_screen(c.screen) ~= screen then return false end
-- Include sticky client too
if c.sticky then return true end
local tags = screen.tags
for _, t in ipairs(tags) do
if t.selected then
local ctags = c:tags()
for _, v in ipairs(ctags) do
if v == t then
if c.class:lower() == "run.py" or c.class:lower() == "gsnotify-arm" or c.class:lower() == "main" then
return false
else
return true
end
end
end
end
end
return false
end
screen.connect_signal("property::geometry", set_wallpaper)
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
set_wallpaper(s)
-- Each screen has its own tag table.
awful.tag({ "GameShell" }, s, awful.layout.layouts[1])
-- Create a promptbox for each screen
s.mypromptbox = awful.widget.prompt()
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(awful.util.table.join(
awful.button({ }, 1, function () awful.layout.inc( 1) end),
awful.button({ }, 3, function () awful.layout.inc(-1) end),
awful.button({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(-1) end)))
-- Create a taglist widget
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons)
-- Create a tasklist widget
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags_without_gs, tasklist_buttons)
-- Create the wibox
if s.geometry.width > 320 then
s.mywibox = awful.wibar({ position = "bottom", screen = s,visible=true })
else
s.mywibox = awful.wibar({ position = "bottom", screen = s,visible=false })
end
-- Add widgets to the wibox
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
mylauncher,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
mykeyboardlayout,
wibox.widget.systray(),
mytextclock,
s.mylayoutbox,
},
}
end)
-- }}}
-- {{{ Mouse bindings
root.buttons(awful.util.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
))
-- }}}
-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it works on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
clientbuttons = awful.util.table.join(
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
awful.button({ modkey }, 1, awful.mouse.client.move),
awful.button({ modkey }, 3, awful.mouse.client.resize))
function titlebar_add_with_settings(c)
awful.titlebar.add(c, { modkey = modkey, height = 16, font = "Terminus 6"})
end
-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = {
size_hints_honor = false,
border_width = 0,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
--placement = awful.placement.no_overlap+awful.placement.centered+awful.placement.no_offscreen
}
},
{ rule_any = {type = { "normal", "dialog"}
}, properties = { titlebars_enabled = true }
},
-- Floating clients.
{ rule_any = {
instance = {
"DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class.
},
class = {
"Arandr",
"Gpick",
"Kruler",
"MessageWin", -- kalarm.
"Sxiv",
"Wpa_gui",
"pinentry",
"veromix",
"xtightvncviewer",
"xclock"
},
name = {
"Event Tester", -- xev.
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
}
}, properties = { ontop=false,floating = true,titlebars_enabled=false }},
}
-- }}}
local gs_class = {"run.py","gsnotify","gsnotify-arm","retroarch","GSPLauncher","main"}
-- {{{ Signals
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c)
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup and
not c.size_hints.user_position
and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end
c.ontop=false
c.above=false
c.below=true
c.fullscreen=false
if tableHasKey(c,"class") and c.class:lower() == "gsnotify-arm" then
-- naughty.notify({text = "launched!",timeout = 2,position = "top_center"})
c.ontop = true
c.above = true
c.focusable=false
c.type = "notification"
c.floating = true
c:raise()
end
for s in capi.screen do
if s.geometry.width > 320 then
for _,v in pairs(gs_class) do
if tableHasKey(c,"class") and c.class:lower() == v then
awful.titlebar.hide(c)
if v ~= "gsnotify-arm" then
awful.placement.centered(c)
end
break
end
end
-- centered bg with offset of tasklist_bar's height
-- c.y= c.y + s.mywibox.height
else
-- hide all titlebars in GS
awful.titlebar.hide(c)
end
end
end)
-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c)
-- buttons for the titlebar
local buttons = awful.util.table.join(
awful.button({ }, 1, function()
client.focus = c
c:raise()
awful.mouse.client.move(c)
end),
awful.button({ }, 3, function()
client.focus = c
c:raise()
awful.mouse.client.resize(c)
end)
)
awful.titlebar(c) : setup {
{ -- Left
awful.titlebar.widget.closebutton(c),
-- buttons = buttons,
layout = wibox.layout.fixed.horizontal
},
{ -- Middle
{ -- Title
align = "left",
widget = awful.titlebar.widget.titlewidget(c)
},
buttons = buttons,
layout = wibox.layout.flex.horizontal
},
{ -- Right
align="right",
awful.titlebar.widget.floatingbutton (c),
awful.titlebar.widget.maximizedbutton(c),
-- awful.titlebar.widget.stickybutton (c),
-- awful.titlebar.widget.ontopbutton (c),
-- awful.titlebar.widget.closebutton (c),
layout = wibox.layout.fixed.horizontal()
},
layout = wibox.layout.align.horizontal
}
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("focus",
function(c)
c.border_color = beautiful.border_normal
end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- }}}
client.disconnect_signal("request::activate", awful.ewmh.activate)
function awful.ewmh.activate(c)
if tableHasKey(c,"class") == false then
return
end
if c:isvisible() then
if c.class:lower() ~= "gsnotify-arm" then
client.focus = c
end
if c.class:lower() == "retroarch" then
c:lower()
end
end
end
client.connect_signal("request::activate", awful.ewmh.activate)
client.connect_signal("property::fullscreen", function (c)
c.fullscreen = false
c.ontop = false
c.focus=false
c:lower()
end)
+3
View File
@@ -0,0 +1,3 @@
Background images:
Mikael Eriksson <mikael_eriksson@miffe.org>
Licensed under CC-BY-SA-3.0
Binary file not shown.

After

Width:  |  Height:  |  Size: 403 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Some files were not shown because too many files have changed in this diff Show More