Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

move confirm delete prompt to misc.c

Change-Id: Iadb1c7199caa5070f555eb4d329efb02e3193289

+14 -22
+1 -11
apps/bookmark.c
··· 831 831 case ACTION_BMS_DELETE: 832 832 if (item >= 0) 833 833 { 834 - const char *lines[]={ 835 - ID2P(LANG_REALLY_DELETE) 836 - }; 837 - const char *yes_lines[]={ 838 - ID2P(LANG_DELETING) 839 - }; 840 - 841 - const struct text_message message={lines, 1}; 842 - const struct text_message yes_message={yes_lines, 1}; 843 - 844 - if(gui_syncyesno_run(&message, &yes_message, NULL)==YESNO_YES) 834 + if (confirm_delete_yesno("") == YESNO_YES) 845 835 { 846 836 delete_bookmark(bookmark_file_name, item); 847 837 bookmarks->reload = true;
+8
apps/misc.c
··· 1133 1133 return rdbufend >= 0 ? num_read : -1; 1134 1134 } 1135 1135 1136 + int confirm_delete_yesno(const char *name) 1137 + { 1138 + const char *lines[] = { ID2P(LANG_REALLY_DELETE), name }; 1139 + const char *yes_lines[] = { ID2P(LANG_DELETING), name }; 1140 + const struct text_message message = { lines, 2 }; 1141 + const struct text_message yes_message = { yes_lines, 2 }; 1142 + return gui_syncyesno_run(&message, &yes_message, NULL); 1143 + } 1136 1144 1137 1145 char* skip_whitespace(char* const str) 1138 1146 {
+2
apps/misc.h
··· 143 143 int hex_to_rgb(const char* hex, int* color); 144 144 #endif 145 145 146 + int confirm_delete_yesno(const char *name); 147 + 146 148 char* strrsplt(char* str, int c); 147 149 char* skip_whitespace(char* const str); 148 150
+2 -10
apps/onplay.c
··· 63 63 #include "viewport.h" 64 64 #include "pathfuncs.h" 65 65 #include "shortcuts.h" 66 + #include "misc.h" 66 67 67 68 static int context; 68 69 static const char *selected_file = NULL; ··· 898 899 return gui_syncyesno_run(&message, NULL, NULL); 899 900 } 900 901 901 - static int confirm_delete(const char *file) 902 - { 903 - const char *lines[] = { ID2P(LANG_REALLY_DELETE), file }; 904 - const char *yes_lines[] = { ID2P(LANG_DELETING), file }; 905 - const struct text_message message = { lines, 2 }; 906 - const struct text_message yes_message = { yes_lines, 2 }; 907 - return gui_syncyesno_run(&message, &yes_message, NULL); 908 - } 909 - 910 902 static bool check_new_name(const char *basename) 911 903 { 912 904 /* at least prevent escapes out of the base directory from keyboard- ··· 1001 993 { 1002 994 const char *to_delete=selected_file; 1003 995 const int to_delete_attr=selected_file_attr; 1004 - if (confirm_delete(to_delete) != YESNO_YES) { 996 + if (confirm_delete_yesno(to_delete) != YESNO_YES) { 1005 997 return 1; 1006 998 } 1007 999
+1 -1
apps/shortcuts.c
··· 454 454 { 455 455 int selection = gui_synclist_get_sel_pos(lists); 456 456 457 - if (!yesno_pop(ID2P(LANG_REALLY_DELETE))) 457 + if (confirm_delete_yesno("") != YESNO_YES) 458 458 { 459 459 gui_synclist_set_title(lists, lists->title, lists->title_icon); 460 460 return ACTION_REDRAW;