forked from len0rd/rockbox
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:
parent
e16ebf1a50
commit
32a43e2ee6
9 changed files with 45 additions and 24 deletions
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -1004,11 +1004,6 @@ static bool custom_remote_wps_browse(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
static bool custom_theme_browse(void)
|
||||
{
|
||||
return rockbox_browse(THEME_DIR, SHOW_CFG);
|
||||
}
|
||||
|
||||
static bool custom_cfg_browse(void)
|
||||
{
|
||||
return rockbox_browse(ROCKBOX_DIR, SHOW_CFG);
|
||||
|
@ -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 },
|
||||
|
|
|
@ -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`;
|
||||
|
|
|
@ -58,7 +58,7 @@ Width: 160
|
|||
<wps>
|
||||
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
|
|||
<rwps>
|
||||
Name: iAmp.rwps
|
||||
Author: Raymond Hoh
|
||||
Font: Nimbus-12.fnt
|
||||
Font: nimbus-12.fnt
|
||||
Statusbar: Off
|
||||
Height: 64
|
||||
Width: 128
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -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(<WPS>) {
|
||||
my $l = $_;
|
||||
|
@ -168,6 +170,14 @@ while(<WPS>) {
|
|||
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(<WPS>) {
|
|||
if(!$rheight || !$rwidth) {
|
||||
printf STDERR "wpsbuild notice: No %sLCD size, skipping $wps\n",
|
||||
$isrwps?"remote ":"";
|
||||
$within = 0;
|
||||
next;
|
||||
}
|
||||
|
||||
|
@ -196,7 +207,6 @@ while(<WPS>) {
|
|||
# WPS
|
||||
#
|
||||
#print "Size requirement is fine!\n";
|
||||
|
||||
mkdirs();
|
||||
if(!$isrwps) {
|
||||
# We only make .cfg files for <wps> sections:
|
||||
|
@ -208,8 +218,6 @@ while(<WPS>) {
|
|||
#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 <rwps>, $wps will contain the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue