diff options
Diffstat (limited to 'apps/alarm_menu.c')
-rw-r--r-- | apps/alarm_menu.c | 38 |
1 files changed, 16 insertions, 22 deletions
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 @@ | |||
25 | #include "options.h" | 25 | #include "options.h" |
26 | 26 | ||
27 | #include "lcd.h" | 27 | #include "lcd.h" |
28 | #include "button.h" | 28 | #include "action.h" |
29 | #include "kernel.h" | 29 | #include "kernel.h" |
30 | #include "sprintf.h" | 30 | #include "sprintf.h" |
31 | #include <string.h> | 31 | #include <string.h> |
@@ -56,6 +56,7 @@ bool alarm_screen(void) | |||
56 | int button; | 56 | int button; |
57 | int i; | 57 | int i; |
58 | bool update = true; | 58 | bool update = true; |
59 | |||
59 | 60 | ||
60 | rtc_get_alarm(&h, &m); | 61 | rtc_get_alarm(&h, &m); |
61 | 62 | ||
@@ -84,10 +85,10 @@ bool alarm_screen(void) | |||
84 | screens[i].puts(0, 1, buf); | 85 | screens[i].puts(0, 1, buf); |
85 | gui_textarea_update(&screens[i]); | 86 | gui_textarea_update(&screens[i]); |
86 | } | 87 | } |
87 | button = button_get_w_tmo(HZ); | 88 | button = get_action(CONTEXT_SETTINGS,HZ); |
88 | 89 | ||
89 | switch(button) { | 90 | switch(button) { |
90 | case BUTTON_PLAY: | 91 | case ACTION_STD_OK: |
91 | /* prevent that an alarm occurs in the shutdown procedure */ | 92 | /* prevent that an alarm occurs in the shutdown procedure */ |
92 | /* accept alarms only if they are in 2 minutes or more */ | 93 | /* accept alarms only if they are in 2 minutes or more */ |
93 | tm = get_time(); | 94 | tm = get_time(); |
@@ -106,8 +107,8 @@ bool alarm_screen(void) | |||
106 | break; | 107 | break; |
107 | 108 | ||
108 | /* inc(m) */ | 109 | /* inc(m) */ |
109 | case BUTTON_RIGHT: | 110 | case ACTION_SETTINGS_INC: |
110 | case BUTTON_RIGHT | BUTTON_REPEAT: | 111 | case ACTION_SETTINGS_INCREPEAT: |
111 | m += 5; | 112 | m += 5; |
112 | if (m == 60) { | 113 | if (m == 60) { |
113 | h += 1; | 114 | h += 1; |
@@ -118,8 +119,8 @@ bool alarm_screen(void) | |||
118 | break; | 119 | break; |
119 | 120 | ||
120 | /* dec(m) */ | 121 | /* dec(m) */ |
121 | case BUTTON_LEFT: | 122 | case ACTION_SETTINGS_DEC: |
122 | case BUTTON_LEFT | BUTTON_REPEAT: | 123 | case ACTION_SETTINGS_DECREPEAT: |
123 | m -= 5; | 124 | m -= 5; |
124 | if (m == -5) { | 125 | if (m == -5) { |
125 | h -= 1; | 126 | h -= 1; |
@@ -129,32 +130,25 @@ bool alarm_screen(void) | |||
129 | h = 23; | 130 | h = 23; |
130 | break; | 131 | break; |
131 | 132 | ||
132 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
133 | /* inc(h) */ | 133 | /* inc(h) */ |
134 | case BUTTON_UP: | 134 | case ACTION_STD_NEXT: |
135 | case BUTTON_UP | BUTTON_REPEAT: | 135 | case ACTION_STD_NEXTREPEAT: |
136 | h = (h+1) % 24; | 136 | h = (h+1) % 24; |
137 | break; | 137 | break; |
138 | 138 | ||
139 | /* dec(h) */ | 139 | /* dec(h) */ |
140 | case BUTTON_DOWN: | 140 | case ACTION_STD_PREV: |
141 | case BUTTON_DOWN | BUTTON_REPEAT: | 141 | case ACTION_STD_NEXTREPEAT: |
142 | h = (h+23) % 24; | 142 | h = (h+23) % 24; |
143 | break; | 143 | break; |
144 | #endif | 144 | |
145 | 145 | case ACTION_STD_CANCEL: | |
146 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
147 | case BUTTON_OFF: | ||
148 | #else | ||
149 | case BUTTON_STOP: | ||
150 | case BUTTON_MENU: | ||
151 | #endif | ||
152 | rtc_enable_alarm(false); | 146 | rtc_enable_alarm(false); |
153 | gui_syncsplash(HZ*2, true, str(LANG_ALARM_MOD_DISABLE)); | 147 | gui_syncsplash(HZ*2, true, str(LANG_ALARM_MOD_DISABLE)); |
154 | done = true; | 148 | done = true; |
155 | break; | 149 | break; |
156 | 150 | ||
157 | case BUTTON_NONE: | 151 | case ACTION_NONE: |
158 | gui_syncstatusbar_draw(&statusbars, false); | 152 | gui_syncstatusbar_draw(&statusbars, false); |
159 | break; | 153 | break; |
160 | 154 | ||
@@ -167,7 +161,7 @@ bool alarm_screen(void) | |||
167 | break; | 161 | break; |
168 | } | 162 | } |
169 | } | 163 | } |
170 | 164 | action_signalscreenchange(); | |
171 | return false; | 165 | return false; |
172 | } | 166 | } |
173 | 167 | ||