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
This commit is contained in:
Christi Scarborough 2005-11-18 15:33:05 +00:00
parent e16ebf1a50
commit 32a43e2ee6
9 changed files with 45 additions and 24 deletions

View file

@ -731,11 +731,22 @@ bool wps_data_load(struct wps_data *wps_data,
* wants to be a virtual file. Feel free to modify dirbrowse() * wants to be a virtual file. Feel free to modify dirbrowse()
* if you're feeling brave. * if you're feeling brave.
*/ */
if (! strcmp(buf, WPS_DEFAULTCFG) || !strcmp(buf, RWPS_DEFAULTCFG) ) if (! strcmp(buf, WPS_DEFAULTCFG) )
{ {
wps_reset(wps_data); wps_reset(wps_data);
global_settings.wps_file[0] = 0;
return false; 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; size_t bmpdirlen;
char *bmpdir = strrchr(buf, '.'); char *bmpdir = strrchr(buf, '.');
bmpdirlen = bmpdir - buf; bmpdirlen = bmpdir - buf;

View file

@ -3451,6 +3451,6 @@ new:
id: LANG_CUSTOM_THEME id: LANG_CUSTOM_THEME
desc: Custom themes menu desc: Custom themes menu
eng: "Browse themes" eng: "Browse Themes"
voice: "Browse themes" voice: "Browse Themes"
new: new:

View file

@ -241,6 +241,11 @@ static bool plugin_browse(void)
return rockbox_browse(PLUGIN_DIR, SHOW_PLUGINS); return rockbox_browse(PLUGIN_DIR, SHOW_PLUGINS);
} }
static bool custom_theme_browse(void)
{
return rockbox_browse(THEME_DIR, SHOW_CFG);
}
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
static bool recording_settings(void) static bool recording_settings(void)
@ -311,7 +316,7 @@ bool main_menu(void)
int i = 0; int i = 0;
/* main menu */ /* main menu */
struct menu_item items[10]; struct menu_item items[11];
items[i].desc = ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS); items[i].desc = ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS);
items[i++].function = bookmark_mrb_load; items[i++].function = bookmark_mrb_load;
@ -325,6 +330,9 @@ bool main_menu(void)
items[i].desc = ID2P(LANG_MANAGE_MENU); items[i].desc = ID2P(LANG_MANAGE_MENU);
items[i++].function = manage_settings_menu; items[i++].function = manage_settings_menu;
items[i].desc = ID2P(LANG_CUSTOM_THEME);
items[i++].function = custom_theme_browse;
#ifdef CONFIG_TUNER #ifdef CONFIG_TUNER
if(radio_hardware_present()) { if(radio_hardware_present()) {
items[i].desc = ID2P(LANG_FM_RADIO); items[i].desc = ID2P(LANG_FM_RADIO);

View file

@ -32,7 +32,7 @@
#define FONT_DIR "/fonts" #define FONT_DIR "/fonts"
#define LANG_DIR "/langs" #define LANG_DIR "/langs"
#define WPS_DIR ROCKBOX_DIR "/wps" #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 PLUGIN_DIR ROCKBOX_DIR"/rocks"
#define REC_BASE_DIR "/recordings" #define REC_BASE_DIR "/recordings"

View file

@ -1004,11 +1004,6 @@ static bool custom_remote_wps_browse(void)
} }
#endif #endif
static bool custom_theme_browse(void)
{
return rockbox_browse(THEME_DIR, SHOW_CFG);
}
static bool custom_cfg_browse(void) static bool custom_cfg_browse(void)
{ {
return rockbox_browse(ROCKBOX_DIR, SHOW_CFG); return rockbox_browse(ROCKBOX_DIR, SHOW_CFG);
@ -1589,7 +1584,6 @@ static bool display_settings_menu(void)
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
{ ID2P(LANG_CUSTOM_FONT), font_browse }, { ID2P(LANG_CUSTOM_FONT), font_browse },
#endif #endif
{ ID2P(LANG_CUSTOM_THEME), custom_theme_browse },
{ ID2P(LANG_WHILE_PLAYING), custom_wps_browse }, { ID2P(LANG_WHILE_PLAYING), custom_wps_browse },
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
{ ID2P(LANG_REMOTE_WHILE_PLAYING), custom_remote_wps_browse }, { ID2P(LANG_REMOTE_WHILE_PLAYING), custom_remote_wps_browse },

View file

@ -63,7 +63,7 @@ sub buildzip {
mkdir ".rockbox/rocks", 0777; mkdir ".rockbox/rocks", 0777;
mkdir ".rockbox/codecs", 0777; mkdir ".rockbox/codecs", 0777;
mkdir ".rockbox/wps", 0777; mkdir ".rockbox/wps", 0777;
mkdir ".rockbox/theme", 0777; mkdir ".rockbox/themes", 0777;
my $c = 'find apps -name "*.codec" ! -empty -exec cp {} .rockbox/codecs/ \;'; my $c = 'find apps -name "*.codec" ! -empty -exec cp {} .rockbox/codecs/ \;';
print `$c`; print `$c`;

View file

@ -58,7 +58,7 @@ Width: 160
<wps> <wps>
Name: engineeer2.wps Name: engineeer2.wps
Author: Magnus Westerlund Author: Magnus Westerlund
Font: Nedore-8.fnt Font: nedore-8.fnt
Statusbar: Off Statusbar: Off
Height: 128 Height: 128
Width: 160 Width: 160
@ -68,7 +68,7 @@ Width: 160
Name: iAmp.wps Name: iAmp.wps
RWPS: iAmp.rwps RWPS: iAmp.rwps
Author: Raymond Hoh Author: Raymond Hoh
Font: Nimbus-12.fnt Font: nimbus-12.fnt
Statusbar: Off Statusbar: Off
Height: 128 Height: 128
Width: 160 Width: 160
@ -95,7 +95,7 @@ Width: 128
<rwps> <rwps>
Name: iAmp.rwps Name: iAmp.rwps
Author: Raymond Hoh Author: Raymond Hoh
Font: Nimbus-12.fnt Font: nimbus-12.fnt
Statusbar: Off Statusbar: Off
Height: 64 Height: 64
Width: 128 Width: 128

View file

@ -2,7 +2,7 @@
%s%?ia<%ia|%d1> %s%?ia<%ia|%d1>
%s%?it<%?in<%in. >%it|%fn> %s%?it<%?in<%in. >%it|%fn>
%pb %pb
%xl|H|i/a5.bmp|102|48| %xl|H|a5.bmp|102|48|
%xl|o|m1.bmp|102|48| %xl|o|m1.bmp|102|48|
%xl|p|m2.bmp|102|48| %xl|p|m2.bmp|102|48|
%xl|q|m3.bmp|102|48| %xl|q|m3.bmp|102|48|

View file

@ -90,7 +90,7 @@ sub mkdirs {
my $wpsdir = $wps; my $wpsdir = $wps;
$wpsdir =~ s/\.(r|)wps//; $wpsdir =~ s/\.(r|)wps//;
mkdir ".rockbox/wps", 0777; mkdir ".rockbox/wps", 0777;
mkdir ".rockbox/theme", 0777; mkdir ".rockbox/themes", 0777;
if( -d ".rockbox/wps/$wpsdir") { if( -d ".rockbox/wps/$wpsdir") {
#print STDERR "wpsbuild warning: directory wps/$wpsdir already exists!\n"; #print STDERR "wpsbuild warning: directory wps/$wpsdir already exists!\n";
@ -140,7 +140,7 @@ MOO
if($statusbar) { if($statusbar) {
push @out, "statusbar: $statusbar\n"; push @out, "statusbar: $statusbar\n";
} }
if($rwps && !$isrwps) { if($rwps && $has_remote ) {
push @out, "rwps: /.rockbox/wps/$rwps\n"; push @out, "rwps: /.rockbox/wps/$rwps\n";
} }
@ -148,7 +148,7 @@ MOO
print STDERR "wpsbuild warning: wps/$cfg already exists!\n"; print STDERR "wpsbuild warning: wps/$cfg already exists!\n";
} }
else { else {
open(CFG, ">.rockbox/theme/$cfg"); open(CFG, ">.rockbox/themes/$cfg");
print CFG @out; print CFG @out;
close(CFG); close(CFG);
} }
@ -158,6 +158,8 @@ MOO
my ($main_height, $main_width) = getlcdsizes(); my ($main_height, $main_width) = getlcdsizes();
my ($remote_height, $remote_width) = getlcdsizes(1); my ($remote_height, $remote_width) = getlcdsizes(1);
$has_remote = true if ($remote_height && $remote_width);
open(WPS, "<$wpslist"); open(WPS, "<$wpslist");
while(<WPS>) { while(<WPS>) {
my $l = $_; my $l = $_;
@ -168,6 +170,14 @@ while(<WPS>) {
if($l =~ /^ *<(r|)wps>/i) { if($l =~ /^ *<(r|)wps>/i) {
$isrwps = $1; $isrwps = $1;
$within = 1; $within = 1;
# undef is a unary operator (!)
undef $wps;
undef $rwps;
undef $width;
undef $height;
undef $font;
undef $statusbar;
undef $author;
next; next;
} }
if($within) { if($within) {
@ -184,6 +194,7 @@ while(<WPS>) {
if(!$rheight || !$rwidth) { if(!$rheight || !$rwidth) {
printf STDERR "wpsbuild notice: No %sLCD size, skipping $wps\n", printf STDERR "wpsbuild notice: No %sLCD size, skipping $wps\n",
$isrwps?"remote ":""; $isrwps?"remote ":"";
$within = 0;
next; next;
} }
@ -196,7 +207,6 @@ while(<WPS>) {
# WPS # WPS
# #
#print "Size requirement is fine!\n"; #print "Size requirement is fine!\n";
mkdirs(); mkdirs();
if(!$isrwps) { if(!$isrwps) {
# We only make .cfg files for <wps> sections: # We only make .cfg files for <wps> sections:
@ -208,8 +218,6 @@ while(<WPS>) {
#print "Skip $wps due to size restraints\n"; #print "Skip $wps due to size restraints\n";
} }
$within = 0; $within = 0;
undef $wps, $rwps, $width, $height, $font, $statusbar, $author;
} }
elsif($l =~ /^Name: (.*)/i) { elsif($l =~ /^Name: (.*)/i) {
# Note that in the case this is within <rwps>, $wps will contain the # Note that in the case this is within <rwps>, $wps will contain the