diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-11-04 12:40:18 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-11-04 12:40:18 +0000 |
| commit | a6f2b82803d5b48f1c16e630d14883ec0a474dbe (patch) | |
| tree | 318b3322b025fd252502676ae6062681e558fd03 | |
| parent | 62decc42e7f6752d786090277ac4b7f2d2036ad4 (diff) | |
| download | rockbox-a6f2b82803d5b48f1c16e630d14883ec0a474dbe.zip rockbox-a6f2b82803d5b48f1c16e630d14883ec0a474dbe.tar.gz rockbox-a6f2b82803d5b48f1c16e630d14883ec0a474dbe.tar.bz2 rockbox-a6f2b82803d5b48f1c16e630d14883ec0a474dbe.tar.xz | |
revert my previous commit and do it in a much less hacky way (both of these were for FS#8084)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15458 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/gui/gwps.c | 6 | ||||
| -rw-r--r-- | apps/menu.c | 11 | ||||
| -rw-r--r-- | apps/onplay.c | 32 |
3 files changed, 24 insertions, 25 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 1e5720e..b7707cd 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -241,8 +241,10 @@ long gui_wps_show(void) #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 show_remote_main_backdrop(); #endif - if (onplay(wps_state.id3->path, FILE_ATTR_AUDIO, CONTEXT_WPS) - == ONPLAY_MAINMENU) + /* if music is stopped in the context menu we want to exit the wps */ + if (onplay(wps_state.id3->path, + FILE_ATTR_AUDIO, CONTEXT_WPS) == ONPLAY_MAINMENU + || !audio_status()) return GO_TO_ROOT; #if LCD_DEPTH > 1 show_wps_backdrop(); diff --git a/apps/menu.c b/apps/menu.c index f9a2f3c..8e96cc4 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -291,11 +291,6 @@ bool do_setting_from_menu(const struct menu_item_ex *temp) return false; } -/* HACK ALERT: this is needed so pressing stop in the wps context menu returns to - the main menu as it is expected. otherwise there can be nasty side-effects - if any of the items are selected. */ -extern const struct menu_item_ex wps_onplay_menu; - /* display a menu */ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) { @@ -375,12 +370,6 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) else if (action == ACTION_TREE_STOP) { redraw_lists = list_stop_handler(); - /*return to the main menu if stop is pressed in the WPS context menu */ - if (menu == &wps_onplay_menu) - { - ret = GO_TO_ROOT; - done = true; - } } else if (action == ACTION_STD_CONTEXT && menu == &root_menu_) diff --git a/apps/onplay.c b/apps/onplay.c index d4c5579..cd93afb 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -81,7 +81,7 @@ static bool clipboard_is_copy = false; #define MAKE_ONPLAYMENU( name, str, callback, icon, ... ) \ static const struct menu_item_ex *name##_[] = {__VA_ARGS__}; \ static const struct menu_callback_with_desc name##__ = {callback,str,icon};\ - const struct menu_item_ex name = \ + static const struct menu_item_ex name = \ {MT_MENU|MENU_HAS_DESC|MENU_EXITAFTERTHISMENU| \ MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)), \ { (void*)name##_},{.callback_and_desc = & name##__}}; @@ -949,17 +949,7 @@ static bool clipboard_paste(void) return true; } -static int onplaymenu_callback(int action,const struct menu_item_ex *this_item) -{ - (void)this_item; - switch (action) - { - case ACTION_EXIT_MENUITEM: - return ACTION_EXIT_AFTER_THIS_MENUITEM; - break; - } - return action; -} +static int onplaymenu_callback(int action,const struct menu_item_ex *this_item); #ifdef HAVE_TAGCACHE char *rating_name(int selected_item, void * data, char *buffer) { @@ -1191,6 +1181,24 @@ MAKE_ONPLAYMENU( tree_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE), #endif &add_to_faves_item, ); +static int onplaymenu_callback(int action,const struct menu_item_ex *this_item) +{ + (void)this_item; + switch (action) + { + case ACTION_TREE_STOP: + if (this_item == &wps_onplay_menu) + { + list_stop_handler(); + return ACTION_STD_CANCEL; + } + break; + case ACTION_EXIT_MENUITEM: + return ACTION_EXIT_AFTER_THIS_MENUITEM; + break; + } + return action; +} int onplay(char* file, int attr, int from) { int menu_result; |