diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2024-05-13 10:27:07 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2024-05-13 18:06:55 +0200 |
commit | b8b4fdd999178d6292cb6fef97ad3484a1a2dcef (patch) | |
tree | 8eb8229e2df41ab3a4afb3e01a3c6125c7336e8b | |
parent | 51a5123f5e7557d8b4b358fae77f5ed0590b217a (diff) | |
download | rockbox-b8b4fdd999178d6292cb6fef97ad3484a1a2dcef.tar.gz rockbox-b8b4fdd999178d6292cb6fef97ad3484a1a2dcef.zip |
shortcuts: voice fixes
- current time wasn't spoken
- 'sleep' shortcuts were voiced as "Time & Date"
- selected item wasn't spoken when returning
from Delete confirmation dialog
Change-Id: I3a3e8b7782323a8c02ae07302ecdfdd742e60908
-rw-r--r-- | apps/shortcuts.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/shortcuts.c b/apps/shortcuts.c index 0c5e285885..c0f9ed2612 100644 --- a/apps/shortcuts.c +++ b/apps/shortcuts.c | |||
@@ -440,6 +440,7 @@ static const char * shortcut_menu_get_name(int selected_item, void * data, | |||
440 | return sc->name[0] ? sc->name : sc->u.path; | 440 | return sc->name[0] ? sc->name : sc->u.path; |
441 | } | 441 | } |
442 | 442 | ||
443 | static int shortcut_menu_speak_item(int selected_item, void * data); | ||
443 | static int shortcut_menu_get_action(int action, struct gui_synclist *lists) | 444 | static int shortcut_menu_get_action(int action, struct gui_synclist *lists) |
444 | { | 445 | { |
445 | (void)lists; | 446 | (void)lists; |
@@ -454,6 +455,7 @@ static int shortcut_menu_get_action(int action, struct gui_synclist *lists) | |||
454 | if (confirm_delete_yesno("") != YESNO_YES) | 455 | if (confirm_delete_yesno("") != YESNO_YES) |
455 | { | 456 | { |
456 | gui_synclist_set_title(lists, lists->title, lists->title_icon); | 457 | gui_synclist_set_title(lists, lists->title, lists->title_icon); |
458 | shortcut_menu_speak_item(selection, NULL); | ||
457 | return ACTION_REDRAW; | 459 | return ACTION_REDRAW; |
458 | } | 460 | } |
459 | 461 | ||
@@ -467,6 +469,8 @@ static int shortcut_menu_get_action(int action, struct gui_synclist *lists) | |||
467 | shortcuts_ata_idle_callback(); | 469 | shortcuts_ata_idle_callback(); |
468 | if (shortcut_count == 0) | 470 | if (shortcut_count == 0) |
469 | return ACTION_STD_CANCEL; | 471 | return ACTION_STD_CANCEL; |
472 | |||
473 | shortcut_menu_speak_item(gui_synclist_get_sel_pos(lists), NULL); | ||
470 | return ACTION_REDRAW; | 474 | return ACTION_REDRAW; |
471 | } | 475 | } |
472 | return action; | 476 | return action; |
@@ -508,6 +512,7 @@ static enum themable_icons shortcut_menu_get_icon(int selected_item, void * data | |||
508 | return sc->icon; | 512 | return sc->icon; |
509 | } | 513 | } |
510 | 514 | ||
515 | void talk_timedate(void); | ||
511 | static int shortcut_menu_speak_item(int selected_item, void * data) | 516 | static int shortcut_menu_speak_item(int selected_item, void * data) |
512 | { | 517 | { |
513 | (void)data; | 518 | (void)data; |
@@ -565,11 +570,15 @@ static int shortcut_menu_speak_item(int selected_item, void * data) | |||
565 | case SHORTCUT_SETTING: | 570 | case SHORTCUT_SETTING: |
566 | talk_id(sc->u.setting->lang_id, false); | 571 | talk_id(sc->u.setting->lang_id, false); |
567 | break; | 572 | break; |
568 | #if CONFIG_RTC | ||
569 | case SHORTCUT_TIME: | 573 | case SHORTCUT_TIME: |
570 | talk_id(LANG_TIME_MENU, false); | 574 | #if CONFIG_RTC |
571 | break; | 575 | if (sc->u.timedata.talktime) |
576 | talk_timedate(); | ||
577 | else | ||
572 | #endif | 578 | #endif |
579 | if (sc->name[0]) | ||
580 | talk_spell(sc->name, false); | ||
581 | break; | ||
573 | case SHORTCUT_SHUTDOWN: | 582 | case SHORTCUT_SHUTDOWN: |
574 | if (!sc->name[0]) | 583 | if (!sc->name[0]) |
575 | { | 584 | { |
@@ -585,7 +594,6 @@ static int shortcut_menu_speak_item(int selected_item, void * data) | |||
585 | return 0; | 594 | return 0; |
586 | } | 595 | } |
587 | 596 | ||
588 | void talk_timedate(void); | ||
589 | const char* sleep_timer_formatter(char* buffer, size_t buffer_size, | 597 | const char* sleep_timer_formatter(char* buffer, size_t buffer_size, |
590 | int value, const char* unit); | 598 | int value, const char* unit); |
591 | 599 | ||
@@ -705,10 +713,7 @@ int do_shortcut_menu(void *ignored) | |||
705 | break; | 713 | break; |
706 | case SHORTCUT_TIME: | 714 | case SHORTCUT_TIME: |
707 | #if CONFIG_RTC | 715 | #if CONFIG_RTC |
708 | if (sc->u.timedata.talktime) { | 716 | if (!sc->u.timedata.talktime) |
709 | talk_timedate(); | ||
710 | talk_force_enqueue_next(); | ||
711 | } else | ||
712 | #endif | 717 | #endif |
713 | { | 718 | { |
714 | char timer_buf[10]; | 719 | char timer_buf[10]; |