summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDan Everton <dan@iocaine.org>2006-08-15 09:38:13 +0000
committerDan Everton <dan@iocaine.org>2006-08-15 09:38:13 +0000
commiteb1dd38960214cb5581b9d39ef4fe73e2a050090 (patch)
tree225cdbae19e67685ba898f0559fa25a7177f91bd /apps
parent1792170633842d274d623dcdd7265f2e55ff2fc9 (diff)
downloadrockbox-eb1dd38960214cb5581b9d39ef4fe73e2a050090.tar.gz
rockbox-eb1dd38960214cb5581b9d39ef4fe73e2a050090.tar.bz2
rockbox-eb1dd38960214cb5581b9d39ef4fe73e2a050090.zip
Add support for displaying the the current path or the full path (or neither) in the file browser. Check General Settings -> File View -> Show Path for the options.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10578 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/english.lang42
-rw-r--r--apps/settings.c2
-rw-r--r--apps/settings.h5
-rw-r--r--apps/settings_menu.c14
-rw-r--r--apps/tree.c5
5 files changed, 68 insertions, 0 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index b11b996570..984aa1be95 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -9618,3 +9618,45 @@
*: "Wide"
</voice>
</phrase>
+<phrase>
+ id: LANG_SHOW_PATH
+ desc: in settings_menu
+ user:
+ <source>
+ *: "Show Path"
+ </source>
+ <dest>
+ *: "Show Path"
+ </dest>
+ <voice>
+ *: "Show Path"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_SHOW_PATH_CURRENT
+ desc: in show path menu
+ user:
+ <source>
+ *: "Current Directory Only"
+ </source>
+ <dest>
+ *: "Current Directory Only"
+ </dest>
+ <voice>
+ *: "Current Directory Only"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_SHOW_PATH_FULL
+ desc: in show path menu
+ user:
+ <source>
+ *: "Full Path"
+ </source>
+ <dest>
+ *: "Full Path"
+ </dest>
+ <voice>
+ *: "Full Path"
+ </voice>
+</phrase>
diff --git a/apps/settings.c b/apps/settings.c
index 1f8f15be1e..412fc4bfed 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -613,6 +613,8 @@ static const struct bit_entry hd_bits[] =
{5|SIGNED, S_O(eq_hw_band4_gain), 12, "eq hardware band 4 gain", NULL },
#endif
+ {2, S_O(show_path_in_browser), 0, "show path in browser", "off,current directory,full path" },
+
/* If values are just added to the end, no need to bump the version. */
/* new stuff to be added at the end */
diff --git a/apps/settings.h b/apps/settings.h
index 2d2c125721..439a43809a 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -564,6 +564,8 @@ struct user_settings
int eq_hw_band4_cutoff;
int eq_hw_band4_gain;
#endif
+
+ int show_path_in_browser; /* 0=off, 1=current directory, 2=full path */
};
enum optiontype { INT, BOOL };
@@ -660,4 +662,7 @@ enum { RECURSE_OFF, RECURSE_ON, RECURSE_ASK };
/* replaygain types */
enum { REPLAYGAIN_TRACK = 0, REPLAYGAIN_ALBUM, REPLAYGAIN_SHUFFLE };
+/* show path types */
+enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL };
+
#endif /* __SETTINGS_H__ */
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 6a11e723b1..48e8c1dda5 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -98,6 +98,19 @@ static bool show_icons(void)
return set_bool( (char *)str(LANG_SHOW_ICONS), &global_settings.show_icons );
}
+static bool show_path(void)
+{
+ static const struct opt_items names[3] = {
+ { STR(LANG_OFF) },
+ { STR(LANG_SHOW_PATH_CURRENT) },
+ { STR(LANG_SHOW_PATH_FULL) },
+ };
+
+ return set_option(str(LANG_SHOW_PATH),
+ &global_settings.show_path_in_browser,
+ INT, names, 3, NULL);
+}
+
/**
* Menu to set the option to scroll paginated
*/
@@ -1737,6 +1750,7 @@ static bool fileview_settings_menu(void)
{ ID2P(LANG_FILTER), dir_filter },
{ ID2P(LANG_FOLLOW), browse_current },
{ ID2P(LANG_SHOW_ICONS), show_icons },
+ { ID2P(LANG_SHOW_PATH), show_path },
{ ID2P(LANG_TAGCACHE), tagcache_settings_menu},
};
diff --git a/apps/tree.c b/apps/tree.c
index 484ed672cd..72e62caf2b 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -347,6 +347,11 @@ static int update_dir(void)
gui_syncsplash(HZ, true, str(LANG_SHOWDIR_BUFFER_FULL));
}
}
+ if (global_settings.show_path_in_browser == SHOW_PATH_FULL) {
+ gui_synclist_set_title(&tree_lists, tc.currdir);
+ } else if (global_settings.show_path_in_browser == SHOW_PATH_CURRENT) {
+ gui_synclist_set_title(&tree_lists, strrchr(tc.currdir, '/'));
+ }
gui_synclist_set_nb_items(&tree_lists, tc.filesindir);
gui_synclist_set_icon_callback(&tree_lists,
global_settings.show_icons?&tree_get_fileicon:NULL);