summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-02-01 11:34:16 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-02-01 11:34:16 +0000
commit80cb3551eb61cdf240cf24ad0c44016475bf2e61 (patch)
treee9c72c90954b73807d64df59fefcdf0b1c1fc615
parente55f2329c059434452c62af48903b4607e500e4e (diff)
downloadrockbox-80cb3551eb61cdf240cf24ad0c44016475bf2e61.tar.gz
rockbox-80cb3551eb61cdf240cf24ad0c44016475bf2e61.zip
Statusbar handling fixes.
Fixes FS#9845 - %we/%wd wasnt working WPS no longer resets the viewportmanger more than needed (was doing it twice/draw before) screens can now enable/disable the statusbar easily ignoring the setting instead of needing special handling (fix for the radio screen coming soon) minor glitch introduced in this commit... the statusbar in the WPS might disappear for a fraction of a second when it is entered, I need to track this down... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19894 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/debug_menu.c2
-rw-r--r--apps/gui/gwps-common.c39
-rw-r--r--apps/gui/gwps.c58
-rw-r--r--apps/gui/list.c2
-rw-r--r--apps/gui/viewport.c35
-rw-r--r--apps/gui/viewport.h13
-rw-r--r--apps/main.c2
-rw-r--r--apps/menu.c2
-rw-r--r--apps/menus/eq_menu.c2
-rw-r--r--apps/plugin.c6
-rw-r--r--apps/plugin.h6
-rw-r--r--apps/plugins/lib/oldmenuapi.c2
-rw-r--r--apps/plugins/star.c2
-rw-r--r--apps/recorder/keyboard.c2
-rw-r--r--apps/root_menu.c2
15 files changed, 91 insertions, 84 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 60f4761e94..d8fe49e5ac 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -2739,7 +2739,7 @@ static int menu_action_callback(int btn, struct gui_synclist *lists)
2739{ 2739{
2740 if (btn == ACTION_STD_OK) 2740 if (btn == ACTION_STD_OK)
2741 { 2741 {
2742 bool oldbars = viewportmanager_set_statusbar(false); 2742 char oldbars = viewportmanager_set_statusbar(0);
2743 menuitems[gui_synclist_get_sel_pos(lists)].function(); 2743 menuitems[gui_synclist_get_sel_pos(lists)].function();
2744 btn = ACTION_REDRAW; 2744 btn = ACTION_REDRAW;
2745 viewportmanager_set_statusbar(oldbars); 2745 viewportmanager_set_statusbar(oldbars);
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index e07436e565..2d65629f97 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -62,6 +62,7 @@
62#endif 62#endif
63#include "backdrop.h" 63#include "backdrop.h"
64#include "viewport.h" 64#include "viewport.h"
65#include "pcmbuf.h"
65 66
66#define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ 67#define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */
67 /* 3% of 30min file == 54s step size */ 68 /* 3% of 30min file == 54s step size */
@@ -75,36 +76,6 @@
75#define DEFAULT_SUBLINE_TIME_MULTIPLIER 20 /* In TIMEOUT_UNIT's */ 76#define DEFAULT_SUBLINE_TIME_MULTIPLIER 20 /* In TIMEOUT_UNIT's */
76 77
77 78
78/* draws the statusbar on the given wps-screen */
79#ifdef HAVE_LCD_BITMAP
80static void gui_wps_statusbar_draw(struct gui_wps *wps, bool force)
81{
82 (void)force;
83 bool draw = global_settings.statusbar;
84
85 if (wps->data->wps_sb_tag)
86 draw = wps->data->show_sb_on_wps;
87
88#if NB_SCREENS > 1
89 /* multi screen targets could show the bars on one screen but not both
90 * so the viewportmanager can't be used in its current form...
91 * Also, the WPS is a special screen so doing this is reasonable.
92 */
93 if (draw)
94 {
95 struct gui_statusbar *bar;
96 bar = &statusbars.statusbars[wps->data->remote_wps?SCREEN_REMOTE:SCREEN_MAIN];
97 gui_statusbar_draw(bar, force);
98 }
99#else
100 viewportmanager_set_statusbar(draw);
101#endif
102}
103#else
104#define gui_wps_statusbar_draw(wps, force) viewportmanager_set_statusbar(true)
105#endif
106#include "pcmbuf.h"
107
108/* fades the volume */ 79/* fades the volume */
109bool wps_fading_out = false; 80bool wps_fading_out = false;
110void fade(bool fade_in, bool updatewps) 81void fade(bool fade_in, bool updatewps)
@@ -170,7 +141,6 @@ void fade(bool fade_in, bool updatewps)
170*/ 141*/
171bool update_onvol_change(struct gui_wps * gwps) 142bool update_onvol_change(struct gui_wps * gwps)
172{ 143{
173 gui_wps_statusbar_draw(gwps, false);
174 gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC); 144 gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC);
175 145
176#ifdef HAVE_LCD_CHARCELLS 146#ifdef HAVE_LCD_CHARCELLS
@@ -366,7 +336,6 @@ bool gui_wps_display(void)
366 } 336 }
367#endif 337#endif
368#endif 338#endif
369
370 gui_wps[i].display->clear_display(); 339 gui_wps[i].display->clear_display();
371 if (!gui_wps[i].data->wps_loaded) { 340 if (!gui_wps[i].data->wps_loaded) {
372 if ( !gui_wps[i].data->num_tokens ) { 341 if ( !gui_wps[i].data->num_tokens ) {
@@ -481,8 +450,6 @@ bool update(struct gui_wps *gwps)
481 gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC); 450 gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC);
482 } 451 }
483 452
484 gui_wps_statusbar_draw(gwps, false);
485
486 return retcode; 453 return retcode;
487} 454}
488 455
@@ -1978,7 +1945,6 @@ bool gui_wps_refresh(struct gui_wps *gwps,
1978 bool update_line, new_subline_refresh; 1945 bool update_line, new_subline_refresh;
1979 1946
1980#ifdef HAVE_LCD_BITMAP 1947#ifdef HAVE_LCD_BITMAP
1981 gui_wps_statusbar_draw(gwps, true);
1982 1948
1983 /* to find out wether the peak meter is enabled we 1949 /* to find out wether the peak meter is enabled we
1984 assume it wasn't until we find a line that contains 1950 assume it wasn't until we find a line that contains
@@ -2195,7 +2161,8 @@ bool gui_wps_refresh(struct gui_wps *gwps,
2195 remote_backlight_on(); 2161 remote_backlight_on();
2196 } 2162 }
2197#endif 2163#endif
2198 2164 /* force a bars update if they are being displayed */
2165 viewportmanager_draw_statusbars(NULL);
2199 return true; 2166 return true;
2200} 2167}
2201 2168
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index 6c387ef62e..1d8d7255bf 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -115,8 +115,24 @@ static void next_track(void)
115 115
116 audio_next(); 116 audio_next();
117} 117}
118 118static char fix_wps_bars(void)
119 119{
120#ifdef HAVE_LCD_BITMAP
121 int i;
122 char wpsbars = 0;
123 FOR_NB_SCREENS(i)
124 {
125 bool draw = global_settings.statusbar;
126 if (gui_wps[i].data->wps_sb_tag)
127 draw = gui_wps[i].data->show_sb_on_wps;
128 if (draw)
129 wpsbars |= VP_IGNORE_SB_SETTING(i)|(1<<i);
130 }
131 return wpsbars;
132#else
133 return 1;
134#endif
135}
120long gui_wps_show(void) 136long gui_wps_show(void)
121{ 137{
122 long button = 0; 138 long button = 0;
@@ -127,8 +143,8 @@ long gui_wps_show(void)
127 bool update_track = false; 143 bool update_track = false;
128 int i; 144 int i;
129 long last_left = 0, last_right = 0; 145 long last_left = 0, last_right = 0;
146 char wpsbars = 0, oldbars = 0;
130 147
131 viewportmanager_set_statusbar(false);
132 wps_state_init(); 148 wps_state_init();
133 149
134#ifdef HAVE_LCD_CHARCELLS 150#ifdef HAVE_LCD_CHARCELLS
@@ -149,6 +165,7 @@ long gui_wps_show(void)
149 ab_reset_markers(); 165 ab_reset_markers();
150#endif 166#endif
151 167
168 oldbars = viewportmanager_set_statusbar(0);
152 if(audio_status() & AUDIO_STATUS_PLAY) 169 if(audio_status() & AUDIO_STATUS_PLAY)
153 { 170 {
154 wps_state.id3 = audio_current_track(); 171 wps_state.id3 = audio_current_track();
@@ -156,12 +173,13 @@ long gui_wps_show(void)
156 if (wps_state.id3) { 173 if (wps_state.id3) {
157 if (gui_wps_display()) 174 if (gui_wps_display())
158 return 0; 175 return 0;
159 FOR_NB_SCREENS(i)
160 gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_ALL);
161 } 176 }
162 177
163 restore = true; 178 restore = true;
164 } 179 }
180 wpsbars = fix_wps_bars();
181 viewportmanager_set_statusbar(wpsbars);
182
165 while ( 1 ) 183 while ( 1 )
166 { 184 {
167 bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false; 185 bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false;
@@ -259,20 +277,19 @@ long gui_wps_show(void)
259 { 277 {
260 case ACTION_WPS_CONTEXT: 278 case ACTION_WPS_CONTEXT:
261 { 279 {
262 bool bars;
263#if LCD_DEPTH > 1 280#if LCD_DEPTH > 1
264 show_main_backdrop(); 281 show_main_backdrop();
265#endif 282#endif
266#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 283#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
267 show_remote_main_backdrop(); 284 show_remote_main_backdrop();
268#endif 285#endif
269 bars = viewportmanager_set_statusbar(true); 286 viewportmanager_set_statusbar(oldbars);
270 /* if music is stopped in the context menu we want to exit the wps */ 287 /* if music is stopped in the context menu we want to exit the wps */
271 if (onplay(wps_state.id3->path, 288 if (onplay(wps_state.id3->path,
272 FILE_ATTR_AUDIO, CONTEXT_WPS) == ONPLAY_MAINMENU 289 FILE_ATTR_AUDIO, CONTEXT_WPS) == ONPLAY_MAINMENU
273 || !audio_status()) 290 || !audio_status())
274 return GO_TO_ROOT; 291 return GO_TO_ROOT;
275 viewportmanager_set_statusbar(bars); 292 viewportmanager_set_statusbar(wpsbars);
276 /* track might have changed */ 293 /* track might have changed */
277 update_track = true; 294 update_track = true;
278 295
@@ -527,7 +544,7 @@ long gui_wps_show(void)
527#ifdef HAVE_QUICKSCREEN 544#ifdef HAVE_QUICKSCREEN
528 case ACTION_WPS_QUICKSCREEN: 545 case ACTION_WPS_QUICKSCREEN:
529 { 546 {
530 bool bars = viewportmanager_set_statusbar(true); 547 viewportmanager_set_statusbar(oldbars);
531#if LCD_DEPTH > 1 548#if LCD_DEPTH > 1
532 show_main_backdrop(); 549 show_main_backdrop();
533#endif 550#endif
@@ -536,7 +553,8 @@ long gui_wps_show(void)
536#endif 553#endif
537 if (quick_screen_quick(button)) 554 if (quick_screen_quick(button))
538 return SYS_USB_CONNECTED; 555 return SYS_USB_CONNECTED;
539 viewportmanager_set_statusbar(bars); 556 wpsbars = fix_wps_bars();
557 viewportmanager_set_statusbar(wpsbars);
540#if LCD_DEPTH > 1 558#if LCD_DEPTH > 1
541 show_wps_backdrop(); 559 show_wps_backdrop();
542#endif 560#endif
@@ -552,7 +570,7 @@ long gui_wps_show(void)
552#ifdef BUTTON_F3 570#ifdef BUTTON_F3
553 case ACTION_F3: 571 case ACTION_F3:
554 { 572 {
555 bool bars = viewportmanager_set_statusbar(true); 573 viewportmanager_set_statusbar(oldbars);
556#if LCD_DEPTH > 1 574#if LCD_DEPTH > 1
557 show_main_backdrop(); 575 show_main_backdrop();
558#endif 576#endif
@@ -562,7 +580,8 @@ long gui_wps_show(void)
562 if (quick_screen_f3(BUTTON_F3)) 580 if (quick_screen_f3(BUTTON_F3))
563 return SYS_USB_CONNECTED; 581 return SYS_USB_CONNECTED;
564 restore = true; 582 restore = true;
565 viewportmanager_set_statusbar(bars); 583 wpsbars = fix_wps_bars();
584 viewportmanager_set_statusbar(wpsbars);
566 } 585 }
567 break; 586 break;
568#endif /* BUTTON_F3 */ 587#endif /* BUTTON_F3 */
@@ -571,7 +590,7 @@ long gui_wps_show(void)
571#ifdef HAVE_PITCHSCREEN 590#ifdef HAVE_PITCHSCREEN
572 case ACTION_WPS_PITCHSCREEN: 591 case ACTION_WPS_PITCHSCREEN:
573 { 592 {
574 bool bars = viewportmanager_set_statusbar(true); 593 viewportmanager_set_statusbar(oldbars);
575#if LCD_DEPTH > 1 594#if LCD_DEPTH > 1
576 show_main_backdrop(); 595 show_main_backdrop();
577#endif 596#endif
@@ -587,7 +606,7 @@ long gui_wps_show(void)
587 show_remote_wps_backdrop(); 606 show_remote_wps_backdrop();
588#endif 607#endif
589 restore = true; 608 restore = true;
590 viewportmanager_set_statusbar(bars); 609 viewportmanager_set_statusbar(wpsbars);
591 } 610 }
592 break; 611 break;
593#endif /* HAVE_PITCHSCREEN */ 612#endif /* HAVE_PITCHSCREEN */
@@ -613,7 +632,7 @@ long gui_wps_show(void)
613 632
614 case ACTION_WPS_ID3SCREEN: 633 case ACTION_WPS_ID3SCREEN:
615 { 634 {
616 bool bars = viewportmanager_set_statusbar(true); 635 viewportmanager_set_statusbar(oldbars);
617#if LCD_DEPTH > 1 636#if LCD_DEPTH > 1
618 show_main_backdrop(); 637 show_main_backdrop();
619#endif 638#endif
@@ -628,7 +647,7 @@ long gui_wps_show(void)
628 show_remote_wps_backdrop(); 647 show_remote_wps_backdrop();
629#endif 648#endif
630 restore = true; 649 restore = true;
631 viewportmanager_set_statusbar(bars); 650 viewportmanager_set_statusbar(wpsbars);
632 } 651 }
633 break; 652 break;
634 653
@@ -645,7 +664,7 @@ long gui_wps_show(void)
645 break; 664 break;
646#endif 665#endif
647 case SYS_POWEROFF: 666 case SYS_POWEROFF:
648 viewportmanager_set_statusbar(true); 667 viewportmanager_set_statusbar(oldbars);
649#if LCD_DEPTH > 1 668#if LCD_DEPTH > 1
650 show_main_backdrop(); 669 show_main_backdrop();
651#endif 670#endif
@@ -681,13 +700,10 @@ long gui_wps_show(void)
681 if (gui_wps_display()) { 700 if (gui_wps_display()) {
682 exit = true; 701 exit = true;
683 } 702 }
684 else if (wps_state.id3){
685 FOR_NB_SCREENS(i)
686 gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_NON_STATIC);
687 }
688 } 703 }
689 704
690 if (exit) { 705 if (exit) {
706 viewportmanager_set_statusbar(oldbars);
691#ifdef HAVE_LCD_CHARCELLS 707#ifdef HAVE_LCD_CHARCELLS
692 status_set_record(false); 708 status_set_record(false);
693 status_set_audio(false); 709 status_set_audio(false);
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 2107d3a593..7b8c2975c1 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -845,7 +845,7 @@ bool simplelist_show_list(struct simplelist_info *info)
845{ 845{
846 struct gui_synclist lists; 846 struct gui_synclist lists;
847 int action, old_line_count = simplelist_line_count; 847 int action, old_line_count = simplelist_line_count;
848 bool oldbars = viewportmanager_set_statusbar(true); 848 char oldbars = viewportmanager_set_statusbar(VP_ALLSCREENS);
849 char* (*getname)(int item, void * data, char *buffer, size_t buffer_len); 849 char* (*getname)(int item, void * data, char *buffer, size_t buffer_len);
850 int wrap = LIST_WRAP_UNLESS_HELD; 850 int wrap = LIST_WRAP_UNLESS_HELD;
851 if (info->get_name) 851 if (info->get_name)
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 24ba652498..3854430521 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -35,7 +35,7 @@
35#include "screen_access.h" 35#include "screen_access.h"
36#include "appevents.h" 36#include "appevents.h"
37 37
38static bool statusbar_enabled = true; 38static char statusbar_enabled = VP_ALLSCREENS;
39 39
40int viewport_get_nb_lines(struct viewport *vp) 40int viewport_get_nb_lines(struct viewport *vp)
41{ 41{
@@ -47,13 +47,19 @@ int viewport_get_nb_lines(struct viewport *vp)
47#endif 47#endif
48} 48}
49 49
50static bool showing_bars(enum screen_type screen)
51{
52 if (statusbar_enabled&(1<<screen))
53 return global_settings.statusbar || (statusbar_enabled&(1<<(screen+4)));
54 return false;
55}
50 56
51void viewport_set_defaults(struct viewport *vp, enum screen_type screen) 57void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
52{ 58{
53 vp->x = 0; 59 vp->x = 0;
54 vp->width = screens[screen].lcdwidth; 60 vp->width = screens[screen].lcdwidth;
55 61
56 vp->y = statusbar_enabled?gui_statusbar_height():0; 62 vp->y = showing_bars(screen)?gui_statusbar_height():0;
57 vp->height = screens[screen].lcdheight - vp->y; 63 vp->height = screens[screen].lcdheight - vp->y;
58#ifdef HAVE_LCD_BITMAP 64#ifdef HAVE_LCD_BITMAP
59 vp->drawmode = DRMODE_SOLID; 65 vp->drawmode = DRMODE_SOLID;
@@ -87,17 +93,18 @@ void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
87} 93}
88 94
89/* returns true if it was enabled BEFORE this call */ 95/* returns true if it was enabled BEFORE this call */
90bool viewportmanager_set_statusbar(bool enabled) 96char viewportmanager_set_statusbar(char enabled)
91{ 97{
92 bool old = statusbar_enabled; 98 char old = statusbar_enabled;
93 if (enabled 99 if (enabled)
94#ifdef HAVE_LCD_BITMAP
95 && global_settings.statusbar
96#endif
97 )
98 { 100 {
101 int i;
102 FOR_NB_SCREENS(i)
103 {
104 if (showing_bars(i))
105 gui_statusbar_draw(&statusbars.statusbars[i], true);
106 }
99 add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_draw_statusbars); 107 add_event(GUI_EVENT_ACTIONUPDATE, false, viewportmanager_draw_statusbars);
100 gui_syncstatusbar_draw(&statusbars, true);
101 } 108 }
102 else 109 else
103 { 110 {
@@ -110,8 +117,12 @@ bool viewportmanager_set_statusbar(bool enabled)
110void viewportmanager_draw_statusbars(void* data) 117void viewportmanager_draw_statusbars(void* data)
111{ 118{
112 (void)data; 119 (void)data;
113 if (statusbar_enabled) 120 int i;
114 gui_syncstatusbar_draw(&statusbars, false); 121 FOR_NB_SCREENS(i)
122 {
123 if (showing_bars(i))
124 gui_statusbar_draw(&statusbars.statusbars[i], false);
125 }
115} 126}
116 127
117void viewportmanager_statusbar_changed(void* data) 128void viewportmanager_statusbar_changed(void* data)
diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h
index 53f522347f..02748527a4 100644
--- a/apps/gui/viewport.h
+++ b/apps/gui/viewport.h
@@ -41,7 +41,18 @@ int viewport_load_config(const char *config, struct viewport *vp);
41 41
42void viewport_set_defaults(struct viewport *vp, enum screen_type screen); 42void viewport_set_defaults(struct viewport *vp, enum screen_type screen);
43 43
44bool viewportmanager_set_statusbar(bool enabled); 44/* viewportmanager_set_statusbar() is used to specify which screens the statusbar
45 * should be displayed on.
46 * *usually* enabled will be VP_ALLSCREENS which means display the bar if the setting
47 * is enabled. (and it will be on both screens)
48 * For the WPS (and other possible exceptions) use VP_IGNORE_SB_SETTING() to
49 * FORCE the statusbar on for the given screen (i.e it will show regardless of the setting
50 */
51#define VP_SB_ONSCREEN(screen) (1<<screen) /* turn the SB on "screen" only */
52#define VP_ALLSCREENS (VP_SB_ONSCREEN(0)|VP_SB_ONSCREEN(1)) /* SB on for both screens */
53#define VP_IGNORE_SB_SETTING(screen) (1<<(4+screen))
54char viewportmanager_set_statusbar(char enabled);
55
45/* callbacks for GUI_EVENT_* events */ 56/* callbacks for GUI_EVENT_* events */
46void viewportmanager_draw_statusbars(void*data); 57void viewportmanager_draw_statusbars(void*data);
47void viewportmanager_statusbar_changed(void* data); 58void viewportmanager_statusbar_changed(void* data);
diff --git a/apps/main.c b/apps/main.c
index 8a1f0a986c..89896ce398 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -138,7 +138,7 @@ static void app_main(void)
138#ifdef HAVE_TOUCHSCREEN 138#ifdef HAVE_TOUCHSCREEN
139 touchscreen_set_mode(TOUCHSCREEN_BUTTON); 139 touchscreen_set_mode(TOUCHSCREEN_BUTTON);
140#endif 140#endif
141 viewportmanager_set_statusbar(true); 141 viewportmanager_set_statusbar(VP_ALLSCREENS);
142 add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, 142 add_event(GUI_EVENT_STATUSBAR_TOGGLE, false,
143 viewportmanager_statusbar_changed); 143 viewportmanager_statusbar_changed);
144#ifdef HAVE_USBSTACK 144#ifdef HAVE_USBSTACK
diff --git a/apps/menu.c b/apps/menu.c
index 419db3ae3e..2ba6cb4d35 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -355,7 +355,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
355 const struct menu_item_ex *temp, *menu; 355 const struct menu_item_ex *temp, *menu;
356 int ret = 0, i; 356 int ret = 0, i;
357 bool redraw_lists; 357 bool redraw_lists;
358 bool oldbars = viewportmanager_set_statusbar(!hide_bars); 358 char oldbars = viewportmanager_set_statusbar(hide_bars?0:VP_ALLSCREENS);
359 359
360 const struct menu_item_ex *menu_stack[MAX_MENUS]; 360 const struct menu_item_ex *menu_stack[MAX_MENUS];
361 int menu_stack_selected_item[MAX_MENUS]; 361 int menu_stack_selected_item[MAX_MENUS];
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c
index 28df0836fc..89c0e31128 100644
--- a/apps/menus/eq_menu.c
+++ b/apps/menus/eq_menu.c
@@ -392,7 +392,7 @@ bool eq_menu_graphical(void)
392 enum eq_type current_type; 392 enum eq_type current_type;
393 char buf[24]; 393 char buf[24];
394 int i, w, h, height, start_item, nb_eq_sliders[NB_SCREENS]; 394 int i, w, h, height, start_item, nb_eq_sliders[NB_SCREENS];
395 bool barsenabled = viewportmanager_set_statusbar(false); 395 char barsenabled = viewportmanager_set_statusbar(0);
396 396
397 397
398 FOR_NB_SCREENS(i) { 398 FOR_NB_SCREENS(i) {
diff --git a/apps/plugin.c b/apps/plugin.c
index 98bbd2956f..95dec9d767 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -636,7 +636,7 @@ static const struct plugin_api rockbox_api = {
636int plugin_load(const char* plugin, const void* parameter) 636int plugin_load(const char* plugin, const void* parameter)
637{ 637{
638 int rc; 638 int rc;
639 bool oldbars; 639 char oldbars;
640 struct plugin_header *hdr; 640 struct plugin_header *hdr;
641#ifdef SIMULATOR 641#ifdef SIMULATOR
642 void *pd; 642 void *pd;
@@ -743,11 +743,11 @@ int plugin_load(const char* plugin, const void* parameter)
743#endif 743#endif
744 744
745 invalidate_icache(); 745 invalidate_icache();
746 oldbars = viewportmanager_set_statusbar(false); 746 oldbars = viewportmanager_set_statusbar(0);
747 747
748 rc = hdr->entry_point(parameter); 748 rc = hdr->entry_point(parameter);
749 749
750 viewportmanager_set_statusbar(true); 750 viewportmanager_set_statusbar(oldbars);
751 751
752 button_clear_queue(); 752 button_clear_queue();
753 753
diff --git a/apps/plugin.h b/apps/plugin.h
index 97c3087779..05e4db00a9 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -126,12 +126,12 @@ void* plugin_get_buffer(size_t *buffer_size);
126#define PLUGIN_MAGIC 0x526F634B /* RocK */ 126#define PLUGIN_MAGIC 0x526F634B /* RocK */
127 127
128/* increase this every time the api struct changes */ 128/* increase this every time the api struct changes */
129#define PLUGIN_API_VERSION 139 129#define PLUGIN_API_VERSION 140
130 130
131/* update this to latest version if a change to the api struct breaks 131/* update this to latest version if a change to the api struct breaks
132 backwards compatibility (and please take the opportunity to sort in any 132 backwards compatibility (and please take the opportunity to sort in any
133 new function which are "waiting" at the end of the function table) */ 133 new function which are "waiting" at the end of the function table) */
134#define PLUGIN_MIN_API_VERSION 137 134#define PLUGIN_MIN_API_VERSION 140
135 135
136/* plugin return codes */ 136/* plugin return codes */
137enum plugin_status { 137enum plugin_status {
@@ -312,7 +312,7 @@ struct plugin_api {
312 int height); 312 int height);
313#endif 313#endif
314 void (*viewport_set_defaults)(struct viewport *vp, enum screen_type screen); 314 void (*viewport_set_defaults)(struct viewport *vp, enum screen_type screen);
315 bool (*viewportmanager_set_statusbar)(bool enabled); 315 char (*viewportmanager_set_statusbar)(char enabled);
316 /* list */ 316 /* list */
317 void (*gui_synclist_init)(struct gui_synclist * lists, 317 void (*gui_synclist_init)(struct gui_synclist * lists,
318 list_get_name callback_get_item_name, void * data, 318 list_get_name callback_get_item_name, void * data,
diff --git a/apps/plugins/lib/oldmenuapi.c b/apps/plugins/lib/oldmenuapi.c
index 9c371d531e..864291fd4d 100644
--- a/apps/plugins/lib/oldmenuapi.c
+++ b/apps/plugins/lib/oldmenuapi.c
@@ -94,6 +94,7 @@ int menu_show(int m)
94 bool exit = false; 94 bool exit = false;
95 int key; 95 int key;
96 96
97 char bars = rb->viewportmanager_set_statusbar(VP_ALLSCREENS);
97 rb->gui_synclist_draw(&(menus[m].synclist)); 98 rb->gui_synclist_draw(&(menus[m].synclist));
98 while (!exit) { 99 while (!exit) {
99 key = rb->get_action(CONTEXT_MAINMENU,HZ/2); 100 key = rb->get_action(CONTEXT_MAINMENU,HZ/2);
@@ -123,6 +124,7 @@ int menu_show(int m)
123 break; 124 break;
124 } 125 }
125 } 126 }
127 rb->viewportmanager_set_statusbar(bars);
126 return MENU_SELECTED_EXIT; 128 return MENU_SELECTED_EXIT;
127} 129}
128 130
diff --git a/apps/plugins/star.c b/apps/plugins/star.c
index 931161308a..c4251cd223 100644
--- a/apps/plugins/star.c
+++ b/apps/plugins/star.c
@@ -1030,7 +1030,7 @@ static int star_menu(void)
1030 } 1030 }
1031 while(!menu_quit) 1031 while(!menu_quit)
1032 { 1032 {
1033 switch(rb->do_menu(&menu, &selection, vp, true)) 1033 switch(rb->do_menu(&menu, &selection, vp, false))
1034 { 1034 {
1035 case 0: 1035 case 0:
1036 menu_quit = true; 1036 menu_quit = true;
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index c7e8ad8de0..a5e093d541 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -298,7 +298,7 @@ int kbd_input(char* text, int buflen)
298 int morse_tick = 0; 298 int morse_tick = 0;
299 char buf[2]; 299 char buf[2];
300#endif 300#endif
301 bool oldbars = viewportmanager_set_statusbar(false); 301 char oldbars = viewportmanager_set_statusbar(0);
302 FOR_NB_SCREENS(l) 302 FOR_NB_SCREENS(l)
303 { 303 {
304 struct keyboard_parameters *pm = &param[l]; 304 struct keyboard_parameters *pm = &param[l];
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 5c4abf6522..78f5d514b2 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -270,7 +270,7 @@ static int wpsscrn(void* param)
270 show_remote_main_backdrop(); 270 show_remote_main_backdrop();
271#endif 271#endif
272 /* always re-enable the statusbar after the WPS */ 272 /* always re-enable the statusbar after the WPS */
273 viewportmanager_set_statusbar(true); 273 viewportmanager_set_statusbar(VP_ALLSCREENS);
274 return ret_val; 274 return ret_val;
275} 275}
276#if CONFIG_TUNER 276#if CONFIG_TUNER