diff options
Diffstat (limited to 'apps/menus')
-rw-r--r-- | apps/menus/settings_menu.c | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index b695d9265b..8a83a3b240 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c | |||
@@ -47,6 +47,10 @@ | |||
47 | #ifdef HAVE_DIRCACHE | 47 | #ifdef HAVE_DIRCACHE |
48 | #include "dircache.h" | 48 | #include "dircache.h" |
49 | #endif | 49 | #endif |
50 | #ifdef HAVE_HOTKEY | ||
51 | #include "list.h" | ||
52 | #include "settings_list.h" | ||
53 | #endif | ||
50 | 54 | ||
51 | /***********************************/ | 55 | /***********************************/ |
52 | /* TAGCACHE MENU */ | 56 | /* TAGCACHE MENU */ |
@@ -400,6 +404,58 @@ MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0, Icon_Voice, | |||
400 | 404 | ||
401 | 405 | ||
402 | /***********************************/ | 406 | /***********************************/ |
407 | /* HOTKEY MENU */ | ||
408 | #ifdef HAVE_HOTKEY | ||
409 | static void view_hotkey_info(void) | ||
410 | { | ||
411 | struct simplelist_info info; | ||
412 | simplelist_info_init(&info, str(LANG_VIEW_HOTKEY), 0, NULL); | ||
413 | info.hide_selection = true; | ||
414 | simplelist_set_line_count(2); | ||
415 | simplelist_addline(0, "WPS: %s", | ||
416 | str(global_settings.hotkey_wps_desc_id)); | ||
417 | simplelist_addline(1, "Tree: %s", | ||
418 | str(global_settings.hotkey_tree_desc_id)); | ||
419 | simplelist_show_list(&info); | ||
420 | } | ||
421 | |||
422 | /* reset hotkey settings to their defaults */ | ||
423 | static void reset_hotkey_settings(void) | ||
424 | { | ||
425 | void *vars[] = { | ||
426 | &global_settings.hotkey_tree, | ||
427 | &global_settings.hotkey_tree_desc_id, | ||
428 | &global_settings.hotkey_wps, | ||
429 | &global_settings.hotkey_wps_desc_id, | ||
430 | }; | ||
431 | const int num_settings = sizeof(vars) / sizeof(vars[0]); | ||
432 | int i; | ||
433 | |||
434 | for (i = 0; i < num_settings; i++) | ||
435 | { | ||
436 | const struct settings_list *setting = | ||
437 | find_setting(vars[i], NULL); | ||
438 | reset_setting(setting, setting->setting); | ||
439 | } | ||
440 | |||
441 | settings_save(); | ||
442 | splash(HZ, str(LANG_RESET_DONE_CLEAR)); | ||
443 | } | ||
444 | |||
445 | MENUITEM_FUNCTION(hotkey_view, 0, ID2P(LANG_VIEW_HOTKEY), | ||
446 | (int(*)(void))view_hotkey_info, NULL, | ||
447 | NULL, Icon_NOICON); | ||
448 | MENUITEM_FUNCTION(hotkey_reset, 0, ID2P(LANG_RESET), | ||
449 | (int(*)(void))reset_hotkey_settings, NULL, | ||
450 | NULL, Icon_NOICON); | ||
451 | MAKE_MENU(hotkey_menu, ID2P(LANG_HOTKEY), 0, Icon_NOICON, | ||
452 | &hotkey_view, &hotkey_reset); | ||
453 | #endif /*have_hotkey */ | ||
454 | /* HOTKEY MENU */ | ||
455 | /***********************************/ | ||
456 | |||
457 | |||
458 | /***********************************/ | ||
403 | /* SETTINGS MENU */ | 459 | /* SETTINGS MENU */ |
404 | static int language_browse(void) | 460 | static int language_browse(void) |
405 | { | 461 | { |
@@ -415,7 +471,10 @@ MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0, | |||
415 | &tagcache_menu, | 471 | &tagcache_menu, |
416 | #endif | 472 | #endif |
417 | &display_menu, &system_menu, | 473 | &display_menu, &system_menu, |
418 | &bookmark_settings_menu, &browse_langs, &voice_settings_menu | 474 | &bookmark_settings_menu, &browse_langs, &voice_settings_menu, |
475 | #ifdef HAVE_HOTKEY | ||
476 | &hotkey_menu, | ||
477 | #endif | ||
419 | ); | 478 | ); |
420 | /* SETTINGS MENU */ | 479 | /* SETTINGS MENU */ |
421 | /***********************************/ | 480 | /***********************************/ |