From 32a43e2ee688bf8b3c930685400a52910c512a1e Mon Sep 17 00:00:00 2001 From: Christi Scarborough Date: Fri, 18 Nov 2005 15:33:05 +0000 Subject: When fixing things is it better to do it in a way that causes them to actually work. Some more bugs in wpsbuild.pl squashed. Also, themes moved to the main menu. Resetting to default themes now works properly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7965 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/gwps.c | 15 +++++++++++++-- apps/lang/english.lang | 4 ++-- apps/main_menu.c | 10 +++++++++- apps/settings.h | 2 +- apps/settings_menu.c | 6 ------ tools/buildzip.pl | 2 +- wps/WPSLIST | 6 +++--- wps/iAmp.rwps | 4 ++-- wps/wpsbuild.pl | 20 ++++++++++++++------ 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, * wants to be a virtual file. Feel free to modify dirbrowse() * if you're feeling brave. */ - if (! strcmp(buf, WPS_DEFAULTCFG) || !strcmp(buf, RWPS_DEFAULTCFG) ) + if (! strcmp(buf, WPS_DEFAULTCFG) ) { wps_reset(wps_data); + global_settings.wps_file[0] = 0; return false; - } + } + +#ifdef HAVE_REMOTE_LCD + if (! strcmp(buf, RWPS_DEFAULTCFG) ) + { + wps_reset(wps_data); + global_settings.rwps_file[0] = 0; + return false; + } +#endif + size_t bmpdirlen; char *bmpdir = strrchr(buf, '.'); 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: id: LANG_CUSTOM_THEME desc: Custom themes menu -eng: "Browse themes" -voice: "Browse themes" +eng: "Browse Themes" +voice: "Browse Themes" new: 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) return rockbox_browse(PLUGIN_DIR, SHOW_PLUGINS); } +static bool custom_theme_browse(void) +{ + return rockbox_browse(THEME_DIR, SHOW_CFG); +} + #ifdef HAVE_RECORDING static bool recording_settings(void) @@ -311,7 +316,7 @@ bool main_menu(void) int i = 0; /* main menu */ - struct menu_item items[10]; + struct menu_item items[11]; items[i].desc = ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS); items[i++].function = bookmark_mrb_load; @@ -325,6 +330,9 @@ bool main_menu(void) items[i].desc = ID2P(LANG_MANAGE_MENU); items[i++].function = manage_settings_menu; + items[i].desc = ID2P(LANG_CUSTOM_THEME); + items[i++].function = custom_theme_browse; + #ifdef CONFIG_TUNER if(radio_hardware_present()) { 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 @@ #define FONT_DIR "/fonts" #define LANG_DIR "/langs" #define WPS_DIR ROCKBOX_DIR "/wps" -#define THEME_DIR ROCKBOX_DIR "/theme" +#define THEME_DIR ROCKBOX_DIR "/themes" #define PLUGIN_DIR ROCKBOX_DIR"/rocks" #define REC_BASE_DIR "/recordings" 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) return rockbox_browse(WPS_DIR, SHOW_RWPS); } #endif - -static bool custom_theme_browse(void) -{ - return rockbox_browse(THEME_DIR, SHOW_CFG); -} static bool custom_cfg_browse(void) { @@ -1589,7 +1584,6 @@ static bool display_settings_menu(void) #ifdef HAVE_LCD_BITMAP { ID2P(LANG_CUSTOM_FONT), font_browse }, #endif - { ID2P(LANG_CUSTOM_THEME), custom_theme_browse }, { ID2P(LANG_WHILE_PLAYING), custom_wps_browse }, #ifdef HAVE_REMOTE_LCD { 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 { mkdir ".rockbox/rocks", 0777; mkdir ".rockbox/codecs", 0777; mkdir ".rockbox/wps", 0777; - mkdir ".rockbox/theme", 0777; + mkdir ".rockbox/themes", 0777; my $c = 'find apps -name "*.codec" ! -empty -exec cp {} .rockbox/codecs/ \;'; 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 Name: engineeer2.wps Author: Magnus Westerlund -Font: Nedore-8.fnt +Font: nedore-8.fnt Statusbar: Off Height: 128 Width: 160 @@ -68,7 +68,7 @@ Width: 160 Name: iAmp.wps RWPS: iAmp.rwps Author: Raymond Hoh -Font: Nimbus-12.fnt +Font: nimbus-12.fnt Statusbar: Off Height: 128 Width: 160 @@ -95,7 +95,7 @@ Width: 128 Name: iAmp.rwps Author: Raymond Hoh -Font: Nimbus-12.fnt +Font: nimbus-12.fnt Statusbar: Off Height: 64 Width: 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 @@ %s%?ia<%ia|%d1> %s%?it<%?in<%in. >%it|%fn> %pb -%xl|H|i/a5.bmp|102|48| +%xl|H|a5.bmp|102|48| %xl|o|m1.bmp|102|48| %xl|p|m2.bmp|102|48| %xl|q|m3.bmp|102|48| @@ -47,4 +47,4 @@ %xl|C|z.bmp|74|48| %?mp<||%xdA|%xdB|%xdC> %x|v|pb.bmp|96|40| -# letters to use: b, M-Z \ No newline at end of file +# 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 { my $wpsdir = $wps; $wpsdir =~ s/\.(r|)wps//; mkdir ".rockbox/wps", 0777; - mkdir ".rockbox/theme", 0777; + mkdir ".rockbox/themes", 0777; if( -d ".rockbox/wps/$wpsdir") { #print STDERR "wpsbuild warning: directory wps/$wpsdir already exists!\n"; @@ -140,7 +140,7 @@ MOO if($statusbar) { push @out, "statusbar: $statusbar\n"; } - if($rwps && !$isrwps) { + if($rwps && $has_remote ) { push @out, "rwps: /.rockbox/wps/$rwps\n"; } @@ -148,7 +148,7 @@ MOO print STDERR "wpsbuild warning: wps/$cfg already exists!\n"; } else { - open(CFG, ">.rockbox/theme/$cfg"); + open(CFG, ">.rockbox/themes/$cfg"); print CFG @out; close(CFG); } @@ -158,6 +158,8 @@ MOO my ($main_height, $main_width) = getlcdsizes(); my ($remote_height, $remote_width) = getlcdsizes(1); +$has_remote = true if ($remote_height && $remote_width); + open(WPS, "<$wpslist"); while() { my $l = $_; @@ -168,6 +170,14 @@ while() { if($l =~ /^ *<(r|)wps>/i) { $isrwps = $1; $within = 1; + # undef is a unary operator (!) + undef $wps; + undef $rwps; + undef $width; + undef $height; + undef $font; + undef $statusbar; + undef $author; next; } if($within) { @@ -184,6 +194,7 @@ while() { if(!$rheight || !$rwidth) { printf STDERR "wpsbuild notice: No %sLCD size, skipping $wps\n", $isrwps?"remote ":""; + $within = 0; next; } @@ -196,7 +207,6 @@ while() { # WPS # #print "Size requirement is fine!\n"; - mkdirs(); if(!$isrwps) { # We only make .cfg files for sections: @@ -208,8 +218,6 @@ while() { #print "Skip $wps due to size restraints\n"; } $within = 0; - - undef $wps, $rwps, $width, $height, $font, $statusbar, $author; } elsif($l =~ /^Name: (.*)/i) { # Note that in the case this is within , $wps will contain the -- cgit v1.2.3