From 224c0a13ebb5828b9bc06a9c1c23ae17f0ac19f9 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 15 Aug 2006 12:27:07 +0000 Subject: Finally, the new button action system is here, thanks to Jonathan Gordon. Some button mappings have changed and other things may break. Comments should go to the forum, http://forums.rockbox.org/index.php?topic=5829.0 or the mailing list. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10582 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/yesno.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'apps/gui/yesno.c') diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c index 225f6d3f43..d567cf9ed4 100644 --- a/apps/gui/yesno.c +++ b/apps/gui/yesno.c @@ -3,6 +3,7 @@ #include "kernel.h" #include "misc.h" #include "lang.h" +#include "action.h" void gui_yesno_init(struct gui_yesno * yn, struct text_message * main_message, @@ -54,7 +55,7 @@ bool gui_yesno_draw_result(struct gui_yesno * yn, enum yesno_res result) gui_textarea_put_message(yn->display, message, 0); return(true); } - +#include "debug.h" enum yesno_res gui_syncyesno_run(struct text_message * main_message, struct text_message * yes_message, struct text_message * no_message) @@ -72,23 +73,21 @@ enum yesno_res gui_syncyesno_run(struct text_message * main_message, } while (result==-1) { - button = button_get(true); + button = get_action(CONTEXT_YESNOSCREEN,TIMEOUT_BLOCK); + DEBUGF("button=%x\n",button); switch (button) { - case YESNO_OK: -#ifdef YESNO_RC_OK - case YESNO_RC_OK: -#endif + case ACTION_YESNO_ACCEPT: result=YESNO_YES; break; default: if(default_event_handler(button) == SYS_USB_CONNECTED) return(YESNO_USB); - if(!(button & BUTTON_REL)) - result=YESNO_NO; + result = YESNO_NO; } } + action_signalscreenchange(); FOR_NB_SCREENS(i) result_displayed=gui_yesno_draw_result(&(yn[i]), result); if(result_displayed) -- cgit v1.2.3