summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/gwps.c15
-rw-r--r--apps/lang/english.lang4
-rw-r--r--apps/main_menu.c10
-rw-r--r--apps/settings.h2
-rw-r--r--apps/settings_menu.c6
-rwxr-xr-xtools/buildzip.pl2
-rw-r--r--wps/WPSLIST6
-rw-r--r--wps/iAmp.rwps4
-rwxr-xr-xwps/wpsbuild.pl20
9 files changed, 45 insertions, 24 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index 2fff66e337..5877cf7c4b 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -731,11 +731,22 @@ bool wps_data_load(struct wps_data *wps_data,
731 * wants to be a virtual file. Feel free to modify dirbrowse() 731 * wants to be a virtual file. Feel free to modify dirbrowse()
732 * if you're feeling brave. 732 * if you're feeling brave.
733 */ 733 */
734 if (! strcmp(buf, WPS_DEFAULTCFG) || !strcmp(buf, RWPS_DEFAULTCFG) ) 734 if (! strcmp(buf, WPS_DEFAULTCFG) )
735 { 735 {
736 wps_reset(wps_data); 736 wps_reset(wps_data);
737 global_settings.wps_file[0] = 0;
737 return false; 738 return false;
738 } 739 }
740
741#ifdef HAVE_REMOTE_LCD
742 if (! strcmp(buf, RWPS_DEFAULTCFG) )
743 {
744 wps_reset(wps_data);
745 global_settings.rwps_file[0] = 0;
746 return false;
747 }
748#endif
749
739 size_t bmpdirlen; 750 size_t bmpdirlen;
740 char *bmpdir = strrchr(buf, '.'); 751 char *bmpdir = strrchr(buf, '.');
741 bmpdirlen = bmpdir - buf; 752 bmpdirlen = bmpdir - buf;
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 9ec8416ad9..f11ac9efcb 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -3451,6 +3451,6 @@ new:
3451 3451
3452id: LANG_CUSTOM_THEME 3452id: LANG_CUSTOM_THEME
3453desc: Custom themes menu 3453desc: Custom themes menu
3454eng: "Browse themes" 3454eng: "Browse Themes"
3455voice: "Browse themes" 3455voice: "Browse Themes"
3456new: 3456new:
diff --git a/apps/main_menu.c b/apps/main_menu.c
index f76c211f0a..262dd61a20 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -241,6 +241,11 @@ static bool plugin_browse(void)
241 return rockbox_browse(PLUGIN_DIR, SHOW_PLUGINS); 241 return rockbox_browse(PLUGIN_DIR, SHOW_PLUGINS);
242} 242}
243 243
244static bool custom_theme_browse(void)
245{
246 return rockbox_browse(THEME_DIR, SHOW_CFG);
247}
248
244#ifdef HAVE_RECORDING 249#ifdef HAVE_RECORDING
245 250
246static bool recording_settings(void) 251static bool recording_settings(void)
@@ -311,7 +316,7 @@ bool main_menu(void)
311 int i = 0; 316 int i = 0;
312 317
313 /* main menu */ 318 /* main menu */
314 struct menu_item items[10]; 319 struct menu_item items[11];
315 320
316 items[i].desc = ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS); 321 items[i].desc = ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS);
317 items[i++].function = bookmark_mrb_load; 322 items[i++].function = bookmark_mrb_load;
@@ -325,6 +330,9 @@ bool main_menu(void)
325 items[i].desc = ID2P(LANG_MANAGE_MENU); 330 items[i].desc = ID2P(LANG_MANAGE_MENU);
326 items[i++].function = manage_settings_menu; 331 items[i++].function = manage_settings_menu;
327 332
333 items[i].desc = ID2P(LANG_CUSTOM_THEME);
334 items[i++].function = custom_theme_browse;
335
328#ifdef CONFIG_TUNER 336#ifdef CONFIG_TUNER
329 if(radio_hardware_present()) { 337 if(radio_hardware_present()) {
330 items[i].desc = ID2P(LANG_FM_RADIO); 338 items[i].desc = ID2P(LANG_FM_RADIO);
diff --git a/apps/settings.h b/apps/settings.h
index caaead6a10..04f6da667e 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -32,7 +32,7 @@
32#define FONT_DIR "/fonts" 32#define FONT_DIR "/fonts"
33#define LANG_DIR "/langs" 33#define LANG_DIR "/langs"
34#define WPS_DIR ROCKBOX_DIR "/wps" 34#define WPS_DIR ROCKBOX_DIR "/wps"
35#define THEME_DIR ROCKBOX_DIR "/theme" 35#define THEME_DIR ROCKBOX_DIR "/themes"
36#define PLUGIN_DIR ROCKBOX_DIR"/rocks" 36#define PLUGIN_DIR ROCKBOX_DIR"/rocks"
37#define REC_BASE_DIR "/recordings" 37#define REC_BASE_DIR "/recordings"
38 38
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 41beb4d016..27e24347a3 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -1003,11 +1003,6 @@ static bool custom_remote_wps_browse(void)
1003 return rockbox_browse(WPS_DIR, SHOW_RWPS); 1003 return rockbox_browse(WPS_DIR, SHOW_RWPS);
1004} 1004}
1005#endif 1005#endif
1006
1007static bool custom_theme_browse(void)
1008{
1009 return rockbox_browse(THEME_DIR, SHOW_CFG);
1010}
1011 1006
1012static bool custom_cfg_browse(void) 1007static bool custom_cfg_browse(void)
1013{ 1008{
@@ -1589,7 +1584,6 @@ static bool display_settings_menu(void)
1589#ifdef HAVE_LCD_BITMAP 1584#ifdef HAVE_LCD_BITMAP
1590 { ID2P(LANG_CUSTOM_FONT), font_browse }, 1585 { ID2P(LANG_CUSTOM_FONT), font_browse },
1591#endif 1586#endif
1592 { ID2P(LANG_CUSTOM_THEME), custom_theme_browse },
1593 { ID2P(LANG_WHILE_PLAYING), custom_wps_browse }, 1587 { ID2P(LANG_WHILE_PLAYING), custom_wps_browse },
1594#ifdef HAVE_REMOTE_LCD 1588#ifdef HAVE_REMOTE_LCD
1595 { ID2P(LANG_REMOTE_WHILE_PLAYING), custom_remote_wps_browse }, 1589 { ID2P(LANG_REMOTE_WHILE_PLAYING), custom_remote_wps_browse },
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index a15344561b..1ec2bea9ef 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -63,7 +63,7 @@ sub buildzip {
63 mkdir ".rockbox/rocks", 0777; 63 mkdir ".rockbox/rocks", 0777;
64 mkdir ".rockbox/codecs", 0777; 64 mkdir ".rockbox/codecs", 0777;
65 mkdir ".rockbox/wps", 0777; 65 mkdir ".rockbox/wps", 0777;
66 mkdir ".rockbox/theme", 0777; 66 mkdir ".rockbox/themes", 0777;
67 67
68 my $c = 'find apps -name "*.codec" ! -empty -exec cp {} .rockbox/codecs/ \;'; 68 my $c = 'find apps -name "*.codec" ! -empty -exec cp {} .rockbox/codecs/ \;';
69 print `$c`; 69 print `$c`;
diff --git a/wps/WPSLIST b/wps/WPSLIST
index e4375cdd96..4862da01ba 100644
--- a/wps/WPSLIST
+++ b/wps/WPSLIST
@@ -58,7 +58,7 @@ Width: 160
58<wps> 58<wps>
59Name: engineeer2.wps 59Name: engineeer2.wps
60Author: Magnus Westerlund 60Author: Magnus Westerlund
61Font: Nedore-8.fnt 61Font: nedore-8.fnt
62Statusbar: Off 62Statusbar: Off
63Height: 128 63Height: 128
64Width: 160 64Width: 160
@@ -68,7 +68,7 @@ Width: 160
68Name: iAmp.wps 68Name: iAmp.wps
69RWPS: iAmp.rwps 69RWPS: iAmp.rwps
70Author: Raymond Hoh 70Author: Raymond Hoh
71Font: Nimbus-12.fnt 71Font: nimbus-12.fnt
72Statusbar: Off 72Statusbar: Off
73Height: 128 73Height: 128
74Width: 160 74Width: 160
@@ -95,7 +95,7 @@ Width: 128
95<rwps> 95<rwps>
96Name: iAmp.rwps 96Name: iAmp.rwps
97Author: Raymond Hoh 97Author: Raymond Hoh
98Font: Nimbus-12.fnt 98Font: nimbus-12.fnt
99Statusbar: Off 99Statusbar: Off
100Height: 64 100Height: 64
101Width: 128 101Width: 128
diff --git a/wps/iAmp.rwps b/wps/iAmp.rwps
index ac944526f8..d0d6e0a0c9 100644
--- a/wps/iAmp.rwps
+++ b/wps/iAmp.rwps
@@ -2,7 +2,7 @@
2%s%?ia<%ia|%d1> 2%s%?ia<%ia|%d1>
3%s%?it<%?in<%in. >%it|%fn> 3%s%?it<%?in<%in. >%it|%fn>
4%pb 4%pb
5%xl|H|i/a5.bmp|102|48| 5%xl|H|a5.bmp|102|48|
6%xl|o|m1.bmp|102|48| 6%xl|o|m1.bmp|102|48|
7%xl|p|m2.bmp|102|48| 7%xl|p|m2.bmp|102|48|
8%xl|q|m3.bmp|102|48| 8%xl|q|m3.bmp|102|48|
@@ -47,4 +47,4 @@
47%xl|C|z.bmp|74|48| 47%xl|C|z.bmp|74|48|
48%?mp<||%xdA|%xdB|%xdC> 48%?mp<||%xdA|%xdB|%xdC>
49%x|v|pb.bmp|96|40| 49%x|v|pb.bmp|96|40|
50# letters to use: b, M-Z \ No newline at end of file 50# letters to use: b, M-Z
diff --git a/wps/wpsbuild.pl b/wps/wpsbuild.pl
index fc7be294a3..d6cff68d3a 100755
--- a/wps/wpsbuild.pl
+++ b/wps/wpsbuild.pl
@@ -90,7 +90,7 @@ sub mkdirs {
90 my $wpsdir = $wps; 90 my $wpsdir = $wps;
91 $wpsdir =~ s/\.(r|)wps//; 91 $wpsdir =~ s/\.(r|)wps//;
92 mkdir ".rockbox/wps", 0777; 92 mkdir ".rockbox/wps", 0777;
93 mkdir ".rockbox/theme", 0777; 93 mkdir ".rockbox/themes", 0777;
94 94
95 if( -d ".rockbox/wps/$wpsdir") { 95 if( -d ".rockbox/wps/$wpsdir") {
96 #print STDERR "wpsbuild warning: directory wps/$wpsdir already exists!\n"; 96 #print STDERR "wpsbuild warning: directory wps/$wpsdir already exists!\n";
@@ -140,7 +140,7 @@ MOO
140 if($statusbar) { 140 if($statusbar) {
141 push @out, "statusbar: $statusbar\n"; 141 push @out, "statusbar: $statusbar\n";
142 } 142 }
143 if($rwps && !$isrwps) { 143 if($rwps && $has_remote ) {
144 push @out, "rwps: /.rockbox/wps/$rwps\n"; 144 push @out, "rwps: /.rockbox/wps/$rwps\n";
145 } 145 }
146 146
@@ -148,7 +148,7 @@ MOO
148 print STDERR "wpsbuild warning: wps/$cfg already exists!\n"; 148 print STDERR "wpsbuild warning: wps/$cfg already exists!\n";
149 } 149 }
150 else { 150 else {
151 open(CFG, ">.rockbox/theme/$cfg"); 151 open(CFG, ">.rockbox/themes/$cfg");
152 print CFG @out; 152 print CFG @out;
153 close(CFG); 153 close(CFG);
154 } 154 }
@@ -158,6 +158,8 @@ MOO
158my ($main_height, $main_width) = getlcdsizes(); 158my ($main_height, $main_width) = getlcdsizes();
159my ($remote_height, $remote_width) = getlcdsizes(1); 159my ($remote_height, $remote_width) = getlcdsizes(1);
160 160
161$has_remote = true if ($remote_height && $remote_width);
162
161open(WPS, "<$wpslist"); 163open(WPS, "<$wpslist");
162while(<WPS>) { 164while(<WPS>) {
163 my $l = $_; 165 my $l = $_;
@@ -168,6 +170,14 @@ while(<WPS>) {
168 if($l =~ /^ *<(r|)wps>/i) { 170 if($l =~ /^ *<(r|)wps>/i) {
169 $isrwps = $1; 171 $isrwps = $1;
170 $within = 1; 172 $within = 1;
173 # undef is a unary operator (!)
174 undef $wps;
175 undef $rwps;
176 undef $width;
177 undef $height;
178 undef $font;
179 undef $statusbar;
180 undef $author;
171 next; 181 next;
172 } 182 }
173 if($within) { 183 if($within) {
@@ -184,6 +194,7 @@ while(<WPS>) {
184 if(!$rheight || !$rwidth) { 194 if(!$rheight || !$rwidth) {
185 printf STDERR "wpsbuild notice: No %sLCD size, skipping $wps\n", 195 printf STDERR "wpsbuild notice: No %sLCD size, skipping $wps\n",
186 $isrwps?"remote ":""; 196 $isrwps?"remote ":"";
197 $within = 0;
187 next; 198 next;
188 } 199 }
189 200
@@ -196,7 +207,6 @@ while(<WPS>) {
196 # WPS 207 # WPS
197 # 208 #
198 #print "Size requirement is fine!\n"; 209 #print "Size requirement is fine!\n";
199
200 mkdirs(); 210 mkdirs();
201 if(!$isrwps) { 211 if(!$isrwps) {
202 # We only make .cfg files for <wps> sections: 212 # We only make .cfg files for <wps> sections:
@@ -208,8 +218,6 @@ while(<WPS>) {
208 #print "Skip $wps due to size restraints\n"; 218 #print "Skip $wps due to size restraints\n";
209 } 219 }
210 $within = 0; 220 $within = 0;
211
212 undef $wps, $rwps, $width, $height, $font, $statusbar, $author;
213 } 221 }
214 elsif($l =~ /^Name: (.*)/i) { 222 elsif($l =~ /^Name: (.*)/i) {
215 # Note that in the case this is within <rwps>, $wps will contain the 223 # Note that in the case this is within <rwps>, $wps will contain the