summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-01-02 01:29:13 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-01-02 01:29:13 +0000
commit9296126417be3be3de2f9a8300eb35a042790c74 (patch)
treeffeb77af3ff016c9d908e0551d43a901b12eff9d /apps/gui
parentaec45210ea624a071bcda6c0db535e5c37df1375 (diff)
More SYS_FOURHERTZ handling fixes.. (FS#9740 FS#9741)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19635 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/gwps.c35
-rw-r--r--apps/gui/list.c3
-rw-r--r--apps/gui/viewport.c6
-rw-r--r--apps/gui/viewport.h2
4 files changed, 37 insertions, 9 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index 71a8a01fc4..6faf6e91f9 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -210,6 +210,8 @@ long gui_wps_show(void)
if (button != ACTION_NONE) {
break;
}
+ else if (button == SYS_FOURHERTZ)
+ default_event_handler(button);
peak_meter_peek();
sleep(0); /* Sleep until end of current tick. */
@@ -267,18 +269,21 @@ long gui_wps_show(void)
switch(button)
{
case ACTION_WPS_CONTEXT:
+ {
+ bool bars;
#if LCD_DEPTH > 1
show_main_backdrop();
#endif
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
show_remote_main_backdrop();
#endif
+ bars = viewportmanager_set_statusbar(true);
/* if music is stopped in the context menu we want to exit the wps */
if (onplay(wps_state.id3->path,
FILE_ATTR_AUDIO, CONTEXT_WPS) == ONPLAY_MAINMENU
|| !audio_status())
return GO_TO_ROOT;
-
+ viewportmanager_set_statusbar(bars);
/* track might have changed */
update_track = true;
@@ -289,7 +294,8 @@ long gui_wps_show(void)
show_remote_wps_backdrop();
#endif
restore = true;
- break;
+ }
+ break;
case ACTION_WPS_BROWSE:
#ifdef HAVE_LCD_CHARCELLS
@@ -531,6 +537,8 @@ long gui_wps_show(void)
#ifdef HAVE_QUICKSCREEN
case ACTION_WPS_QUICKSCREEN:
+ {
+ bool bars = viewportmanager_set_statusbar(true);
#if LCD_DEPTH > 1
show_main_backdrop();
#endif
@@ -539,6 +547,7 @@ long gui_wps_show(void)
#endif
if (quick_screen_quick(button))
return SYS_USB_CONNECTED;
+ viewportmanager_set_statusbar(bars);
#if LCD_DEPTH > 1
show_wps_backdrop();
#endif
@@ -546,12 +555,15 @@ long gui_wps_show(void)
show_remote_wps_backdrop();
#endif
restore = true;
- break;
+ }
+ break;
#endif /* HAVE_QUICKSCREEN */
/* screen settings */
#ifdef BUTTON_F3
case ACTION_F3:
+ {
+ bool bars = viewportmanager_set_statusbar(true);
#if LCD_DEPTH > 1
show_main_backdrop();
#endif
@@ -561,12 +573,16 @@ long gui_wps_show(void)
if (quick_screen_f3(BUTTON_F3))
return SYS_USB_CONNECTED;
restore = true;
- break;
+ viewportmanager_set_statusbar(bars);
+ }
+ break;
#endif /* BUTTON_F3 */
/* pitch screen */
#ifdef HAVE_PITCHSCREEN
case ACTION_WPS_PITCHSCREEN:
+ {
+ bool bars = viewportmanager_set_statusbar(true);
#if LCD_DEPTH > 1
show_main_backdrop();
#endif
@@ -582,7 +598,9 @@ long gui_wps_show(void)
show_remote_wps_backdrop();
#endif
restore = true;
- break;
+ viewportmanager_set_statusbar(bars);
+ }
+ break;
#endif /* HAVE_PITCHSCREEN */
#ifdef AB_REPEAT_ENABLE
@@ -605,6 +623,8 @@ long gui_wps_show(void)
break;
case ACTION_WPS_ID3SCREEN:
+ {
+ bool bars = viewportmanager_set_statusbar(true);
#if LCD_DEPTH > 1
show_main_backdrop();
#endif
@@ -619,7 +639,9 @@ long gui_wps_show(void)
show_remote_wps_backdrop();
#endif
restore = true;
- break;
+ viewportmanager_set_statusbar(bars);
+ }
+ break;
case ACTION_REDRAW: /* yes are locked, just redraw */
restore = true;
@@ -634,6 +656,7 @@ long gui_wps_show(void)
break;
#endif
case SYS_POWEROFF:
+ viewportmanager_set_statusbar(true);
#if LCD_DEPTH > 1
show_main_backdrop();
#endif
diff --git a/apps/gui/list.c b/apps/gui/list.c
index b70cf424ee..9843339dd4 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -649,6 +649,9 @@ bool gui_synclist_do_button(struct gui_synclist * lists,
switch (action)
{
+ case SYS_FOURHERTZ:
+ default_event_handler(action);
+ return true;
case ACTION_REDRAW:
gui_synclist_draw(lists);
return true;
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 9cd905fa14..9a0657d510 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -86,9 +86,10 @@ void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
#endif
}
-
-void viewportmanager_set_statusbar(bool enabled)
+/* returns true if it was enabled BEFORE this call */
+bool viewportmanager_set_statusbar(bool enabled)
{
+ bool old = statusbar_enabled;
if (enabled && global_settings.statusbar)
{
add_event(GUI_EVENT_FOURHERTZ, false, viewportmanager_draw_statusbars);
@@ -99,6 +100,7 @@ void viewportmanager_set_statusbar(bool enabled)
remove_event(GUI_EVENT_FOURHERTZ, viewportmanager_draw_statusbars);
}
statusbar_enabled = enabled;
+ return old;
}
void viewportmanager_draw_statusbars(void* data)
diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h
index cdb481017a..53f522347f 100644
--- a/apps/gui/viewport.h
+++ b/apps/gui/viewport.h
@@ -41,7 +41,7 @@ int viewport_load_config(const char *config, struct viewport *vp);
void viewport_set_defaults(struct viewport *vp, enum screen_type screen);
-void viewportmanager_set_statusbar(bool enabled);
+bool viewportmanager_set_statusbar(bool enabled);
/* callbacks for GUI_EVENT_* events */
void viewportmanager_draw_statusbars(void*data);
void viewportmanager_statusbar_changed(void* data);