diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-12-02 00:03:34 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-12-02 00:03:34 +0000 |
| commit | 6c65b357bca384a3d65a6795edc2928b889254ee (patch) | |
| tree | 0f1ad1031bb5ef511dae461c72f92b0303bbf0ee /apps | |
| parent | cee8f0178eafc8441ec1da9b1644eb8331863a5b (diff) | |
| download | rockbox-6c65b357bca384a3d65a6795edc2928b889254ee.zip rockbox-6c65b357bca384a3d65a6795edc2928b889254ee.tar.gz rockbox-6c65b357bca384a3d65a6795edc2928b889254ee.tar.bz2 rockbox-6c65b357bca384a3d65a6795edc2928b889254ee.tar.xz | |
fix FS#9569 - exiting the time&date screen goes to the wrong screen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19295 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/menus/time_menu.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c index 8e75a15..cb1a93c 100644 --- a/apps/menus/time_menu.c +++ b/apps/menus/time_menu.c @@ -208,7 +208,8 @@ static void draw_timedate(struct viewport *vp, struct screen *display) display->update_viewport(); } -struct viewport clock[NB_SCREENS], menu[NB_SCREENS]; +static struct viewport clock[NB_SCREENS], menu[NB_SCREENS]; +static bool menu_was_pressed; static int time_menu_callback(int action, const struct menu_item_ex *this_item) { @@ -228,6 +229,12 @@ static int time_menu_callback(int action, talk_timedate(); action = ACTION_NONE; break; + /* need to tell do_menu() to return, but then get time_screen() + to return 0! ACTION_STD_MENU will return GO_TO_PREVIOUS from here + so check do_menu()'s return val and menu_was_pressed */ + case ACTION_STD_MENU: + menu_was_pressed = true; + break; } if (redraw) { @@ -252,7 +259,8 @@ MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), time_menu_callback, Icon_NOICON, int time_screen(void* ignored) { (void)ignored; - int i, nb_lines, font_h; + int i, nb_lines, font_h, ret; + menu_was_pressed = false; FOR_NB_SCREENS(i) { @@ -291,5 +299,9 @@ int time_screen(void* ignored) draw_timedate(&clock[i], &screens[i]); screens[i].update(); } - return do_menu(&time_menu, NULL, menu, false); + ret = do_menu(&time_menu, NULL, menu, false); + /* see comments above in the button callback */ + if (!menu_was_pressed && ret == GO_TO_PREVIOUS) + return 0; + return ret; } |