a few more button/statusbar fixes...

* hopefully fix the last of the plugins which dont handle the enw SYS event.
* fix FS#9750 - WPS's which dont specify (or force the wps on) wernt showing the statusbar at all
* lamp, battery_bench, *_flash button handling fixes
* plugins using the core menu code will again show the statusbar



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19656 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2009-01-03 13:27:19 +00:00
parent 3681ff197d
commit 4b472de39b
8 changed files with 26 additions and 16 deletions

View file

@ -85,8 +85,7 @@ static void gui_wps_statusbar_draw(struct gui_wps *wps, bool force)
if (wps->data->wps_sb_tag) if (wps->data->wps_sb_tag)
draw = wps->data->show_sb_on_wps; draw = wps->data->show_sb_on_wps;
if (!draw) viewportmanager_set_statusbar(draw);
viewportmanager_set_statusbar(false);
} }
#else #else
#define gui_wps_statusbar_draw(wps, force) #define gui_wps_statusbar_draw(wps, force)

View file

@ -341,7 +341,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
if(!display->has_disk_led && bar->info.led) if(!display->has_disk_led && bar->info.led)
gui_statusbar_led(display); gui_statusbar_led(display);
#endif #endif
display->update_rect(0, 0, display->getwidth(), STATUSBAR_HEIGHT); display->update_viewport();
bar->lastinfo = bar->info; bar->lastinfo = bar->info;
} }
#endif /* HAVE_LCD_BITMAP */ #endif /* HAVE_LCD_BITMAP */

View file

@ -355,6 +355,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
const struct menu_item_ex *temp, *menu; const struct menu_item_ex *temp, *menu;
int ret = 0, i; int ret = 0, i;
bool redraw_lists; bool redraw_lists;
bool oldbars = viewportmanager_set_statusbar(!hide_bars);
const struct menu_item_ex *menu_stack[MAX_MENUS]; const struct menu_item_ex *menu_stack[MAX_MENUS];
int menu_stack_selected_item[MAX_MENUS]; int menu_stack_selected_item[MAX_MENUS];
@ -696,6 +697,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
*start_selected = get_menu_selection( *start_selected = get_menu_selection(
gui_synclist_get_sel_pos(&lists), menu); gui_synclist_get_sel_pos(&lists), menu);
} }
viewportmanager_set_statusbar(oldbars);
return ret; return ret;
} }

View file

@ -224,6 +224,7 @@ static unsigned int buf_idx;
bool exit_tsr(bool reenter) bool exit_tsr(bool reenter)
{ {
long button;
(void)reenter; (void)reenter;
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->lcd_puts_scroll(0, 0, "Batt.Bench is currently running."); rb->lcd_puts_scroll(0, 0, "Batt.Bench is currently running.");
@ -233,15 +234,21 @@ bool exit_tsr(bool reenter)
#endif #endif
rb->lcd_update(); rb->lcd_update();
if (rb->button_get(true) == BATTERY_OFF) while (1)
{ {
rb->queue_post(&thread_q, EV_EXIT, 0); button = rb->button_get(true);
rb->thread_wait(thread_id); if (IS_SYSEVENT(button))
/* remove the thread's queue from the broadcast list */ continue;
rb->queue_delete(&thread_q); if (button == BATTERY_OFF)
return true; {
rb->queue_post(&thread_q, EV_EXIT, 0);
rb->thread_wait(thread_id);
/* remove the thread's queue from the broadcast list */
rb->queue_delete(&thread_q);
return true;
}
else return false;
} }
else return false;
} }
#define BIT_CHARGER 0x1 #define BIT_CHARGER 0x1

View file

@ -592,7 +592,7 @@ int WaitForButton(void)
do do
{ {
button = rb->button_get(true); button = rb->button_get(true);
} while (button & BUTTON_REL); } while (IS_SYSEVENT(button) || (button & BUTTON_REL));
return button; return button;
} }

View file

@ -230,7 +230,7 @@ int wait_for_button(void)
do do
{ {
button = rb->button_get(true); button = rb->button_get(true);
} while (button & BUTTON_REL); } while (IS_SYSEVENT(button) || (button & BUTTON_REL));
return button; return button;
} }

View file

@ -110,6 +110,7 @@ static int colorset[NUM_COLORSETS][3] = { { 255, 255, 255 } , /* white */
/* this is the plugin entry point */ /* this is the plugin entry point */
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
{ {
long button;
(void)parameter; (void)parameter;
rb = api; rb = api;
@ -167,7 +168,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->lcd_update(); rb->lcd_update();
switch(rb->button_get(true)) switch((button = rb->button_get(true)))
{ {
case LAMP_RIGHT: case LAMP_RIGHT:
#ifdef LAMP_NEXT #ifdef LAMP_NEXT
@ -196,9 +197,10 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
case (LAMP_PREV|BUTTON_REL): case (LAMP_PREV|BUTTON_REL):
#endif /* LAMP_PREV */ #endif /* LAMP_PREV */
/* eat these... */ /* eat these... */
break; break;
default: default:
quit = true; if (!IS_SYSEVENT(button))
quit = true;
} }
} while (!quit); } while (!quit);

View file

@ -516,7 +516,7 @@ static int WaitForButton(void)
do do
{ {
button = rb->button_get(true); button = rb->button_get(true);
} while (button & BUTTON_REL); } while (IS_SYSEVENT(button) || (button & BUTTON_REL));
return button; return button;
} }