diff options
-rw-r--r-- | apps/gui/wps.c | 5 | ||||
-rw-r--r-- | apps/lang/czech.lang | 100 | ||||
-rw-r--r-- | apps/lang/english.lang | 50 | ||||
-rw-r--r-- | apps/lang/italiano.lang | 100 | ||||
-rw-r--r-- | apps/lang/slovak.lang | 100 | ||||
-rw-r--r-- | apps/menu.c | 22 | ||||
-rw-r--r-- | apps/menu.h | 1 | ||||
-rw-r--r-- | apps/menus/playlist_menu.c | 2 | ||||
-rw-r--r-- | apps/menus/settings_menu.c | 45 | ||||
-rw-r--r-- | apps/onplay.c | 121 | ||||
-rw-r--r-- | apps/onplay.h | 12 | ||||
-rw-r--r-- | apps/root_menu.h | 1 | ||||
-rw-r--r-- | apps/settings.h | 2 | ||||
-rw-r--r-- | apps/settings_list.c | 49 | ||||
-rw-r--r-- | apps/tree.c | 5 | ||||
-rw-r--r-- | manual/appendix/config_file_options.tex | 6 | ||||
-rwxr-xr-x | manual/configure_rockbox/hotkey_settings.tex | 13 | ||||
-rw-r--r-- | manual/rockbox_interface/browsing_and_playing.tex | 10 | ||||
-rw-r--r-- | manual/rockbox_interface/hotkeys.tex | 32 | ||||
-rw-r--r-- | manual/rockbox_interface/wps.tex | 12 | ||||
-rw-r--r-- | manual/working_with_playlists/main.tex | 1 |
21 files changed, 129 insertions, 560 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 916ca2cbcf..96f66eeb50 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -886,8 +886,11 @@ long gui_wps_show(void) #endif switch(button) { - case ACTION_WPS_CONTEXT: case ACTION_WPS_HOTKEY: + if (!global_settings.hotkey_wps) + break; + /* fall through */ + case ACTION_WPS_CONTEXT: { bool hotkey = button == ACTION_WPS_HOTKEY; gwps_leave_wps(); diff --git a/apps/lang/czech.lang b/apps/lang/czech.lang index 05e2b75793..4f7253eecd 100644 --- a/apps/lang/czech.lang +++ b/apps/lang/czech.lang @@ -13321,57 +13321,6 @@ </voice> </phrase> <phrase> - id: LANG_SET_HOTKEY_QUESTION - desc: hotkey splash - user: core - <source> - *: none - hotkey: "Set Hotkey: %s?" - </source> - <dest> - *: none - hotkey: "Nastavit zkratkovou klávesu: %s?" - </dest> - <voice> - *: none - hotkey: "Nastavit zkratkovou klávesu?" - </voice> -</phrase> -<phrase> - id: LANG_HOTKEY_ASSIGNED - desc: Confirmation after the hotkey has been assigned - user: core - <source> - *: none - hotkey: "Assigned Hotkey: %s" - </source> - <dest> - *: none - hotkey: "Přiřazená zkratková klávesa: %s" - </dest> - <voice> - *: none - hotkey: "Přiřazená zkratková klávesa" - </voice> -</phrase> -<phrase> - id: LANG_HOTKEY_NOT_SET - desc: hotkey splash - user: core - <source> - *: none - hotkey: "Hotkey Not Set" - </source> - <dest> - *: none - hotkey: "Zkratková klávesa nenastavena" - </dest> - <voice> - *: none - hotkey: "Zkratková klávesa nenastavena" - </voice> -</phrase> -<phrase> id: LANG_HOTKEY desc: hotkey menu user: core @@ -13389,55 +13338,6 @@ </voice> </phrase> <phrase> - id: LANG_VIEW_HOTKEY - desc: hotkey menu - user: core - <source> - *: none - hotkey: "View Hotkey Settings" - </source> - <dest> - *: none - hotkey: "Zobrazit nastavení zkratkové klávesy" - </dest> - <voice> - *: none - hotkey: "Zobrazit nastavení zkratkové klávesy" - </voice> -</phrase> -<phrase> - id: LANG_HOTKEY_VIEW_WPS - desc: hotkey info menu - user: core - <source> - *: none - hotkey: "WPS: %s" - </source> - <dest> - *: none - hotkey: "Přehrávací obrazovka: %s" - </dest> - <voice> - *: none - </voice> -</phrase> -<phrase> - id: LANG_HOTKEY_VIEW_FILE_BROWSER - desc: hotkey info menu - user: core - <source> - *: none - hotkey: "Prohlížeč souborů: %s" - </source> - <dest> - *: none - hotkey: "Prohlížeč souborů: %s" - </dest> - <voice> - *: none - </voice> -</phrase> -<phrase> id: LANG_RESUME_REWIND desc: in playback settings menu user: core diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 64d28422c1..8303586551 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -13396,53 +13396,53 @@ </phrase> <phrase> id: LANG_SET_HOTKEY_QUESTION - desc: hotkey splash + desc: deprecated user: core <source> *: none - hotkey: "Set Hotkey: %s?" + hotkey: "" </source> <dest> *: none - hotkey: "Set Hotkey: %s?" + hotkey: "" </dest> <voice> *: none - hotkey: "Set Hotkey?" + hotkey: "" </voice> </phrase> <phrase> id: LANG_HOTKEY_ASSIGNED - desc: Confirmation after the hotkey has been assigned + desc: deprecated user: core <source> *: none - hotkey: "Assigned Hotkey: %s" + hotkey: "" </source> <dest> *: none - hotkey: "Assigned Hotkey: %s" + hotkey: "" </dest> <voice> *: none - hotkey: "Assigned Hotkey" + hotkey: "" </voice> </phrase> <phrase> id: LANG_HOTKEY_NOT_SET - desc: hotkey splash + desc: deprecated user: core <source> *: none - hotkey: "Hotkey Not Set" + hotkey: "" </source> <dest> *: none - hotkey: "Hotkey Not Set" + hotkey: "" </dest> <voice> *: none - hotkey: "Hotkey Not Set" + hotkey: "" </voice> </phrase> <phrase> @@ -13464,51 +13464,53 @@ </phrase> <phrase> id: LANG_VIEW_HOTKEY - desc: hotkey menu + desc: deprecated user: core <source> *: none - hotkey: "View Hotkey Settings" + hotkey: "" </source> <dest> *: none - hotkey: "View Hotkey Settings" + hotkey: "" </dest> <voice> *: none - hotkey: "View Hotkey Settings" + hotkey: "" </voice> </phrase> <phrase> - id: LANG_HOTKEY_VIEW_WPS - desc: hotkey info menu + id: LANG_HOTKEY_WPS + desc: hotkey menu user: core <source> *: none - hotkey: "WPS: %s" + hotkey: "WPS Hotkey" </source> <dest> *: none - hotkey: "WPS: %s" + hotkey: "WPS Hotkey" </dest> <voice> *: none + hotkey: "WPS Hotkey" </voice> </phrase> <phrase> - id: LANG_HOTKEY_VIEW_FILE_BROWSER - desc: hotkey info menu + id: LANG_HOTKEY_FILE_BROWSER + desc: hotkey menu user: core <source> *: none - hotkey: "File Browser: %s" + hotkey: "File Browser Hotkey" </source> <dest> *: none - hotkey: "File Browser: %s" + hotkey: "File Browser Hotkey" </dest> <voice> *: none + hotkey: "File Browser Hotkey" </voice> </phrase> <phrase> diff --git a/apps/lang/italiano.lang b/apps/lang/italiano.lang index d52b6aa13c..65f4e577a7 100644 --- a/apps/lang/italiano.lang +++ b/apps/lang/italiano.lang @@ -13320,57 +13320,6 @@ </voice> </phrase> <phrase> - id: LANG_SET_HOTKEY_QUESTION - desc: hotkey splash - user: core - <source> - *: none - hotkey: "Set Hotkey: %s?" - </source> - <dest> - *: none - hotkey: "Imposta Tasto Rapido: %s?" - </dest> - <voice> - *: none - hotkey: "Imposta Tasto Rapido?" - </voice> -</phrase> -<phrase> - id: LANG_HOTKEY_ASSIGNED - desc: Confirmation after the hotkey has been assigned - user: core - <source> - *: none - hotkey: "Assigned Hotkey: %s" - </source> - <dest> - *: none - hotkey: "Tasto Rapido Assegnato: %s" - </dest> - <voice> - *: none - hotkey: "Tasto Rapido Assegnato" - </voice> -</phrase> -<phrase> - id: LANG_HOTKEY_NOT_SET - desc: hotkey splash - user: core - <source> - *: none - hotkey: "Hotkey Not Set" - </source> - <dest> - *: none - hotkey: "Tasto Rapido Non Impostato" - </dest> - <voice> - *: none - hotkey: "Tasto Rapido Non Impostato" - </voice> -</phrase> -<phrase> id: LANG_HOTKEY desc: hotkey menu user: core @@ -13387,52 +13336,3 @@ hotkey: "Tasto Rapido" </voice> </phrase> -<phrase> - id: LANG_VIEW_HOTKEY - desc: hotkey menu - user: core - <source> - *: none - hotkey: "View Hotkey Settings" - </source> - <dest> - *: none - hotkey: "Visualizza Impostazioni Tasto Rapido" - </dest> - <voice> - *: none - hotkey: "Visualizza Impostazioni Tasto Rapido" - </voice> -</phrase> -<phrase> - id: LANG_HOTKEY_VIEW_WPS - desc: hotkey info menu - user: core - <source> - *: none - hotkey: "WPS: %s" - </source> - <dest> - *: none - hotkey: "WPS: %s" - </dest> - <voice> - *: none - </voice> -</phrase> -<phrase> - id: LANG_HOTKEY_VIEW_FILE_BROWSER - desc: hotkey info menu - user: core - <source> - *: none - hotkey: "File Browser: %s" - </source> - <dest> - *: none - hotkey: "Sfoglia File: %s" - </dest> - <voice> - *: none - </voice> -</phrase> diff --git a/apps/lang/slovak.lang b/apps/lang/slovak.lang index 6bfeef5c11..e2c17f405e 100644 --- a/apps/lang/slovak.lang +++ b/apps/lang/slovak.lang @@ -13319,40 +13319,6 @@ </voice> </phrase> <phrase> - id: LANG_VIEW_HOTKEY - desc: hotkey menu - user: core - <source> - *: none - hotkey: "View Hotkey Settings" - </source> - <dest> - *: none - hotkey: "Zobraziť Nastavenia Horúceho Klávesu" - </dest> - <voice> - *: none - hotkey: "Zobraziť nastavenia horúceho klávesu" - </voice> -</phrase> -<phrase> - id: LANG_HOTKEY_ASSIGNED - desc: Confirmation after the hotkey has been assigned - user: core - <source> - *: none - hotkey: "Assigned Hotkey: %s" - </source> - <dest> - *: none - hotkey: "Priradená Skratka: %s" - </dest> - <voice> - *: none - hotkey: "Priradená skratka" - </voice> -</phrase> -<phrase> id: LANG_HOTKEY desc: hotkey menu user: core @@ -13370,72 +13336,6 @@ </voice> </phrase> <phrase> - id: LANG_HOTKEY_NOT_SET - desc: hotkey splash - user: core - <source> - *: none - hotkey: "Hotkey Not Set" - </source> - <dest> - *: none - hotkey: "Skratka Nieje Nastavená" - </dest> - <voice> - *: none - hotkey: "Skratka nieje nastavená" - </voice> -</phrase> -<phrase> - id: LANG_SET_HOTKEY_QUESTION - desc: hotkey splash - user: core - <source> - *: none - hotkey: "Set Hotkey: %s?" - </source> - <dest> - *: none - hotkey: "Nastaviť skratku: %s?" - </dest> - <voice> - *: none - hotkey: "Nastaviť skratku?" - </voice> -</phrase> -<phrase> - id: LANG_HOTKEY_VIEW_FILE_BROWSER - desc: hotkey info menu - user: core - <source> - *: none - hotkey: "File Browser: %s" - </source> - <dest> - *: none - hotkey: "Prehliadač Súborov: %s" - </dest> - <voice> - *: none - </voice> -</phrase> -<phrase> - id: LANG_HOTKEY_VIEW_WPS - desc: hotkey info menu - user: core - <source> - *: none - hotkey: "WPS: %s" - </source> - <dest> - *: none - hotkey: "WPS: %s" - </dest> - <voice> - *: none - </voice> -</phrase> -<phrase> id: LANG_RESUME_REWIND desc: in playback settings menu user: core diff --git a/apps/menu.c b/apps/menu.c index bfad812803..670a235202 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -61,12 +61,6 @@ #include "list.h" #include "buttonbar.h" -/* hotkey settings */ -#ifdef HAVE_HOTKEY -const struct menu_item_ex *selected_menu_item; -bool hotkey_settable_menu = false; -#endif - #define MAX_MENUS 8 /* used to allow for dynamic menus */ #define MAX_MENU_SUBITEMS 64 @@ -432,22 +426,6 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, done = true; } #endif -#ifdef HAVE_HOTKEY - else if (hotkey_settable_menu && - ((action == ACTION_WPS_HOTKEY) || - (action == ACTION_TREE_HOTKEY))) - { - int this = get_menu_selection(gui_synclist_get_sel_pos(&lists),menu); - temp = menu->submenus[this]; - if (temp->flags&MENU_FUNC_HOTKEYABLE) - { - selected_menu_item = temp; - selected = this; - ret = MENU_SELECTED_HOTKEY; - done = true; - } - } -#endif else if (action == ACTION_TREE_WPS) { ret = GO_TO_PREVIOUS_MUSIC; diff --git a/apps/menu.h b/apps/menu.h index a7bd1c1a73..b5bab90981 100644 --- a/apps/menu.h +++ b/apps/menu.h @@ -61,7 +61,6 @@ struct menu_func { /* Flags for MT_FUNCTION_CALL */ #define MENU_FUNC_USEPARAM 0x80 #define MENU_FUNC_CHECK_RETVAL 0x100 -#define MENU_FUNC_HOTKEYABLE 0x200 #define MENU_COUNT_MASK 0xFFF #define MENU_COUNT_SHIFT 12 diff --git a/apps/menus/playlist_menu.c b/apps/menus/playlist_menu.c index 0d08a4f04f..2237761efd 100644 --- a/apps/menus/playlist_menu.c +++ b/apps/menus/playlist_menu.c @@ -68,7 +68,7 @@ static int playlist_view_(void) MENUITEM_FUNCTION(create_playlist_item, 0, ID2P(LANG_CREATE_PLAYLIST), (int(*)(void))create_playlist, NULL, NULL, Icon_NOICON); -MENUITEM_FUNCTION(view_cur_playlist, MENU_FUNC_CHECK_RETVAL | MENU_FUNC_HOTKEYABLE, +MENUITEM_FUNCTION(view_cur_playlist, MENU_FUNC_CHECK_RETVAL, ID2P(LANG_VIEW_DYNAMIC_PLAYLIST), (int(*)(void))playlist_view_, NULL, NULL, Icon_NOICON); MENUITEM_FUNCTION(save_playlist, MENU_FUNC_USEPARAM, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST), diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 1007d2aeb0..bcd49c942c 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c @@ -46,11 +46,6 @@ #ifdef HAVE_DIRCACHE #include "dircache.h" #endif -#ifdef HAVE_HOTKEY -#include "list.h" -#include "settings_list.h" -#include "onplay.h" -#endif /***********************************/ /* TAGCACHE MENU */ @@ -406,44 +401,10 @@ MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0, Icon_Voice, /***********************************/ /* HOTKEY MENU */ #ifdef HAVE_HOTKEY -static void view_hotkey_info(void) -{ - struct simplelist_info info; - simplelist_info_init(&info, str(LANG_VIEW_HOTKEY), 0, NULL); - info.hide_selection = true; - info.scroll_all = true; - simplelist_addline(SIMPLELIST_ADD_LINE, str(LANG_HOTKEY_VIEW_WPS), - get_hotkey_desc(global_settings.hotkey_wps)); - simplelist_addline(SIMPLELIST_ADD_LINE, str(LANG_HOTKEY_VIEW_FILE_BROWSER), - get_hotkey_desc(global_settings.hotkey_tree)); - simplelist_show_list(&info); -} - -/* reset hotkey settings to their defaults */ -static void reset_hotkey_settings(void) -{ - { - const struct settings_list *setting = - find_setting(&global_settings.hotkey_wps, NULL); - reset_setting(setting, setting->setting); - } - { - const struct settings_list *setting = - find_setting(&global_settings.hotkey_tree, NULL); - reset_setting(setting, setting->setting); - } - settings_save(); - splash(HZ, str(LANG_RESET_DONE_CLEAR)); -} - -MENUITEM_FUNCTION(hotkey_view, 0, ID2P(LANG_VIEW_HOTKEY), - (int(*)(void))view_hotkey_info, NULL, - NULL, Icon_NOICON); -MENUITEM_FUNCTION(hotkey_reset, 0, ID2P(LANG_RESET), - (int(*)(void))reset_hotkey_settings, NULL, - NULL, Icon_NOICON); +MENUITEM_SETTING(hotkey_wps_item, &global_settings.hotkey_wps, NULL); +MENUITEM_SETTING(hotkey_tree_item, &global_settings.hotkey_tree, NULL); MAKE_MENU(hotkey_menu, ID2P(LANG_HOTKEY), 0, Icon_NOICON, - &hotkey_view, &hotkey_reset); + &hotkey_wps_item, &hotkey_tree_item); #endif /*have_hotkey */ /* HOTKEY MENU */ /***********************************/ diff --git a/apps/onplay.c b/apps/onplay.c index 82a8bddae7..c9ec565a0c 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -270,8 +270,7 @@ static int treeplaylist_callback(int action, const struct menu_item_ex *this_item); /* insert items */ -MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM | MENU_FUNC_HOTKEYABLE, - ID2P(LANG_INSERT), +MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT), playlist_insert_func, (intptr_t*)PLAYLIST_INSERT, NULL, Icon_Playlist); MENUITEM_FUNCTION(i_first_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_FIRST), @@ -960,12 +959,10 @@ MENUITEM_FUNCTION(view_cue_item, 0, ID2P(LANG_BROWSE_CUESHEET), view_cue, NULL, view_cue_item_callback, Icon_NOICON); /* CONTEXT_WPS items */ -MENUITEM_FUNCTION(browse_id3_item, MENU_FUNC_HOTKEYABLE, - ID2P(LANG_MENU_SHOW_ID3_INFO), +MENUITEM_FUNCTION(browse_id3_item, 0, ID2P(LANG_MENU_SHOW_ID3_INFO), browse_id3, NULL, NULL, Icon_NOICON); #ifdef HAVE_PITCHSCREEN -MENUITEM_FUNCTION(pitch_screen_item, MENU_FUNC_HOTKEYABLE, - ID2P(LANG_PITCH), +MENUITEM_FUNCTION(pitch_screen_item, 0, ID2P(LANG_PITCH), gui_syncpitchscreen_run, NULL, NULL, Icon_Audio); #endif @@ -979,9 +976,9 @@ MENUITEM_FUNCTION(clipboard_copy_item, 0, ID2P(LANG_COPY), clipboard_copy, NULL, clipboard_callback, Icon_NOICON); MENUITEM_FUNCTION(clipboard_paste_item, 0, ID2P(LANG_PASTE), clipboard_paste, NULL, clipboard_callback, Icon_NOICON); -MENUITEM_FUNCTION(delete_file_item, MENU_FUNC_HOTKEYABLE, ID2P(LANG_DELETE), +MENUITEM_FUNCTION(delete_file_item, 0, ID2P(LANG_DELETE), delete_file_dir, NULL, clipboard_callback, Icon_NOICON); -MENUITEM_FUNCTION(delete_dir_item, MENU_FUNC_HOTKEYABLE, ID2P(LANG_DELETE_DIR), +MENUITEM_FUNCTION(delete_dir_item, 0, ID2P(LANG_DELETE_DIR), delete_file_dir, NULL, clipboard_callback, Icon_NOICON); MENUITEM_FUNCTION(create_dir_item, 0, ID2P(LANG_CREATE_DIR), create_dir, NULL, clipboard_callback, Icon_NOICON); @@ -1003,8 +1000,7 @@ static bool onplay_load_plugin(void *param) return false; } -MENUITEM_FUNCTION(list_viewers_item, MENU_FUNC_HOTKEYABLE, - ID2P(LANG_ONPLAY_OPEN_WITH), +MENUITEM_FUNCTION(list_viewers_item, 0, ID2P(LANG_ONPLAY_OPEN_WITH), list_viewers, NULL, clipboard_callback, Icon_NOICON); MENUITEM_FUNCTION(properties_item, MENU_FUNC_USEPARAM, ID2P(LANG_PROPERTIES), onplay_load_plugin, (void *)"properties", @@ -1199,75 +1195,61 @@ static bool open_with(void) return list_viewers(); } -extern const struct menu_item_ex *selected_menu_item; -extern bool hotkey_settable_menu; - #define HOTKEY_ACTION_MASK 0x0FF /* Mask to apply to get the action (enum) */ #define HOTKEY_CTX_WPS 0x100 /* Mask to apply to check whether it's for WPS */ #define HOTKEY_CTX_TREE 0x200 /* Mask to apply to check whether it's for the tree */ -/* Any desired hotkey functions go here... */ -enum hotkey_action { - HOTKEY_OFF = 0, - HOTKEY_VIEW_PLAYLIST = 1, - HOTKEY_SHOW_TRACK_INFO, - HOTKEY_PITCHSCREEN, - HOTKEY_OPEN_WITH, - HOTKEY_DELETE, - HOTKEY_INSERT, -}; - struct hotkey_assignment { int item; /* Bit or'd hotkey_action and HOTKEY_CTX_x */ struct menu_func func; /* Function to run if this entry is selected */ int return_code; /* What to return after the function is run */ - const struct menu_item_ex *menu_addr; /* Must have non-dynamic text, */ - /* i.e. have the flag MENU_HAS_DESC. E.g. be a MENUITEM_FUNCTION */ - /* For all possibilities see menu.h. */ + int lang_id; /* Language ID */ }; #define HOTKEY_FUNC(func, param) {{(void *)func}, param} -/* ... and here. Order is not important. */ +/* Any desired hotkey functions go here, in the enum in onplay.h, + and in the settings menu in settings_list.c. The order here + is not important. */ static struct hotkey_assignment hotkey_items[] = { { HOTKEY_VIEW_PLAYLIST | HOTKEY_CTX_WPS, HOTKEY_FUNC(NULL, NULL), - ONPLAY_PLAYLIST, &view_cur_playlist }, + ONPLAY_PLAYLIST, LANG_VIEW_DYNAMIC_PLAYLIST }, { HOTKEY_SHOW_TRACK_INFO| HOTKEY_CTX_WPS, HOTKEY_FUNC(browse_id3, NULL), - ONPLAY_RELOAD_DIR, &browse_id3_item }, + ONPLAY_RELOAD_DIR, LANG_MENU_SHOW_ID3_INFO }, #ifdef HAVE_PITCHSCREEN { HOTKEY_PITCHSCREEN | HOTKEY_CTX_WPS, HOTKEY_FUNC(gui_syncpitchscreen_run, NULL), - ONPLAY_RELOAD_DIR, &pitch_screen_item }, + ONPLAY_RELOAD_DIR, LANG_PITCH }, #endif { HOTKEY_OPEN_WITH | HOTKEY_CTX_WPS | HOTKEY_CTX_TREE, HOTKEY_FUNC(open_with, NULL), - ONPLAY_RELOAD_DIR, &list_viewers_item }, + ONPLAY_RELOAD_DIR, LANG_ONPLAY_OPEN_WITH }, { HOTKEY_DELETE | HOTKEY_CTX_WPS | HOTKEY_CTX_TREE, HOTKEY_FUNC(delete_item, NULL), - ONPLAY_RELOAD_DIR, &delete_file_item }, + ONPLAY_RELOAD_DIR, LANG_DELETE }, { HOTKEY_DELETE | HOTKEY_CTX_TREE, HOTKEY_FUNC(delete_item, NULL), - ONPLAY_RELOAD_DIR, &delete_dir_item }, + ONPLAY_RELOAD_DIR, LANG_DELETE }, { HOTKEY_INSERT | HOTKEY_CTX_TREE, HOTKEY_FUNC(playlist_insert_func, (intptr_t*)PLAYLIST_INSERT), - ONPLAY_START_PLAY, &i_pl_item }, + ONPLAY_START_PLAY, LANG_INSERT }, }; static const int num_hotkey_items = sizeof(hotkey_items) / sizeof(hotkey_items[0]); /* Return the language ID for the input function */ -const char* get_hotkey_desc(int hk_func) +int get_hotkey_lang_id(int hk_func) { int i; for (i = 0; i < num_hotkey_items; i++) { if ((hotkey_items[i].item & HOTKEY_ACTION_MASK) == hk_func) - return P2STR(hotkey_items[i].menu_addr->callback_and_desc->desc); + return hotkey_items[i].lang_id; } - return str(LANG_HOTKEY_NOT_SET); + return LANG_OFF; } /* Execute the hotkey function, if listed for this screen */ @@ -1300,60 +1282,9 @@ static int execute_hotkey(bool is_wps) } } - /* no valid hotkey set */ - splash(HZ, ID2P(LANG_HOTKEY_NOT_SET)); + /* no valid hotkey set, ignore hotkey */ return ONPLAY_RELOAD_DIR; } - -/* Set the hotkey to the current context menu function, if listed */ -static void set_hotkey(bool is_wps) -{ - int i; - struct hotkey_assignment *this_item; - const int context = is_wps ? HOTKEY_CTX_WPS : HOTKEY_CTX_TREE; - int *hk_func = is_wps ? &global_settings.hotkey_wps : - &global_settings.hotkey_tree; - int this_hk; - char *this_desc; - bool match_found = false; - - /* search assignment struct for a function that matches the current menu item */ - for (i = 0; i < num_hotkey_items; i++) - { - this_item = &hotkey_items[i]; - if ((this_item->item & context) && - (this_item->menu_addr == selected_menu_item)) - { - this_hk = this_item->item & HOTKEY_ACTION_MASK; - this_desc = P2STR((selected_menu_item->callback_and_desc)->desc); - match_found = true; - break; - } - } - - /* ignore the hotkey if no match found or no change to setting */ - if (!match_found || (this_hk == *hk_func)) return; - - char line1_buf[100], - line2_buf[100]; - char *line1 = line1_buf, - *line2 = line2_buf; - char **line1_ptr = &line1, - **line2_ptr = &line2; - const struct text_message message={(const char **)line1_ptr, 1}; - const struct text_message yes_message={(const char **)line2_ptr, 1}; - - snprintf(line1, sizeof(line1_buf), str(LANG_SET_HOTKEY_QUESTION), this_desc); - snprintf(line2, sizeof(line2_buf), str(LANG_HOTKEY_ASSIGNED), this_desc); - - /* confirm the hotkey setting change */ - if(gui_syncyesno_run(&message, &yes_message, NULL)==YESNO_YES) - { - /* store the hotkey settings */ - *hk_func = this_hk; - settings_save(); - } -} #endif /* HOTKEY */ int onplay(char* file, int attr, int from, bool hotkey) @@ -1367,7 +1298,6 @@ int onplay(char* file, int attr, int from, bool hotkey) #ifdef HAVE_HOTKEY if (hotkey) return execute_hotkey(context == CONTEXT_WPS); - hotkey_settable_menu = true; #else (void)hotkey; #endif @@ -1376,17 +1306,8 @@ int onplay(char* file, int attr, int from, bool hotkey) else menu = &tree_onplay_menu; menu_selection = do_menu(menu, NULL, NULL, false); -#ifdef HAVE_HOTKEY - hotkey_settable_menu = false; - switch (menu_selection) - { - case MENU_SELECTED_HOTKEY: - set_hotkey(context == CONTEXT_WPS); - return ONPLAY_RELOAD_DIR; -#else switch (menu_selection) { -#endif case GO_TO_WPS: return ONPLAY_START_PLAY; case GO_TO_ROOT: diff --git a/apps/onplay.h b/apps/onplay.h index 5a834d5ed1..161366ecc2 100644 --- a/apps/onplay.h +++ b/apps/onplay.h @@ -32,7 +32,17 @@ enum { }; #ifdef HAVE_HOTKEY -const char* get_hotkey_desc(int hk_func); +int get_hotkey_lang_id(int hk_func); + +enum hotkey_action { + HOTKEY_OFF = 0, + HOTKEY_VIEW_PLAYLIST, + HOTKEY_SHOW_TRACK_INFO, + HOTKEY_PITCHSCREEN, + HOTKEY_OPEN_WITH, + HOTKEY_DELETE, + HOTKEY_INSERT, +}; #endif #endif diff --git a/apps/root_menu.h b/apps/root_menu.h index d3ef817d5b..4113b64495 100644 --- a/apps/root_menu.h +++ b/apps/root_menu.h @@ -53,7 +53,6 @@ enum { GO_TO_BROWSEPLUGINS, GO_TO_TIMESCREEN, GO_TO_PLAYLIST_VIEWER, - MENU_SELECTED_HOTKEY, }; extern const struct menu_item_ex root_menu_; diff --git a/apps/settings.h b/apps/settings.h index fc44caae43..cfef6162a8 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -818,7 +818,7 @@ struct user_settings #ifdef HAVE_HOTKEY /* hotkey assignments - acceptable values are in - hotkey_settings enum in onplay.c */ + hotkey_action enum in onplay.h */ int hotkey_wps; int hotkey_tree; #endif diff --git a/apps/settings_list.c b/apps/settings_list.c index 34d4fc52e0..5a16f09763 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -56,6 +56,9 @@ #include "touchscreen.h" #include "ctype.h" /* For isspace() */ #endif +#ifdef HAVE_HOTKEY +#include "onplay.h" +#endif #define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT) /** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h @@ -529,6 +532,21 @@ static void tsc_set_default(void* setting, void* defaultval) memcpy(setting, defaultval, sizeof(struct touchscreen_parameter)); } #endif +#ifdef HAVE_HOTKEY +static const char* hotkey_formatter(char* buffer, size_t buffer_size, int value, + const char* unit) +{ + (void)buffer; + (void)buffer_size; + (void)unit; + return str(get_hotkey_lang_id(value)); +} +static int32_t hotkey_getlang(int value, int unit) +{ + (void)unit; + return get_hotkey_lang_id(value); +} +#endif /* HAVE_HOTKEY */ const struct settings_list settings[] = { /* sound settings */ SOUND_SETTING(F_NO_WRAP,volume, LANG_VOLUME, "volume", SOUND_VOLUME), @@ -1662,26 +1680,17 @@ const struct settings_list settings[] = { #endif #ifdef HAVE_HOTKEY - CHOICE_SETTING(0, hotkey_wps, -1, 1, "hotkey wps", - "off,view playlist,show track info,pitchscreen,open with,delete,insert", - NULL, 7, ID2P(LANG_OFF), - ID2P(LANG_VIEW_DYNAMIC_PLAYLIST), ID2P(LANG_MENU_SHOW_ID3_INFO), -#ifdef HAVE_PITCHSCREEN - ID2P(LANG_PITCH), -#else - NULL, -#endif - ID2P(LANG_ONPLAY_OPEN_WITH), ID2P(LANG_DELETE), ID2P(LANG_INSERT)), - CHOICE_SETTING(0, hotkey_tree, -1, 0, "hotkey tree", - "off,view playlist,show track info,pitchscreen,open with,delete,insert", - NULL, 7, ID2P(LANG_OFF), - ID2P(LANG_VIEW_DYNAMIC_PLAYLIST), ID2P(LANG_MENU_SHOW_ID3_INFO), -#ifdef HAVE_PITCHSCREEN - ID2P(LANG_PITCH), -#else - NULL, -#endif - ID2P(LANG_ONPLAY_OPEN_WITH), ID2P(LANG_DELETE), ID2P(LANG_INSERT)), + TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, hotkey_wps, + LANG_HOTKEY_WPS, HOTKEY_VIEW_PLAYLIST, "hotkey wps", + "off,view playlist,show track info,pitchscreen,open with,delete", + UNIT_INT, hotkey_formatter, hotkey_getlang, NULL, 6, HOTKEY_OFF, + HOTKEY_VIEW_PLAYLIST, HOTKEY_SHOW_TRACK_INFO, HOTKEY_PITCHSCREEN, + HOTKEY_OPEN_WITH, HOTKEY_DELETE), + TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, hotkey_tree, + LANG_HOTKEY_FILE_BROWSER, HOTKEY_OFF, "hotkey tree", + "off,open with,delete,insert", + UNIT_INT, hotkey_formatter, hotkey_getlang, NULL, 4, HOTKEY_OFF, + HOTKEY_OPEN_WITH, HOTKEY_DELETE, HOTKEY_INSERT), #endif #if CONFIG_CODEC == SWCODEC diff --git a/apps/tree.c b/apps/tree.c index 204ebb9ff5..dde4b57b8a 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -755,8 +755,11 @@ static int dirbrowse() break; #endif - case ACTION_STD_CONTEXT: case ACTION_TREE_HOTKEY: + if (!global_settings.hotkey_tree) + break; + /* fall through */ + case ACTION_STD_CONTEXT: { bool hotkey = button == ACTION_TREE_HOTKEY; int onplay_result; diff --git a/manual/appendix/config_file_options.tex b/manual/appendix/config_file_options.tex index 2c5136d3b8..0dd2f83568 100644 --- a/manual/appendix/config_file_options.tex +++ b/manual/appendix/config_file_options.tex @@ -123,6 +123,12 @@ talk filetype & off, on & N/A\\ talk menu & off, on & N/A\\ Announce Battery Level & off, on & N/A\\ + \opt{hotkey}{ + hotkey wps & off, view playlist, show track info, + pitchscreen, open with, delete & N/A\\ + hotkey tree & off, open with, delete, insert + & N/A\\ + } sort files & alpha, oldest, newest, type & N/A\\ sort dirs & alpha, oldest, newest & N/A\\ sort interpret number & digits, numbers & N/A\\ diff --git a/manual/configure_rockbox/hotkey_settings.tex b/manual/configure_rockbox/hotkey_settings.tex index eac606716f..b38d72471d 100755 --- a/manual/configure_rockbox/hotkey_settings.tex +++ b/manual/configure_rockbox/hotkey_settings.tex @@ -3,14 +3,11 @@ \section{\label{ref:HotkeySettings}Hotkey} \begin{description} - \item[View Hotkey Settings.] - This option brings up a screen listing the current assignment associated - with each hotkey. - - \item[Reset Settings.] - This option sets all hotkeys to their default assignments. The default - for the WPS screen is View Playlist. The File Browser hotkey has no - default assignment. + \item[WPS Hotkey.] + \item[File Browser Hotkey.] + These options set the hotkey function for their respective screens + (see \reference{ref:Hotkeys}). The default for the WPS screen is + \setting{View Playlist}. The File Browser default is \setting{Off}. \end{description} diff --git a/manual/rockbox_interface/browsing_and_playing.tex b/manual/rockbox_interface/browsing_and_playing.tex index e7bbc5c585..c087036a6b 100644 --- a/manual/rockbox_interface/browsing_and_playing.tex +++ b/manual/rockbox_interface/browsing_and_playing.tex @@ -137,11 +137,6 @@ or directory and access the context menu with \ActionStdContext{}.\\ for files. If the \setting{Context Menu} is invoked on a directory, it will display options for directories.\\} -\opt{hotkey}{ -Some of these options can be set to the \setting{Hotkey} (see \reference{ref:Hotkeys}) -for that context by pressing \ActionWpsHotkey.\\ -} - The \setting{Context Menu} contains the following options (unless otherwise noted, each option pertains both to files and directories): @@ -167,11 +162,10 @@ each option pertains both to files and directories): not to directories. Rockbox will ask for confirmation before deleting a file. Press \ActionYesNoAccept{} to confirm deletion or any other key to cancel. - \opt{hotkey}{\setting{Hotkey}able (see \reference{ref:Hotkeys}).} \item [Delete Directory.] Deletes the currently selected directory and all of the files and subdirectories it may contain. Deleted directories cannot be recovered. Use this feature with - caution! \opt{hotkey}{\setting{Hotkey}able (see \reference{ref:Hotkeys}).} + caution! \opt{lcd_non-mono}{ \item [Set As Backdrop.] Set the selected \fname{bmp} file as background image. The bitmaps need to meet the @@ -185,7 +179,7 @@ each option pertains both to files and directories): For example, this function can be used to view a text file even if the file has a non-standard extension (i.e., the file has an extension of something other than \fname{.txt}). See \reference{ref:Viewersplugins} - for more details on viewers. \opt{hotkey}{\setting{Hotkey}able (see \reference{ref:Hotkeys}).} + for more details on viewers. \item [Create Directory.] Create a new directory in the current directory on the disk. \item [Properties.] diff --git a/manual/rockbox_interface/hotkeys.tex b/manual/rockbox_interface/hotkeys.tex index b1d1f23f0d..56dafa9589 100644 --- a/manual/rockbox_interface/hotkeys.tex +++ b/manual/rockbox_interface/hotkeys.tex @@ -1,26 +1,18 @@ % $Id$ % \opt{hotkey}{ \section{\label{ref:Hotkeys}Hotkeys} - Hotkeys are user-assignable shortcut keys to functions within the - \setting{File Browser} and \setting{WPS} context menus. To use one, - press \ActionWpsHotkey{} within the \setting{File Browser} or - \setting{WPS} screens. The assigned function will launch with - reference to the current file or directory, if applicable. Each - screen has its own assignment. If there is no assignment for - a given screen, the message ``No Hotkey Set'' appears briefly. + Hotkeys are shortcut keys for use in the \setting{File Browser} + and \setting{WPS} screens. To use one, press \ActionWpsHotkey{} + within the \setting{File Browser} or \setting{WPS} screens. + The assigned function will launch with reference to the current + file or directory, if applicable. Each screen has its own + assignment. If there is no assignment for a given screen, + the hotkey is ignored. - There is no default assignment for the File Browser hotkey, but the WPS - hotkey defaults to ``View Playlist''. + The default assignment for the File Browser hotkey is + \setting{Off}, but the WPS hotkey defaults to + \setting{View Playlist}. - To change the assignment of a hotkey, go into the associated - context menu from the File Browser or WPS screen by pressing - \ActionWpsContext, then highlighting the function you wish to assign. - Press the hotkey (\ActionWpsHotkey) and if the function you've chosen - is assignable a confirmation dialog screen will appear. Press - \ActionYesNoAccept{} to confirm the assignment or anything else to reject - it. If accepted, you'll see a short message confirming your choice. - - You can view the current assignments and reset to the default assignments - from the Hotkey menu under \setting{General Settings}. See - \reference{ref:HotkeySettings} for details. + The hotkey assignments are changed in the Hotkey menu (see + \reference{ref:HotkeySettings}) under \setting{General Settings}. } diff --git a/manual/rockbox_interface/wps.tex b/manual/rockbox_interface/wps.tex index 4f4e5cc626..824370b0ab 100644 --- a/manual/rockbox_interface/wps.tex +++ b/manual/rockbox_interface/wps.tex @@ -209,9 +209,7 @@ your WPS (While Playing Screen). } \subsection{\label{sec:contextmenu}The WPS Context Menu} Like the context menu for the \setting{File Browser}, the \setting{WPS Context Menu} -allows you quick access to some often used functions. \opt{hotkey}{ -Some of these options can be set to the \setting{Hotkey} (see \reference{ref:Hotkeys}) -for that context by pressing \ActionWpsHotkey.} +allows you quick access to some often used functions. \subsubsection{Playlist} The \setting{Playlist} submenu allows you to view, save, search and @@ -268,8 +266,7 @@ This allows you to create a bookmark in the currently-playing track. This screen is accessible from the WPS screen, and provides a detailed view of all the identity information about the current track. This info is known as meta data and is stored in audio file formats to keep information on artist, -album etc. \opt{hotkey}{\setting{Hotkey}able from the \setting{WPS Context -Menu} (see \reference{ref:Hotkeys}).} To access this screen, % +album etc. To access this screen, % \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IRIVER_H10_PAD,% SANSA_C200_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{ press \ActionWpsIdThreeScreen. }% @@ -283,20 +280,19 @@ Menu} (see \reference{ref:Hotkeys}).} To access this screen, % \subsubsection{Open With...} This \setting{Open With} function is the same as the \setting{Open With} function in the file browser's \setting{Context Menu}. -\opt{hotkey}{\setting{Hotkey}able (see \reference{ref:Hotkeys}).} \subsubsection{Delete} Delete the currently playing file. The file will be deleted but the playback of the file will not stop immediately. Instead, the part of the file that has already been buffered (i.e. read into the \daps\ memory) will be played. -This may even be the whole track. \opt{hotkey}{\setting{Hotkey}able (see \reference{ref:Hotkeys}).} +This may even be the whole track. \opt{pitchscreen}{ \subsubsection{\label{sec:pitchscreen}Pitch} The \setting{Pitch Screen} allows you to change the rate of playback (i.e. the playback speed and at the same time the pitch) of your - \dap. \opt{hotkey}{\setting{Hotkey}able (see \reference{ref:Hotkeys}).} The rate value can be adjusted + \dap. The rate value can be adjusted between 50\% and 200\%. 50\% means half the normal playback speed and a pitch that is an octave lower than the normal pitch. 200\% means double playback speed and a pitch that is an octave higher than the normal pitch. diff --git a/manual/working_with_playlists/main.tex b/manual/working_with_playlists/main.tex index a45eb47b96..311aa86071 100644 --- a/manual/working_with_playlists/main.tex +++ b/manual/working_with_playlists/main.tex @@ -93,7 +93,6 @@ options: \setting{Insert}, new tracks will be added immediately after the current playing track. If playback is stopped a new dynamic playlist will get created with the selected tracks. - \opt{hotkey}{\setting{Hotkey}able (see \reference{ref:Hotkeys}).} \item [Insert Next.] Add track(s) immediately after current playing track, no matter what else has been inserted. |