summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-04-16 11:01:41 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-04-16 11:01:41 +0000
commitccaf24a29cbcad04ce2673523e552e4ee7021d57 (patch)
treec8dd790cc20e4605ef7d442486e5b123bc6053e1 /apps
parentbfa55778699cdf5c479e614ed4748bb7cbcc7284 (diff)
downloadrockbox-ccaf24a29cbcad04ce2673523e552e4ee7021d57.zip
rockbox-ccaf24a29cbcad04ce2673523e552e4ee7021d57.tar.gz
rockbox-ccaf24a29cbcad04ce2673523e552e4ee7021d57.tar.bz2
rockbox-ccaf24a29cbcad04ce2673523e552e4ee7021d57.tar.xz
Fix the wavplay icon
Fix copy+paste mistake Fix typo in comment Fix crash when trying to run a bmp Reset the icons properly when loading a .icons file (hopefully will use the correct icon now) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13179 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/filetypes.c23
-rw-r--r--apps/gui/icon.c8
-rw-r--r--apps/plugins/viewers.config2
3 files changed, 28 insertions, 5 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index f91df19..cb05a60 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -75,12 +75,33 @@ static char *filetypes_strdup(char* string)
static void read_builtin_types(void);
static void read_config(char* config_file);
#ifdef HAVE_LCD_BITMAP
+
+static void reset_icons(void)
+{
+ int i, j, count;
+ const struct filetype *types;
+ tree_get_filetypes(&types, &count);
+ for (i=1; i<filetype_count; i++) /* 0 is folders */
+ {
+ filetypes[i].icon = Icon_Questionmark;
+ for (j=0; j<count; j++)
+ {
+ if (filetypes[i].extension &&
+ !strcmp(filetypes[i].extension, types[j].extension))
+ {
+ filetypes[i].icon = types[j].icon;
+ break;
+ }
+ }
+ }
+}
void read_viewer_theme_file(void)
{
char buffer[MAX_PATH];
int fd;
char *ext, *icon;
int i;
+ reset_icons();
snprintf(buffer, MAX_PATH, "%s/%s.icons", ICON_DIR,
global_settings.viewers_icon_file);
fd = open(buffer, O_RDONLY);
@@ -265,6 +286,8 @@ char* filetype_get_plugin(const struct entry* file)
int index = find_attr(file->attr);
if (index < 0)
return NULL;
+ if (filetypes[index].viewer == NULL)
+ return NULL;
snprintf(plugin_name, MAX_PATH, "%s/%s.%s",
filetypes[index].viewer? VIEWERS_DIR: PLUGIN_DIR,
filetypes[index].plugin, ROCK_EXTENSION);
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index 2cb0035..b283ec2 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -42,7 +42,7 @@
#define DEFAULT_VIEWER_BMP ICON_DIR "/viewers.bmp"
#define DEFAULT_REMOTE_VIEWER_BMP ICON_DIR "/remote_viewers.bmp"
-/* These should robably be moved to config-<target>.h */
+/* These should probably be moved to config-<target>.h */
#define MAX_ICON_HEIGHT 24
#define MAX_ICON_WIDTH 24
@@ -213,9 +213,9 @@ static void load_icons(const char* filename, enum Iconset iconset)
break;
#ifdef HAVE_REMOTE_LCD
case Iconset_Remotescreen:
- loaded_ok = &custom_icons_loaded[SCREEN_MAIN];
- bmp = &user_iconset[SCREEN_MAIN];
- bmp->data = icon_buffer[SCREEN_MAIN];
+ loaded_ok = &custom_icons_loaded[SCREEN_REMOTE];
+ bmp = &user_iconset[SCREEN_REMOTE];
+ bmp->data = icon_buffer[SCREEN_REMOTE];
break;
case Iconset_Remotescreen_viewers:
loaded_ok = &viewer_icons_loaded[SCREEN_REMOTE];
diff --git a/apps/plugins/viewers.config b/apps/plugins/viewers.config
index d53fb23..4abdfb1 100644
--- a/apps/plugins/viewers.config
+++ b/apps/plugins/viewers.config
@@ -19,7 +19,7 @@ rsp,viewers/searchengine,8
ss,rocks/sudoku,1
wav,viewers/wav2wv,-
wav,viewers/mp3_encoder,-
-wav,viewers/wavplay,*0
+wav,viewers/wavplay,10
wav,viewers/wavview,10
bmp,rocks/rockpaint,11
mpg,viewers/mpegplayer,4