summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-12-21 13:32:43 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-12-21 13:32:43 +0000
commita2fc6415708d2e0bdc83898eda749515046fad90 (patch)
tree60aace79c43ea10e721dd6e8a715f50c4643dab5 /apps/plugins
parent847ac057af1a17a60ab1c9ef4fd5769ae5b22581 (diff)
downloadrockbox-a2fc6415708d2e0bdc83898eda749515046fad90.zip
rockbox-a2fc6415708d2e0bdc83898eda749515046fad90.tar.gz
rockbox-a2fc6415708d2e0bdc83898eda749515046fad90.tar.bz2
rockbox-a2fc6415708d2e0bdc83898eda749515046fad90.tar.xz
properties,shortcuts_view: enable the theme while showing list.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24092 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/properties.c32
-rw-r--r--apps/plugins/shortcuts/shortcuts_view.c24
2 files changed, 44 insertions, 12 deletions
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c
index 7cd29c1..9d9020f 100644
--- a/apps/plugins/properties.c
+++ b/apps/plugins/properties.c
@@ -172,7 +172,7 @@ static bool _dir_properties(DPS* dps)
entry->d_name);
if (entry->attribute & ATTR_DIRECTORY)
- {
+ {
if (!rb->strcmp((char *)entry->d_name, ".") ||
!rb->strcmp((char *)entry->d_name, ".."))
continue; /* skip these */
@@ -195,7 +195,7 @@ static bool _dir_properties(DPS* dps)
result = _dir_properties(dps);
}
else
- {
+ {
dps->fc++; /* new file */
dps->bc += entry->size;
}
@@ -272,8 +272,11 @@ static const char * get_props(int selected_item, void* data,
enum plugin_status plugin_start(const void* parameter)
{
struct gui_synclist properties_lists;
+#ifdef HAVE_LCD_BITMAP
+ int i;
+#endif
int button;
- bool quit = false;
+ bool quit = false, usb = false;
char file[MAX_PATH];
if(!parameter) return PLUGIN_ERROR;
rb->strcpy(file, (const char *) parameter);
@@ -301,7 +304,7 @@ enum plugin_status plugin_start(const void* parameter)
rb->closedir(dir);
}
/* now we know if it's a file or a dir or maybe something failed */
-
+
if(!found)
{
/* weird: we couldn't find the entry. This Should Never Happen (TM) */
@@ -319,6 +322,11 @@ enum plugin_status plugin_start(const void* parameter)
return PLUGIN_OK;
}
+#ifdef HAVE_LCD_BITMAP
+ FOR_NB_SCREENS(i)
+ rb->viewportmanager_theme_enable(i, true, NULL);
+#endif
+
rb->gui_synclist_init(&properties_lists, &get_props, file, false, 1, NULL);
rb->gui_synclist_set_title(&properties_lists, its_a_dir ?
"Directory properties" :
@@ -331,7 +339,8 @@ enum plugin_status plugin_start(const void* parameter)
while(!quit)
{
- button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK);
+ button = rb->get_action(CONTEXT_LIST, HZ);
+ /* HZ so the status bar redraws corectly */
if (rb->gui_synclist_do_button(&properties_lists,&button,LIST_WRAP_ON))
continue;
switch(button)
@@ -341,9 +350,18 @@ enum plugin_status plugin_start(const void* parameter)
break;
default:
if (rb->default_event_handler(button) == SYS_USB_CONNECTED)
- return PLUGIN_USB_CONNECTED;
+ {
+ quit = true;
+ usb = true;
+ }
+ break;
}
}
- return PLUGIN_OK;
+#ifdef HAVE_LCD_BITMAP
+ FOR_NB_SCREENS(i)
+ rb->viewportmanager_theme_undo(i, false);
+#endif
+
+ return usb? PLUGIN_USB_CONNECTED: PLUGIN_OK;
}
diff --git a/apps/plugins/shortcuts/shortcuts_view.c b/apps/plugins/shortcuts/shortcuts_view.c
index b964968..a63e26d 100644
--- a/apps/plugins/shortcuts/shortcuts_view.c
+++ b/apps/plugins/shortcuts/shortcuts_view.c
@@ -58,7 +58,8 @@ enum sc_list_action_type draw_sc_list(struct gui_synclist *gui_sc)
while (true) {
/* user input */
- button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK);
+ button = rb->get_action(CONTEXT_LIST, HZ);
+ /* HZ so the status bar redraws corectly */
if (rb->gui_synclist_do_button(gui_sc, &button,
LIST_WRAP_UNLESS_HELD)) {
/* automatic handling of user input.
@@ -93,7 +94,7 @@ static const char* build_sc_list(int selected_item, void *data,
char *buffer, size_t buffer_len)
{
sc_file_t *file = (sc_file_t*)data;
-
+
if (!is_valid_index(file, selected_item)) {
return NULL;
}
@@ -154,7 +155,7 @@ bool list_sc(void)
bool goto_entry(char *file_or_dir)
{
DEBUGF("Trying to go to '%s'...\n", file_or_dir);
-
+
bool is_dir = ends_with(file_or_dir, PATH_SEPARATOR);
bool exists;
char *what;
@@ -194,8 +195,11 @@ bool ends_with(char *string, char *suffix)
enum plugin_status plugin_start(const void* void_parameter)
{
+#ifdef HAVE_LCD_BITMAP
+ int i;
+#endif
bool leave_loop;
-
+
/* This is a viewer, so a parameter must have been specified */
if (void_parameter == NULL) {
rb->splash(HZ*2, "No parameter specified!");
@@ -221,11 +225,21 @@ enum plugin_status plugin_start(const void* void_parameter)
goto_entry(sc_file.entries[0].path);
return PLUGIN_OK;
}
-
+
+#ifdef HAVE_LCD_BITMAP
+ FOR_NB_SCREENS(i)
+ rb->viewportmanager_theme_enable(i, true, NULL);
+#endif
+
do {
/* Display a menu to choose between the entries */
leave_loop = list_sc();
} while (!leave_loop);
+#ifdef HAVE_LCD_BITMAP
+ FOR_NB_SCREENS(i)
+ rb->viewportmanager_theme_undo(i, false);
+#endif
+
return usb_connected ? PLUGIN_USB_CONNECTED : PLUGIN_OK;
}