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/alarm_menu.c | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'apps/alarm_menu.c') diff --git a/apps/alarm_menu.c b/apps/alarm_menu.c index ae5d5bb752..03234352d7 100644 --- a/apps/alarm_menu.c +++ b/apps/alarm_menu.c @@ -25,7 +25,7 @@ #include "options.h" #include "lcd.h" -#include "button.h" +#include "action.h" #include "kernel.h" #include "sprintf.h" #include @@ -56,6 +56,7 @@ bool alarm_screen(void) int button; int i; bool update = true; + rtc_get_alarm(&h, &m); @@ -84,10 +85,10 @@ bool alarm_screen(void) screens[i].puts(0, 1, buf); gui_textarea_update(&screens[i]); } - button = button_get_w_tmo(HZ); + button = get_action(CONTEXT_SETTINGS,HZ); switch(button) { - case BUTTON_PLAY: + case ACTION_STD_OK: /* prevent that an alarm occurs in the shutdown procedure */ /* accept alarms only if they are in 2 minutes or more */ tm = get_time(); @@ -106,8 +107,8 @@ bool alarm_screen(void) break; /* inc(m) */ - case BUTTON_RIGHT: - case BUTTON_RIGHT | BUTTON_REPEAT: + case ACTION_SETTINGS_INC: + case ACTION_SETTINGS_INCREPEAT: m += 5; if (m == 60) { h += 1; @@ -118,8 +119,8 @@ bool alarm_screen(void) break; /* dec(m) */ - case BUTTON_LEFT: - case BUTTON_LEFT | BUTTON_REPEAT: + case ACTION_SETTINGS_DEC: + case ACTION_SETTINGS_DECREPEAT: m -= 5; if (m == -5) { h -= 1; @@ -129,32 +130,25 @@ bool alarm_screen(void) h = 23; break; -#if CONFIG_KEYPAD == RECORDER_PAD /* inc(h) */ - case BUTTON_UP: - case BUTTON_UP | BUTTON_REPEAT: + case ACTION_STD_NEXT: + case ACTION_STD_NEXTREPEAT: h = (h+1) % 24; break; /* dec(h) */ - case BUTTON_DOWN: - case BUTTON_DOWN | BUTTON_REPEAT: + case ACTION_STD_PREV: + case ACTION_STD_NEXTREPEAT: h = (h+23) % 24; break; -#endif - -#if CONFIG_KEYPAD == RECORDER_PAD - case BUTTON_OFF: -#else - case BUTTON_STOP: - case BUTTON_MENU: -#endif + + case ACTION_STD_CANCEL: rtc_enable_alarm(false); gui_syncsplash(HZ*2, true, str(LANG_ALARM_MOD_DISABLE)); done = true; break; - case BUTTON_NONE: + case ACTION_NONE: gui_syncstatusbar_draw(&statusbars, false); break; @@ -167,7 +161,7 @@ bool alarm_screen(void) break; } } - + action_signalscreenchange(); return false; } -- cgit v1.2.3