diff options
author | Jeffrey Goode <jeffg7@gmail.com> | 2010-05-09 02:02:51 +0000 |
---|---|---|
committer | Jeffrey Goode <jeffg7@gmail.com> | 2010-05-09 02:02:51 +0000 |
commit | 1ad76ff25be3f86b9467fc6f4171dbf6895b419c (patch) | |
tree | e679a66806c1a89343a29324dd2a6bc860d4a86d /apps | |
parent | 8d3553489f1dd44b9dd3b7493489e9ec03f387be (diff) | |
download | rockbox-1ad76ff25be3f86b9467fc6f4171dbf6895b419c.tar.gz rockbox-1ad76ff25be3f86b9467fc6f4171dbf6895b419c.zip |
FS#11250: Hotkey setting method changed to menu item vs button pres in context menu. Manuals updated to match.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25905 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-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 |
15 files changed, 100 insertions, 515 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) | |||
886 | #endif | 886 | #endif |
887 | switch(button) | 887 | switch(button) |
888 | { | 888 | { |
889 | case ACTION_WPS_CONTEXT: | ||
890 | case ACTION_WPS_HOTKEY: | 889 | case ACTION_WPS_HOTKEY: |
890 | if (!global_settings.hotkey_wps) | ||
891 | break; | ||
892 | /* fall through */ | ||
893 | case ACTION_WPS_CONTEXT: | ||
891 | { | 894 | { |
892 | bool hotkey = button == ACTION_WPS_HOTKEY; | 895 | bool hotkey = button == ACTION_WPS_HOTKEY; |
893 | gwps_leave_wps(); | 896 | 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 @@ | |||
13321 | </voice> | 13321 | </voice> |
13322 | </phrase> | 13322 | </phrase> |
13323 | <phrase> | 13323 | <phrase> |
13324 | id: LANG_SET_HOTKEY_QUESTION | ||
13325 | desc: hotkey splash | ||
13326 | user: core | ||
13327 | <source> | ||
13328 | *: none | ||
13329 | hotkey: "Set Hotkey: %s?" | ||
13330 | </source> | ||
13331 | <dest> | ||
13332 | *: none | ||
13333 | hotkey: "Nastavit zkratkovou klávesu: %s?" | ||
13334 | </dest> | ||
13335 | <voice> | ||
13336 | *: none | ||
13337 | hotkey: "Nastavit zkratkovou klávesu?" | ||
13338 | </voice> | ||
13339 | </phrase> | ||
13340 | <phrase> | ||
13341 | id: LANG_HOTKEY_ASSIGNED | ||
13342 | desc: Confirmation after the hotkey has been assigned | ||
13343 | user: core | ||
13344 | <source> | ||
13345 | *: none | ||
13346 | hotkey: "Assigned Hotkey: %s" | ||
13347 | </source> | ||
13348 | <dest> | ||
13349 | *: none | ||
13350 | hotkey: "Přiřazená zkratková klávesa: %s" | ||
13351 | </dest> | ||
13352 | <voice> | ||
13353 | *: none | ||
13354 | hotkey: "Přiřazená zkratková klávesa" | ||
13355 | </voice> | ||
13356 | </phrase> | ||
13357 | <phrase> | ||
13358 | id: LANG_HOTKEY_NOT_SET | ||
13359 | desc: hotkey splash | ||
13360 | user: core | ||
13361 | <source> | ||
13362 | *: none | ||
13363 | hotkey: "Hotkey Not Set" | ||
13364 | </source> | ||
13365 | <dest> | ||
13366 | *: none | ||
13367 | hotkey: "Zkratková klávesa nenastavena" | ||
13368 | </dest> | ||
13369 | <voice> | ||
13370 | *: none | ||
13371 | hotkey: "Zkratková klávesa nenastavena" | ||
13372 | </voice> | ||
13373 | </phrase> | ||
13374 | <phrase> | ||
13375 | id: LANG_HOTKEY | 13324 | id: LANG_HOTKEY |
13376 | desc: hotkey menu | 13325 | desc: hotkey menu |
13377 | user: core | 13326 | user: core |
@@ -13389,55 +13338,6 @@ | |||
13389 | </voice> | 13338 | </voice> |
13390 | </phrase> | 13339 | </phrase> |
13391 | <phrase> | 13340 | <phrase> |
13392 | id: LANG_VIEW_HOTKEY | ||
13393 | desc: hotkey menu | ||
13394 | user: core | ||
13395 | <source> | ||
13396 | *: none | ||
13397 | hotkey: "View Hotkey Settings" | ||
13398 | </source> | ||
13399 | <dest> | ||
13400 | *: none | ||
13401 | hotkey: "Zobrazit nastavení zkratkové klávesy" | ||
13402 | </dest> | ||
13403 | <voice> | ||
13404 | *: none | ||
13405 | hotkey: "Zobrazit nastavení zkratkové klávesy" | ||
13406 | </voice> | ||
13407 | </phrase> | ||
13408 | <phrase> | ||
13409 | id: LANG_HOTKEY_VIEW_WPS | ||
13410 | desc: hotkey info menu | ||
13411 | user: core | ||
13412 | <source> | ||
13413 | *: none | ||
13414 | hotkey: "WPS: %s" | ||
13415 | </source> | ||
13416 | <dest> | ||
13417 | *: none | ||
13418 | hotkey: "Přehrávací obrazovka: %s" | ||
13419 | </dest> | ||
13420 | <voice> | ||
13421 | *: none | ||
13422 | </voice> | ||
13423 | </phrase> | ||
13424 | <phrase> | ||
13425 | id: LANG_HOTKEY_VIEW_FILE_BROWSER | ||
13426 | desc: hotkey info menu | ||
13427 | user: core | ||
13428 | <source> | ||
13429 | *: none | ||
13430 | hotkey: "Prohlížeč souborů: %s" | ||
13431 | </source> | ||
13432 | <dest> | ||
13433 | *: none | ||
13434 | hotkey: "Prohlížeč souborů: %s" | ||
13435 | </dest> | ||
13436 | <voice> | ||
13437 | *: none | ||
13438 | </voice> | ||
13439 | </phrase> | ||
13440 | <phrase> | ||
13441 | id: LANG_RESUME_REWIND | 13341 | id: LANG_RESUME_REWIND |
13442 | desc: in playback settings menu | 13342 | desc: in playback settings menu |
13443 | user: core | 13343 | 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 @@ | |||
13396 | </phrase> | 13396 | </phrase> |
13397 | <phrase> | 13397 | <phrase> |
13398 | id: LANG_SET_HOTKEY_QUESTION | 13398 | id: LANG_SET_HOTKEY_QUESTION |
13399 | desc: hotkey splash | 13399 | desc: deprecated |
13400 | user: core | 13400 | user: core |
13401 | <source> | 13401 | <source> |
13402 | *: none | 13402 | *: none |
13403 | hotkey: "Set Hotkey: %s?" | 13403 | hotkey: "" |
13404 | </source> | 13404 | </source> |
13405 | <dest> | 13405 | <dest> |
13406 | *: none | 13406 | *: none |
13407 | hotkey: "Set Hotkey: %s?" | 13407 | hotkey: "" |
13408 | </dest> | 13408 | </dest> |
13409 | <voice> | 13409 | <voice> |
13410 | *: none | 13410 | *: none |
13411 | hotkey: "Set Hotkey?" | 13411 | hotkey: "" |
13412 | </voice> | 13412 | </voice> |
13413 | </phrase> | 13413 | </phrase> |
13414 | <phrase> | 13414 | <phrase> |
13415 | id: LANG_HOTKEY_ASSIGNED | 13415 | id: LANG_HOTKEY_ASSIGNED |
13416 | desc: Confirmation after the hotkey has been assigned | 13416 | desc: deprecated |
13417 | user: core | 13417 | user: core |
13418 | <source> | 13418 | <source> |
13419 | *: none | 13419 | *: none |
13420 | hotkey: "Assigned Hotkey: %s" | 13420 | hotkey: "" |
13421 | </source> | 13421 | </source> |
13422 | <dest> | 13422 | <dest> |
13423 | *: none | 13423 | *: none |
13424 | hotkey: "Assigned Hotkey: %s" | 13424 | hotkey: "" |
13425 | </dest> | 13425 | </dest> |
13426 | <voice> | 13426 | <voice> |
13427 | *: none | 13427 | *: none |
13428 | hotkey: "Assigned Hotkey" | 13428 | hotkey: "" |
13429 | </voice> | 13429 | </voice> |
13430 | </phrase> | 13430 | </phrase> |
13431 | <phrase> | 13431 | <phrase> |
13432 | id: LANG_HOTKEY_NOT_SET | 13432 | id: LANG_HOTKEY_NOT_SET |
13433 | desc: hotkey splash | 13433 | desc: deprecated |
13434 | user: core | 13434 | user: core |
13435 | <source> | 13435 | <source> |
13436 | *: none | 13436 | *: none |
13437 | hotkey: "Hotkey Not Set" | 13437 | hotkey: "" |
13438 | </source> | 13438 | </source> |
13439 | <dest> | 13439 | <dest> |
13440 | *: none | 13440 | *: none |
13441 | hotkey: "Hotkey Not Set" | 13441 | hotkey: "" |
13442 | </dest> | 13442 | </dest> |
13443 | <voice> | 13443 | <voice> |
13444 | *: none | 13444 | *: none |
13445 | hotkey: "Hotkey Not Set" | 13445 | hotkey: "" |
13446 | </voice> | 13446 | </voice> |
13447 | </phrase> | 13447 | </phrase> |
13448 | <phrase> | 13448 | <phrase> |
@@ -13464,51 +13464,53 @@ | |||
13464 | </phrase> | 13464 | </phrase> |
13465 | <phrase> | 13465 | <phrase> |
13466 | id: LANG_VIEW_HOTKEY | 13466 | id: LANG_VIEW_HOTKEY |
13467 | desc: hotkey menu | 13467 | desc: deprecated |
13468 | user: core | 13468 | user: core |
13469 | <source> | 13469 | <source> |
13470 | *: none | 13470 | *: none |
13471 | hotkey: "View Hotkey Settings" | 13471 | hotkey: "" |
13472 | </source> | 13472 | </source> |
13473 | <dest> | 13473 | <dest> |
13474 | *: none | 13474 | *: none |
13475 | hotkey: "View Hotkey Settings" | 13475 | hotkey: "" |
13476 | </dest> | 13476 | </dest> |
13477 | <voice> | 13477 | <voice> |
13478 | *: none | 13478 | *: none |
13479 | hotkey: "View Hotkey Settings" | 13479 | hotkey: "" |
13480 | </voice> | 13480 | </voice> |
13481 | </phrase> | 13481 | </phrase> |
13482 | <phrase> | 13482 | <phrase> |
13483 | id: LANG_HOTKEY_VIEW_WPS | 13483 | id: LANG_HOTKEY_WPS |
13484 | desc: hotkey info menu | 13484 | desc: hotkey menu |
13485 | user: core | 13485 | user: core |
13486 | <source> | 13486 | <source> |
13487 | *: none | 13487 | *: none |
13488 | hotkey: "WPS: %s" | 13488 | hotkey: "WPS Hotkey" |
13489 | </source> | 13489 | </source> |
13490 | <dest> | 13490 | <dest> |
13491 | *: none | 13491 | *: none |
13492 | hotkey: "WPS: %s" | 13492 | hotkey: "WPS Hotkey" |
13493 | </dest> | 13493 | </dest> |
13494 | <voice> | 13494 | <voice> |
13495 | *: none | 13495 | *: none |
13496 | hotkey: "WPS Hotkey" | ||
13496 | </voice> | 13497 | </voice> |
13497 | </phrase> | 13498 | </phrase> |
13498 | <phrase> | 13499 | <phrase> |
13499 | id: LANG_HOTKEY_VIEW_FILE_BROWSER | 13500 | id: LANG_HOTKEY_FILE_BROWSER |
13500 | desc: hotkey info menu | 13501 | desc: hotkey menu |
13501 | user: core | 13502 | user: core |
13502 | <source> | 13503 | <source> |
13503 | *: none | 13504 | *: none |
13504 | hotkey: "File Browser: %s" | 13505 | hotkey: "File Browser Hotkey" |
13505 | </source> | 13506 | </source> |
13506 | <dest> | 13507 | <dest> |
13507 | *: none | 13508 | *: none |
13508 | hotkey: "File Browser: %s" | 13509 | hotkey: "File Browser Hotkey" |
13509 | </dest> | 13510 | </dest> |
13510 | <voice> | 13511 | <voice> |
13511 | *: none | 13512 | *: none |
13513 | hotkey: "File Browser Hotkey" | ||
13512 | </voice> | 13514 | </voice> |
13513 | </phrase> | 13515 | </phrase> |
13514 | <phrase> | 13516 | <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 @@ | |||
13320 | </voice> | 13320 | </voice> |
13321 | </phrase> | 13321 | </phrase> |
13322 | <phrase> | 13322 | <phrase> |
13323 | id: LANG_SET_HOTKEY_QUESTION | ||
13324 | desc: hotkey splash | ||
13325 | user: core | ||
13326 | <source> | ||
13327 | *: none | ||
13328 | hotkey: "Set Hotkey: %s?" | ||
13329 | </source> | ||
13330 | <dest> | ||
13331 | *: none | ||
13332 | hotkey: "Imposta Tasto Rapido: %s?" | ||
13333 | </dest> | ||
13334 | <voice> | ||
13335 | *: none | ||
13336 | hotkey: "Imposta Tasto Rapido?" | ||
13337 | </voice> | ||
13338 | </phrase> | ||
13339 | <phrase> | ||
13340 | id: LANG_HOTKEY_ASSIGNED | ||
13341 | desc: Confirmation after the hotkey has been assigned | ||
13342 | user: core | ||
13343 | <source> | ||
13344 | *: none | ||
13345 | hotkey: "Assigned Hotkey: %s" | ||
13346 | </source> | ||
13347 | <dest> | ||
13348 | *: none | ||
13349 | hotkey: "Tasto Rapido Assegnato: %s" | ||
13350 | </dest> | ||
13351 | <voice> | ||
13352 | *: none | ||
13353 | hotkey: "Tasto Rapido Assegnato" | ||
13354 | </voice> | ||
13355 | </phrase> | ||
13356 | <phrase> | ||
13357 | id: LANG_HOTKEY_NOT_SET | ||
13358 | desc: hotkey splash | ||
13359 | user: core | ||
13360 | <source> | ||
13361 | *: none | ||
13362 | hotkey: "Hotkey Not Set" | ||
13363 | </source> | ||
13364 | <dest> | ||
13365 | *: none | ||
13366 | hotkey: "Tasto Rapido Non Impostato" | ||
13367 | </dest> | ||
13368 | <voice> | ||
13369 | *: none | ||
13370 | hotkey: "Tasto Rapido Non Impostato" | ||
13371 | </voice> | ||
13372 | </phrase> | ||
13373 | <phrase> | ||
13374 | id: LANG_HOTKEY | 13323 | id: LANG_HOTKEY |
13375 | desc: hotkey menu | 13324 | desc: hotkey menu |
13376 | user: core | 13325 | user: core |
@@ -13387,52 +13336,3 @@ | |||
13387 | hotkey: "Tasto Rapido" | 13336 | hotkey: "Tasto Rapido" |
13388 | </voice> | 13337 | </voice> |
13389 | </phrase> | 13338 | </phrase> |
13390 | <phrase> | ||
13391 | id: LANG_VIEW_HOTKEY | ||
13392 | desc: hotkey menu | ||
13393 | user: core | ||
13394 | <source> | ||
13395 | *: none | ||
13396 | hotkey: "View Hotkey Settings" | ||
13397 | </source> | ||
13398 | <dest> | ||
13399 | *: none | ||
13400 | hotkey: "Visualizza Impostazioni Tasto Rapido" | ||
13401 | </dest> | ||
13402 | <voice> | ||
13403 | *: none | ||
13404 | hotkey: "Visualizza Impostazioni Tasto Rapido" | ||
13405 | </voice> | ||
13406 | </phrase> | ||
13407 | <phrase> | ||
13408 | id: LANG_HOTKEY_VIEW_WPS | ||
13409 | desc: hotkey info menu | ||
13410 | user: core | ||
13411 | <source> | ||
13412 | *: none | ||
13413 | hotkey: "WPS: %s" | ||
13414 | </source> | ||
13415 | <dest> | ||
13416 | *: none | ||
13417 | hotkey: "WPS: %s" | ||
13418 | </dest> | ||
13419 | <voice> | ||
13420 | *: none | ||
13421 | </voice> | ||
13422 | </phrase> | ||
13423 | <phrase> | ||
13424 | id: LANG_HOTKEY_VIEW_FILE_BROWSER | ||
13425 | desc: hotkey info menu | ||
13426 | user: core | ||
13427 | <source> | ||
13428 | *: none | ||
13429 | hotkey: "File Browser: %s" | ||
13430 | </source> | ||
13431 | <dest> | ||
13432 | *: none | ||
13433 | hotkey: "Sfoglia File: %s" | ||
13434 | </dest> | ||
13435 | <voice> | ||
13436 | *: none | ||
13437 | </voice> | ||
13438 | </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 @@ | |||
13319 | </voice> | 13319 | </voice> |
13320 | </phrase> | 13320 | </phrase> |
13321 | <phrase> | 13321 | <phrase> |
13322 | id: LANG_VIEW_HOTKEY | ||
13323 | desc: hotkey menu | ||
13324 | user: core | ||
13325 | <source> | ||
13326 | *: none | ||
13327 | hotkey: "View Hotkey Settings" | ||
13328 | </source> | ||
13329 | <dest> | ||
13330 | *: none | ||
13331 | hotkey: "Zobraziť Nastavenia Horúceho Klávesu" | ||
13332 | </dest> | ||
13333 | <voice> | ||
13334 | *: none | ||
13335 | hotkey: "Zobraziť nastavenia horúceho klávesu" | ||
13336 | </voice> | ||
13337 | </phrase> | ||
13338 | <phrase> | ||
13339 | id: LANG_HOTKEY_ASSIGNED | ||
13340 | desc: Confirmation after the hotkey has been assigned | ||
13341 | user: core | ||
13342 | <source> | ||
13343 | *: none | ||
13344 | hotkey: "Assigned Hotkey: %s" | ||
13345 | </source> | ||
13346 | <dest> | ||
13347 | *: none | ||
13348 | hotkey: "Priradená Skratka: %s" | ||
13349 | </dest> | ||
13350 | <voice> | ||
13351 | *: none | ||
13352 | hotkey: "Priradená skratka" | ||
13353 | </voice> | ||
13354 | </phrase> | ||
13355 | <phrase> | ||
13356 | id: LANG_HOTKEY | 13322 | id: LANG_HOTKEY |
13357 | desc: hotkey menu | 13323 | desc: hotkey menu |
13358 | user: core | 13324 | user: core |
@@ -13370,72 +13336,6 @@ | |||
13370 | </voice> | 13336 | </voice> |
13371 | </phrase> | 13337 | </phrase> |
13372 | <phrase> | 13338 | <phrase> |
13373 | id: LANG_HOTKEY_NOT_SET | ||
13374 | desc: hotkey splash | ||
13375 | user: core | ||
13376 | <source> | ||
13377 | *: none | ||
13378 | hotkey: "Hotkey Not Set" | ||
13379 | </source> | ||
13380 | <dest> | ||
13381 | *: none | ||
13382 | hotkey: "Skratka Nieje Nastavená" | ||
13383 | </dest> | ||
13384 | <voice> | ||
13385 | *: none | ||
13386 | hotkey: "Skratka nieje nastavená" | ||
13387 | </voice> | ||
13388 | </phrase> | ||
13389 | <phrase> | ||
13390 | id: LANG_SET_HOTKEY_QUESTION | ||
13391 | desc: hotkey splash | ||
13392 | user: core | ||
13393 | <source> | ||
13394 | *: none | ||
13395 | hotkey: "Set Hotkey: %s?" | ||
13396 | </source> | ||
13397 | <dest> | ||
13398 | *: none | ||
13399 | hotkey: "Nastaviť skratku: %s?" | ||
13400 | </dest> | ||
13401 | <voice> | ||
13402 | *: none | ||
13403 | hotkey: "Nastaviť skratku?" | ||
13404 | </voice> | ||
13405 | </phrase> | ||
13406 | <phrase> | ||
13407 | id: LANG_HOTKEY_VIEW_FILE_BROWSER | ||
13408 | desc: hotkey info menu | ||
13409 | user: core | ||
13410 | <source> | ||
13411 | *: none | ||
13412 | hotkey: "File Browser: %s" | ||
13413 | </source> | ||
13414 | <dest> | ||
13415 | *: none | ||
13416 | hotkey: "Prehliadač Súborov: %s" | ||
13417 | </dest> | ||
13418 | <voice> | ||
13419 | *: none | ||
13420 | </voice> | ||
13421 | </phrase> | ||
13422 | <phrase> | ||
13423 | id: LANG_HOTKEY_VIEW_WPS | ||
13424 | desc: hotkey info menu | ||
13425 | user: core | ||
13426 | <source> | ||
13427 | *: none | ||
13428 | hotkey: "WPS: %s" | ||
13429 | </source> | ||
13430 | <dest> | ||
13431 | *: none | ||
13432 | hotkey: "WPS: %s" | ||
13433 | </dest> | ||
13434 | <voice> | ||
13435 | *: none | ||
13436 | </voice> | ||
13437 | </phrase> | ||
13438 | <phrase> | ||
13439 | id: LANG_RESUME_REWIND | 13339 | id: LANG_RESUME_REWIND |
13440 | desc: in playback settings menu | 13340 | desc: in playback settings menu |
13441 | user: core | 13341 | 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 @@ | |||
61 | #include "list.h" | 61 | #include "list.h" |
62 | #include "buttonbar.h" | 62 | #include "buttonbar.h" |
63 | 63 | ||
64 | /* hotkey settings */ | ||
65 | #ifdef HAVE_HOTKEY | ||
66 | const struct menu_item_ex *selected_menu_item; | ||
67 | bool hotkey_settable_menu = false; | ||
68 | #endif | ||
69 | |||
70 | #define MAX_MENUS 8 | 64 | #define MAX_MENUS 8 |
71 | /* used to allow for dynamic menus */ | 65 | /* used to allow for dynamic menus */ |
72 | #define MAX_MENU_SUBITEMS 64 | 66 | #define MAX_MENU_SUBITEMS 64 |
@@ -432,22 +426,6 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, | |||
432 | done = true; | 426 | done = true; |
433 | } | 427 | } |
434 | #endif | 428 | #endif |
435 | #ifdef HAVE_HOTKEY | ||
436 | else if (hotkey_settable_menu && | ||
437 | ((action == ACTION_WPS_HOTKEY) || | ||
438 | (action == ACTION_TREE_HOTKEY))) | ||
439 | { | ||
440 | int this = get_menu_selection(gui_synclist_get_sel_pos(&lists),menu); | ||
441 | temp = menu->submenus[this]; | ||
442 | if (temp->flags&MENU_FUNC_HOTKEYABLE) | ||
443 | { | ||
444 | selected_menu_item = temp; | ||
445 | selected = this; | ||
446 | ret = MENU_SELECTED_HOTKEY; | ||
447 | done = true; | ||
448 | } | ||
449 | } | ||
450 | #endif | ||
451 | else if (action == ACTION_TREE_WPS) | 429 | else if (action == ACTION_TREE_WPS) |
452 | { | 430 | { |
453 | ret = GO_TO_PREVIOUS_MUSIC; | 431 | 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 { | |||
61 | /* Flags for MT_FUNCTION_CALL */ | 61 | /* Flags for MT_FUNCTION_CALL */ |
62 | #define MENU_FUNC_USEPARAM 0x80 | 62 | #define MENU_FUNC_USEPARAM 0x80 |
63 | #define MENU_FUNC_CHECK_RETVAL 0x100 | 63 | #define MENU_FUNC_CHECK_RETVAL 0x100 |
64 | #define MENU_FUNC_HOTKEYABLE 0x200 | ||
65 | 64 | ||
66 | #define MENU_COUNT_MASK 0xFFF | 65 | #define MENU_COUNT_MASK 0xFFF |
67 | #define MENU_COUNT_SHIFT 12 | 66 | #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) | |||
68 | 68 | ||
69 | MENUITEM_FUNCTION(create_playlist_item, 0, ID2P(LANG_CREATE_PLAYLIST), | 69 | MENUITEM_FUNCTION(create_playlist_item, 0, ID2P(LANG_CREATE_PLAYLIST), |
70 | (int(*)(void))create_playlist, NULL, NULL, Icon_NOICON); | 70 | (int(*)(void))create_playlist, NULL, NULL, Icon_NOICON); |
71 | MENUITEM_FUNCTION(view_cur_playlist, MENU_FUNC_CHECK_RETVAL | MENU_FUNC_HOTKEYABLE, | 71 | MENUITEM_FUNCTION(view_cur_playlist, MENU_FUNC_CHECK_RETVAL, |
72 | ID2P(LANG_VIEW_DYNAMIC_PLAYLIST), | 72 | ID2P(LANG_VIEW_DYNAMIC_PLAYLIST), |
73 | (int(*)(void))playlist_view_, NULL, NULL, Icon_NOICON); | 73 | (int(*)(void))playlist_view_, NULL, NULL, Icon_NOICON); |
74 | MENUITEM_FUNCTION(save_playlist, MENU_FUNC_USEPARAM, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST), | 74 | 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 @@ | |||
46 | #ifdef HAVE_DIRCACHE | 46 | #ifdef HAVE_DIRCACHE |
47 | #include "dircache.h" | 47 | #include "dircache.h" |
48 | #endif | 48 | #endif |
49 | #ifdef HAVE_HOTKEY | ||
50 | #include "list.h" | ||
51 | #include "settings_list.h" | ||
52 | #include "onplay.h" | ||
53 | #endif | ||
54 | 49 | ||
55 | /***********************************/ | 50 | /***********************************/ |
56 | /* TAGCACHE MENU */ | 51 | /* TAGCACHE MENU */ |
@@ -406,44 +401,10 @@ MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0, Icon_Voice, | |||
406 | /***********************************/ | 401 | /***********************************/ |
407 | /* HOTKEY MENU */ | 402 | /* HOTKEY MENU */ |
408 | #ifdef HAVE_HOTKEY | 403 | #ifdef HAVE_HOTKEY |
409 | static void view_hotkey_info(void) | 404 | MENUITEM_SETTING(hotkey_wps_item, &global_settings.hotkey_wps, NULL); |
410 | { | 405 | MENUITEM_SETTING(hotkey_tree_item, &global_settings.hotkey_tree, NULL); |
411 | struct simplelist_info info; | ||
412 | simplelist_info_init(&info, str(LANG_VIEW_HOTKEY), 0, NULL); | ||
413 | info.hide_selection = true; | ||
414 | info.scroll_all = true; | ||
415 | simplelist_addline(SIMPLELIST_ADD_LINE, str(LANG_HOTKEY_VIEW_WPS), | ||
416 | get_hotkey_desc(global_settings.hotkey_wps)); | ||
417 | simplelist_addline(SIMPLELIST_ADD_LINE, str(LANG_HOTKEY_VIEW_FILE_BROWSER), | ||
418 | get_hotkey_desc(global_settings.hotkey_tree)); | ||
419 | simplelist_show_list(&info); | ||
420 | } | ||
421 | |||
422 | /* reset hotkey settings to their defaults */ | ||
423 | static void reset_hotkey_settings(void) | ||
424 | { | ||
425 | { | ||
426 | const struct settings_list *setting = | ||
427 | find_setting(&global_settings.hotkey_wps, NULL); | ||
428 | reset_setting(setting, setting->setting); | ||
429 | } | ||
430 | { | ||
431 | const struct settings_list *setting = | ||
432 | find_setting(&global_settings.hotkey_tree, NULL); | ||
433 | reset_setting(setting, setting->setting); | ||
434 | } | ||
435 | settings_save(); | ||
436 | splash(HZ, str(LANG_RESET_DONE_CLEAR)); | ||
437 | } | ||
438 | |||
439 | MENUITEM_FUNCTION(hotkey_view, 0, ID2P(LANG_VIEW_HOTKEY), | ||
440 | (int(*)(void))view_hotkey_info, NULL, | ||
441 | NULL, Icon_NOICON); | ||
442 | MENUITEM_FUNCTION(hotkey_reset, 0, ID2P(LANG_RESET), | ||
443 | (int(*)(void))reset_hotkey_settings, NULL, | ||
444 | NULL, Icon_NOICON); | ||
445 | MAKE_MENU(hotkey_menu, ID2P(LANG_HOTKEY), 0, Icon_NOICON, | 406 | MAKE_MENU(hotkey_menu, ID2P(LANG_HOTKEY), 0, Icon_NOICON, |
446 | &hotkey_view, &hotkey_reset); | 407 | &hotkey_wps_item, &hotkey_tree_item); |
447 | #endif /*have_hotkey */ | 408 | #endif /*have_hotkey */ |
448 | /* HOTKEY MENU */ | 409 | /* HOTKEY MENU */ |
449 | /***********************************/ | 410 | /***********************************/ |
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, | |||
270 | const struct menu_item_ex *this_item); | 270 | const struct menu_item_ex *this_item); |
271 | 271 | ||
272 | /* insert items */ | 272 | /* insert items */ |
273 | MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM | MENU_FUNC_HOTKEYABLE, | 273 | MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT), |
274 | ID2P(LANG_INSERT), | ||
275 | playlist_insert_func, (intptr_t*)PLAYLIST_INSERT, | 274 | playlist_insert_func, (intptr_t*)PLAYLIST_INSERT, |
276 | NULL, Icon_Playlist); | 275 | NULL, Icon_Playlist); |
277 | MENUITEM_FUNCTION(i_first_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_FIRST), | 276 | 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), | |||
960 | view_cue, NULL, view_cue_item_callback, Icon_NOICON); | 959 | view_cue, NULL, view_cue_item_callback, Icon_NOICON); |
961 | 960 | ||
962 | /* CONTEXT_WPS items */ | 961 | /* CONTEXT_WPS items */ |
963 | MENUITEM_FUNCTION(browse_id3_item, MENU_FUNC_HOTKEYABLE, | 962 | MENUITEM_FUNCTION(browse_id3_item, 0, ID2P(LANG_MENU_SHOW_ID3_INFO), |
964 | ID2P(LANG_MENU_SHOW_ID3_INFO), | ||
965 | browse_id3, NULL, NULL, Icon_NOICON); | 963 | browse_id3, NULL, NULL, Icon_NOICON); |
966 | #ifdef HAVE_PITCHSCREEN | 964 | #ifdef HAVE_PITCHSCREEN |
967 | MENUITEM_FUNCTION(pitch_screen_item, MENU_FUNC_HOTKEYABLE, | 965 | MENUITEM_FUNCTION(pitch_screen_item, 0, ID2P(LANG_PITCH), |
968 | ID2P(LANG_PITCH), | ||
969 | gui_syncpitchscreen_run, NULL, NULL, Icon_Audio); | 966 | gui_syncpitchscreen_run, NULL, NULL, Icon_Audio); |
970 | #endif | 967 | #endif |
971 | 968 | ||
@@ -979,9 +976,9 @@ MENUITEM_FUNCTION(clipboard_copy_item, 0, ID2P(LANG_COPY), | |||
979 | clipboard_copy, NULL, clipboard_callback, Icon_NOICON); | 976 | clipboard_copy, NULL, clipboard_callback, Icon_NOICON); |
980 | MENUITEM_FUNCTION(clipboard_paste_item, 0, ID2P(LANG_PASTE), | 977 | MENUITEM_FUNCTION(clipboard_paste_item, 0, ID2P(LANG_PASTE), |
981 | clipboard_paste, NULL, clipboard_callback, Icon_NOICON); | 978 | clipboard_paste, NULL, clipboard_callback, Icon_NOICON); |
982 | MENUITEM_FUNCTION(delete_file_item, MENU_FUNC_HOTKEYABLE, ID2P(LANG_DELETE), | 979 | MENUITEM_FUNCTION(delete_file_item, 0, ID2P(LANG_DELETE), |
983 | delete_file_dir, NULL, clipboard_callback, Icon_NOICON); | 980 | delete_file_dir, NULL, clipboard_callback, Icon_NOICON); |
984 | MENUITEM_FUNCTION(delete_dir_item, MENU_FUNC_HOTKEYABLE, ID2P(LANG_DELETE_DIR), | 981 | MENUITEM_FUNCTION(delete_dir_item, 0, ID2P(LANG_DELETE_DIR), |
985 | delete_file_dir, NULL, clipboard_callback, Icon_NOICON); | 982 | delete_file_dir, NULL, clipboard_callback, Icon_NOICON); |
986 | MENUITEM_FUNCTION(create_dir_item, 0, ID2P(LANG_CREATE_DIR), | 983 | MENUITEM_FUNCTION(create_dir_item, 0, ID2P(LANG_CREATE_DIR), |
987 | create_dir, NULL, clipboard_callback, Icon_NOICON); | 984 | create_dir, NULL, clipboard_callback, Icon_NOICON); |
@@ -1003,8 +1000,7 @@ static bool onplay_load_plugin(void *param) | |||
1003 | return false; | 1000 | return false; |
1004 | } | 1001 | } |
1005 | 1002 | ||
1006 | MENUITEM_FUNCTION(list_viewers_item, MENU_FUNC_HOTKEYABLE, | 1003 | MENUITEM_FUNCTION(list_viewers_item, 0, ID2P(LANG_ONPLAY_OPEN_WITH), |
1007 | ID2P(LANG_ONPLAY_OPEN_WITH), | ||
1008 | list_viewers, NULL, clipboard_callback, Icon_NOICON); | 1004 | list_viewers, NULL, clipboard_callback, Icon_NOICON); |
1009 | MENUITEM_FUNCTION(properties_item, MENU_FUNC_USEPARAM, ID2P(LANG_PROPERTIES), | 1005 | MENUITEM_FUNCTION(properties_item, MENU_FUNC_USEPARAM, ID2P(LANG_PROPERTIES), |
1010 | onplay_load_plugin, (void *)"properties", | 1006 | onplay_load_plugin, (void *)"properties", |
@@ -1199,75 +1195,61 @@ static bool open_with(void) | |||
1199 | return list_viewers(); | 1195 | return list_viewers(); |
1200 | } | 1196 | } |
1201 | 1197 | ||
1202 | extern const struct menu_item_ex *selected_menu_item; | ||
1203 | extern bool hotkey_settable_menu; | ||
1204 | |||
1205 | #define HOTKEY_ACTION_MASK 0x0FF /* Mask to apply to get the action (enum) */ | 1198 | #define HOTKEY_ACTION_MASK 0x0FF /* Mask to apply to get the action (enum) */ |
1206 | #define HOTKEY_CTX_WPS 0x100 /* Mask to apply to check whether it's for WPS */ | 1199 | #define HOTKEY_CTX_WPS 0x100 /* Mask to apply to check whether it's for WPS */ |
1207 | #define HOTKEY_CTX_TREE 0x200 /* Mask to apply to check whether it's for the tree */ | 1200 | #define HOTKEY_CTX_TREE 0x200 /* Mask to apply to check whether it's for the tree */ |
1208 | 1201 | ||
1209 | /* Any desired hotkey functions go here... */ | ||
1210 | enum hotkey_action { | ||
1211 | HOTKEY_OFF = 0, | ||
1212 | HOTKEY_VIEW_PLAYLIST = 1, | ||
1213 | HOTKEY_SHOW_TRACK_INFO, | ||
1214 | HOTKEY_PITCHSCREEN, | ||
1215 | HOTKEY_OPEN_WITH, | ||
1216 | HOTKEY_DELETE, | ||
1217 | HOTKEY_INSERT, | ||
1218 | }; | ||
1219 | |||
1220 | struct hotkey_assignment { | 1202 | struct hotkey_assignment { |
1221 | int item; /* Bit or'd hotkey_action and HOTKEY_CTX_x */ | 1203 | int item; /* Bit or'd hotkey_action and HOTKEY_CTX_x */ |
1222 | struct menu_func func; /* Function to run if this entry is selected */ | 1204 | struct menu_func func; /* Function to run if this entry is selected */ |
1223 | int return_code; /* What to return after the function is run */ | 1205 | int return_code; /* What to return after the function is run */ |
1224 | const struct menu_item_ex *menu_addr; /* Must have non-dynamic text, */ | 1206 | int lang_id; /* Language ID */ |
1225 | /* i.e. have the flag MENU_HAS_DESC. E.g. be a MENUITEM_FUNCTION */ | ||
1226 | /* For all possibilities see menu.h. */ | ||
1227 | }; | 1207 | }; |
1228 | 1208 | ||
1229 | #define HOTKEY_FUNC(func, param) {{(void *)func}, param} | 1209 | #define HOTKEY_FUNC(func, param) {{(void *)func}, param} |
1230 | 1210 | ||
1231 | /* ... and here. Order is not important. */ | 1211 | /* Any desired hotkey functions go here, in the enum in onplay.h, |
1212 | and in the settings menu in settings_list.c. The order here | ||
1213 | is not important. */ | ||
1232 | static struct hotkey_assignment hotkey_items[] = { | 1214 | static struct hotkey_assignment hotkey_items[] = { |
1233 | { HOTKEY_VIEW_PLAYLIST | HOTKEY_CTX_WPS, | 1215 | { HOTKEY_VIEW_PLAYLIST | HOTKEY_CTX_WPS, |
1234 | HOTKEY_FUNC(NULL, NULL), | 1216 | HOTKEY_FUNC(NULL, NULL), |
1235 | ONPLAY_PLAYLIST, &view_cur_playlist }, | 1217 | ONPLAY_PLAYLIST, LANG_VIEW_DYNAMIC_PLAYLIST }, |
1236 | { HOTKEY_SHOW_TRACK_INFO| HOTKEY_CTX_WPS, | 1218 | { HOTKEY_SHOW_TRACK_INFO| HOTKEY_CTX_WPS, |
1237 | HOTKEY_FUNC(browse_id3, NULL), | 1219 | HOTKEY_FUNC(browse_id3, NULL), |
1238 | ONPLAY_RELOAD_DIR, &browse_id3_item }, | 1220 | ONPLAY_RELOAD_DIR, LANG_MENU_SHOW_ID3_INFO }, |
1239 | #ifdef HAVE_PITCHSCREEN | 1221 | #ifdef HAVE_PITCHSCREEN |
1240 | { HOTKEY_PITCHSCREEN | HOTKEY_CTX_WPS, | 1222 | { HOTKEY_PITCHSCREEN | HOTKEY_CTX_WPS, |
1241 | HOTKEY_FUNC(gui_syncpitchscreen_run, NULL), | 1223 | HOTKEY_FUNC(gui_syncpitchscreen_run, NULL), |
1242 | ONPLAY_RELOAD_DIR, &pitch_screen_item }, | 1224 | ONPLAY_RELOAD_DIR, LANG_PITCH }, |
1243 | #endif | 1225 | #endif |
1244 | { HOTKEY_OPEN_WITH | HOTKEY_CTX_WPS | HOTKEY_CTX_TREE, | 1226 | { HOTKEY_OPEN_WITH | HOTKEY_CTX_WPS | HOTKEY_CTX_TREE, |
1245 | HOTKEY_FUNC(open_with, NULL), | 1227 | HOTKEY_FUNC(open_with, NULL), |
1246 | ONPLAY_RELOAD_DIR, &list_viewers_item }, | 1228 | ONPLAY_RELOAD_DIR, LANG_ONPLAY_OPEN_WITH }, |
1247 | { HOTKEY_DELETE | HOTKEY_CTX_WPS | HOTKEY_CTX_TREE, | 1229 | { HOTKEY_DELETE | HOTKEY_CTX_WPS | HOTKEY_CTX_TREE, |
1248 | HOTKEY_FUNC(delete_item, NULL), | 1230 | HOTKEY_FUNC(delete_item, NULL), |
1249 | ONPLAY_RELOAD_DIR, &delete_file_item }, | 1231 | ONPLAY_RELOAD_DIR, LANG_DELETE }, |
1250 | { HOTKEY_DELETE | HOTKEY_CTX_TREE, | 1232 | { HOTKEY_DELETE | HOTKEY_CTX_TREE, |
1251 | HOTKEY_FUNC(delete_item, NULL), | 1233 | HOTKEY_FUNC(delete_item, NULL), |
1252 | ONPLAY_RELOAD_DIR, &delete_dir_item }, | 1234 | ONPLAY_RELOAD_DIR, LANG_DELETE }, |
1253 | { HOTKEY_INSERT | HOTKEY_CTX_TREE, | 1235 | { HOTKEY_INSERT | HOTKEY_CTX_TREE, |
1254 | HOTKEY_FUNC(playlist_insert_func, (intptr_t*)PLAYLIST_INSERT), | 1236 | HOTKEY_FUNC(playlist_insert_func, (intptr_t*)PLAYLIST_INSERT), |
1255 | ONPLAY_START_PLAY, &i_pl_item }, | 1237 | ONPLAY_START_PLAY, LANG_INSERT }, |
1256 | }; | 1238 | }; |
1257 | 1239 | ||
1258 | static const int num_hotkey_items = sizeof(hotkey_items) / sizeof(hotkey_items[0]); | 1240 | static const int num_hotkey_items = sizeof(hotkey_items) / sizeof(hotkey_items[0]); |
1259 | 1241 | ||
1260 | /* Return the language ID for the input function */ | 1242 | /* Return the language ID for the input function */ |
1261 | const char* get_hotkey_desc(int hk_func) | 1243 | int get_hotkey_lang_id(int hk_func) |
1262 | { | 1244 | { |
1263 | int i; | 1245 | int i; |
1264 | for (i = 0; i < num_hotkey_items; i++) | 1246 | for (i = 0; i < num_hotkey_items; i++) |
1265 | { | 1247 | { |
1266 | if ((hotkey_items[i].item & HOTKEY_ACTION_MASK) == hk_func) | 1248 | if ((hotkey_items[i].item & HOTKEY_ACTION_MASK) == hk_func) |
1267 | return P2STR(hotkey_items[i].menu_addr->callback_and_desc->desc); | 1249 | return hotkey_items[i].lang_id; |
1268 | } | 1250 | } |
1269 | 1251 | ||
1270 | return str(LANG_HOTKEY_NOT_SET); | 1252 | return LANG_OFF; |
1271 | } | 1253 | } |
1272 | 1254 | ||
1273 | /* Execute the hotkey function, if listed for this screen */ | 1255 | /* Execute the hotkey function, if listed for this screen */ |
@@ -1300,60 +1282,9 @@ static int execute_hotkey(bool is_wps) | |||
1300 | } | 1282 | } |
1301 | } | 1283 | } |
1302 | 1284 | ||
1303 | /* no valid hotkey set */ | 1285 | /* no valid hotkey set, ignore hotkey */ |
1304 | splash(HZ, ID2P(LANG_HOTKEY_NOT_SET)); | ||
1305 | return ONPLAY_RELOAD_DIR; | 1286 | return ONPLAY_RELOAD_DIR; |
1306 | } | 1287 | } |
1307 | |||
1308 | /* Set the hotkey to the current context menu function, if listed */ | ||
1309 | static void set_hotkey(bool is_wps) | ||
1310 | { | ||
1311 | int i; | ||
1312 | struct hotkey_assignment *this_item; | ||
1313 | const int context = is_wps ? HOTKEY_CTX_WPS : HOTKEY_CTX_TREE; | ||
1314 | int *hk_func = is_wps ? &global_settings.hotkey_wps : | ||
1315 | &global_settings.hotkey_tree; | ||
1316 | int this_hk; | ||
1317 | char *this_desc; | ||
1318 | bool match_found = false; | ||
1319 | |||
1320 | /* search assignment struct for a function that matches the current menu item */ | ||
1321 | for (i = 0; i < num_hotkey_items; i++) | ||
1322 | { | ||
1323 | this_item = &hotkey_items[i]; | ||
1324 | if ((this_item->item & context) && | ||
1325 | (this_item->menu_addr == selected_menu_item)) | ||
1326 | { | ||
1327 | this_hk = this_item->item & HOTKEY_ACTION_MASK; | ||
1328 | this_desc = P2STR((selected_menu_item->callback_and_desc)->desc); | ||
1329 | match_found = true; | ||
1330 | break; | ||
1331 | } | ||
1332 | } | ||
1333 | |||
1334 | /* ignore the hotkey if no match found or no change to setting */ | ||
1335 | if (!match_found || (this_hk == *hk_func)) return; | ||
1336 | |||
1337 | char line1_buf[100], | ||
1338 | line2_buf[100]; | ||
1339 | char *line1 = line1_buf, | ||
1340 | *line2 = line2_buf; | ||
1341 | char **line1_ptr = &line1, | ||
1342 | **line2_ptr = &line2; | ||
1343 | const struct text_message message={(const char **)line1_ptr, 1}; | ||
1344 | const struct text_message yes_message={(const char **)line2_ptr, 1}; | ||
1345 | |||
1346 | snprintf(line1, sizeof(line1_buf), str(LANG_SET_HOTKEY_QUESTION), this_desc); | ||
1347 | snprintf(line2, sizeof(line2_buf), str(LANG_HOTKEY_ASSIGNED), this_desc); | ||
1348 | |||
1349 | /* confirm the hotkey setting change */ | ||
1350 | if(gui_syncyesno_run(&message, &yes_message, NULL)==YESNO_YES) | ||
1351 | { | ||
1352 | /* store the hotkey settings */ | ||
1353 | *hk_func = this_hk; | ||
1354 | settings_save(); | ||
1355 | } | ||
1356 | } | ||
1357 | #endif /* HOTKEY */ | 1288 | #endif /* HOTKEY */ |
1358 | 1289 | ||
1359 | int onplay(char* file, int attr, int from, bool hotkey) | 1290 | int onplay(char* file, int attr, int from, bool hotkey) |
@@ -1367,7 +1298,6 @@ int onplay(char* file, int attr, int from, bool hotkey) | |||
1367 | #ifdef HAVE_HOTKEY | 1298 | #ifdef HAVE_HOTKEY |
1368 | if (hotkey) | 1299 | if (hotkey) |
1369 | return execute_hotkey(context == CONTEXT_WPS); | 1300 | return execute_hotkey(context == CONTEXT_WPS); |
1370 | hotkey_settable_menu = true; | ||
1371 | #else | 1301 | #else |
1372 | (void)hotkey; | 1302 | (void)hotkey; |
1373 | #endif | 1303 | #endif |
@@ -1376,17 +1306,8 @@ int onplay(char* file, int attr, int from, bool hotkey) | |||
1376 | else | 1306 | else |
1377 | menu = &tree_onplay_menu; | 1307 | menu = &tree_onplay_menu; |
1378 | menu_selection = do_menu(menu, NULL, NULL, false); | 1308 | menu_selection = do_menu(menu, NULL, NULL, false); |
1379 | #ifdef HAVE_HOTKEY | ||
1380 | hotkey_settable_menu = false; | ||
1381 | switch (menu_selection) | ||
1382 | { | ||
1383 | case MENU_SELECTED_HOTKEY: | ||
1384 | set_hotkey(context == CONTEXT_WPS); | ||
1385 | return ONPLAY_RELOAD_DIR; | ||
1386 | #else | ||
1387 | switch (menu_selection) | 1309 | switch (menu_selection) |
1388 | { | 1310 | { |
1389 | #endif | ||
1390 | case GO_TO_WPS: | 1311 | case GO_TO_WPS: |
1391 | return ONPLAY_START_PLAY; | 1312 | return ONPLAY_START_PLAY; |
1392 | case GO_TO_ROOT: | 1313 | 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 { | |||
32 | }; | 32 | }; |
33 | 33 | ||
34 | #ifdef HAVE_HOTKEY | 34 | #ifdef HAVE_HOTKEY |
35 | const char* get_hotkey_desc(int hk_func); | 35 | int get_hotkey_lang_id(int hk_func); |
36 | |||
37 | enum hotkey_action { | ||
38 | HOTKEY_OFF = 0, | ||
39 | HOTKEY_VIEW_PLAYLIST, | ||
40 | HOTKEY_SHOW_TRACK_INFO, | ||
41 | HOTKEY_PITCHSCREEN, | ||
42 | HOTKEY_OPEN_WITH, | ||
43 | HOTKEY_DELETE, | ||
44 | HOTKEY_INSERT, | ||
45 | }; | ||
36 | #endif | 46 | #endif |
37 | 47 | ||
38 | #endif | 48 | #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 { | |||
53 | GO_TO_BROWSEPLUGINS, | 53 | GO_TO_BROWSEPLUGINS, |
54 | GO_TO_TIMESCREEN, | 54 | GO_TO_TIMESCREEN, |
55 | GO_TO_PLAYLIST_VIEWER, | 55 | GO_TO_PLAYLIST_VIEWER, |
56 | MENU_SELECTED_HOTKEY, | ||
57 | }; | 56 | }; |
58 | 57 | ||
59 | extern const struct menu_item_ex root_menu_; | 58 | 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 | |||
818 | 818 | ||
819 | #ifdef HAVE_HOTKEY | 819 | #ifdef HAVE_HOTKEY |
820 | /* hotkey assignments - acceptable values are in | 820 | /* hotkey assignments - acceptable values are in |
821 | hotkey_settings enum in onplay.c */ | 821 | hotkey_action enum in onplay.h */ |
822 | int hotkey_wps; | 822 | int hotkey_wps; |
823 | int hotkey_tree; | 823 | int hotkey_tree; |
824 | #endif | 824 | #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 @@ | |||
56 | #include "touchscreen.h" | 56 | #include "touchscreen.h" |
57 | #include "ctype.h" /* For isspace() */ | 57 | #include "ctype.h" /* For isspace() */ |
58 | #endif | 58 | #endif |
59 | #ifdef HAVE_HOTKEY | ||
60 | #include "onplay.h" | ||
61 | #endif | ||
59 | 62 | ||
60 | #define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT) | 63 | #define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT) |
61 | /** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h | 64 | /** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h |
@@ -529,6 +532,21 @@ static void tsc_set_default(void* setting, void* defaultval) | |||
529 | memcpy(setting, defaultval, sizeof(struct touchscreen_parameter)); | 532 | memcpy(setting, defaultval, sizeof(struct touchscreen_parameter)); |
530 | } | 533 | } |
531 | #endif | 534 | #endif |
535 | #ifdef HAVE_HOTKEY | ||
536 | static const char* hotkey_formatter(char* buffer, size_t buffer_size, int value, | ||
537 | const char* unit) | ||
538 | { | ||
539 | (void)buffer; | ||
540 | (void)buffer_size; | ||
541 | (void)unit; | ||
542 | return str(get_hotkey_lang_id(value)); | ||
543 | } | ||
544 | static int32_t hotkey_getlang(int value, int unit) | ||
545 | { | ||
546 | (void)unit; | ||
547 | return get_hotkey_lang_id(value); | ||
548 | } | ||
549 | #endif /* HAVE_HOTKEY */ | ||
532 | const struct settings_list settings[] = { | 550 | const struct settings_list settings[] = { |
533 | /* sound settings */ | 551 | /* sound settings */ |
534 | SOUND_SETTING(F_NO_WRAP,volume, LANG_VOLUME, "volume", SOUND_VOLUME), | 552 | SOUND_SETTING(F_NO_WRAP,volume, LANG_VOLUME, "volume", SOUND_VOLUME), |
@@ -1662,26 +1680,17 @@ const struct settings_list settings[] = { | |||
1662 | #endif | 1680 | #endif |
1663 | 1681 | ||
1664 | #ifdef HAVE_HOTKEY | 1682 | #ifdef HAVE_HOTKEY |
1665 | CHOICE_SETTING(0, hotkey_wps, -1, 1, "hotkey wps", | 1683 | TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, hotkey_wps, |
1666 | "off,view playlist,show track info,pitchscreen,open with,delete,insert", | 1684 | LANG_HOTKEY_WPS, HOTKEY_VIEW_PLAYLIST, "hotkey wps", |
1667 | NULL, 7, ID2P(LANG_OFF), | 1685 | "off,view playlist,show track info,pitchscreen,open with,delete", |
1668 | ID2P(LANG_VIEW_DYNAMIC_PLAYLIST), ID2P(LANG_MENU_SHOW_ID3_INFO), | 1686 | UNIT_INT, hotkey_formatter, hotkey_getlang, NULL, 6, HOTKEY_OFF, |
1669 | #ifdef HAVE_PITCHSCREEN | 1687 | HOTKEY_VIEW_PLAYLIST, HOTKEY_SHOW_TRACK_INFO, HOTKEY_PITCHSCREEN, |
1670 | ID2P(LANG_PITCH), | 1688 | HOTKEY_OPEN_WITH, HOTKEY_DELETE), |
1671 | #else | 1689 | TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, hotkey_tree, |
1672 | NULL, | 1690 | LANG_HOTKEY_FILE_BROWSER, HOTKEY_OFF, "hotkey tree", |
1673 | #endif | 1691 | "off,open with,delete,insert", |
1674 | ID2P(LANG_ONPLAY_OPEN_WITH), ID2P(LANG_DELETE), ID2P(LANG_INSERT)), | 1692 | UNIT_INT, hotkey_formatter, hotkey_getlang, NULL, 4, HOTKEY_OFF, |
1675 | CHOICE_SETTING(0, hotkey_tree, -1, 0, "hotkey tree", | 1693 | HOTKEY_OPEN_WITH, HOTKEY_DELETE, HOTKEY_INSERT), |
1676 | "off,view playlist,show track info,pitchscreen,open with,delete,insert", | ||
1677 | NULL, 7, ID2P(LANG_OFF), | ||
1678 | ID2P(LANG_VIEW_DYNAMIC_PLAYLIST), ID2P(LANG_MENU_SHOW_ID3_INFO), | ||
1679 | #ifdef HAVE_PITCHSCREEN | ||
1680 | ID2P(LANG_PITCH), | ||
1681 | #else | ||
1682 | NULL, | ||
1683 | #endif | ||
1684 | ID2P(LANG_ONPLAY_OPEN_WITH), ID2P(LANG_DELETE), ID2P(LANG_INSERT)), | ||
1685 | #endif | 1694 | #endif |
1686 | 1695 | ||
1687 | #if CONFIG_CODEC == SWCODEC | 1696 | #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() | |||
755 | break; | 755 | break; |
756 | #endif | 756 | #endif |
757 | 757 | ||
758 | case ACTION_STD_CONTEXT: | ||
759 | case ACTION_TREE_HOTKEY: | 758 | case ACTION_TREE_HOTKEY: |
759 | if (!global_settings.hotkey_tree) | ||
760 | break; | ||
761 | /* fall through */ | ||
762 | case ACTION_STD_CONTEXT: | ||
760 | { | 763 | { |
761 | bool hotkey = button == ACTION_TREE_HOTKEY; | 764 | bool hotkey = button == ACTION_TREE_HOTKEY; |
762 | int onplay_result; | 765 | int onplay_result; |