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.

Use SBS title in delete confirmation screens

When deleting files or directories, you will now see
the path's basename in the previously empty title of
an SBS, making it a bit easier to immediately know
whether you've selected the correct item.

Matching titles were also added everywhere else that
confirm_delete_yesno is used.

The full path of the item is still displayed below,
and continues to scroll, so that themes without a
title, such as the default cabbiev2, will look the
same.

Change-Id: I32422cfbbf6e680f58456237380176617789cac3

authored by

Christian Soffke and committed by
Solomon Peachy
399230e9 d1c3e3b0

+52 -15
+1 -1
apps/bookmark.c
··· 1083 1083 case ACTION_BMS_DELETE: 1084 1084 if (item >= 0) 1085 1085 { 1086 - if (confirm_delete_yesno("") == YESNO_YES) 1086 + if (confirm_delete_yesno("", str(LANG_BOOKMARK_CONTEXT_MENU)) == YESNO_YES) 1087 1087 { 1088 1088 delete_bookmark(bookmark_file_name, item); 1089 1089 bookmarks->reload = true;
+1 -2
apps/fileop.c
··· 582 582 583 583 /* Note: delete_fileobject() will happily delete whatever 584 584 * path is passed (after confirmation) */ 585 - if (confirm_delete_yesno(param.path) != YESNO_YES) { 585 + if (confirm_delete_yesno(param.path, param.toplevel_name) != YESNO_YES) 586 586 return FORC_CANCELLED; 587 - } 588 587 589 588 if (param.is_dir) { 590 589 int rc = check_count_fileobjects(&param);
+17 -2
apps/gui/yesno.c
··· 31 31 #include "appevents.h" 32 32 #include "splash.h" 33 33 #include "backlight.h" 34 + #include "statusbar-skinned.h" 34 35 35 36 struct gui_yesno 36 37 { ··· 216 217 * no_message - displayed when YESNO_NO is choosen 217 218 */ 218 219 enum yesno_res gui_syncyesno_run_w_tmo(int ticks, enum yesno_res tmo_default_res, 220 + const char * title, 219 221 const struct text_message * main_message, 220 222 const struct text_message * yes_message, 221 223 const struct text_message * no_message) ··· 242 244 yn[i].display=&screens[i]; 243 245 screens[i].scroll_stop(); 244 246 viewportmanager_theme_enable(i, true, &(yn[i].vp)); 247 + if (sb_set_title_text(title, Icon_NOICON, i)) 248 + send_event(GUI_EVENT_ACTIONUPDATE, (void*)1); 249 + 245 250 yn[i].vp_lines = viewport_get_nb_lines(&(yn[i].vp)); 246 251 } 247 252 ··· 363 368 const struct text_message * yes_message, 364 369 const struct text_message * no_message) 365 370 { 366 - return gui_syncyesno_run_w_tmo(TIMEOUT_BLOCK, YESNO_TMO, 367 - main_message, yes_message, no_message); 371 + return gui_syncyesno_run_w_tmo(TIMEOUT_BLOCK, YESNO_TMO, NULL, 372 + main_message, yes_message, no_message); 373 + } 374 + 375 + extern enum yesno_res gui_syncyesno_run_w_title( 376 + const char * title, 377 + const struct text_message * main_message, 378 + const struct text_message * yes_message, 379 + const struct text_message * no_message) 380 + { 381 + return gui_syncyesno_run_w_tmo(TIMEOUT_BLOCK, YESNO_TMO, title, 382 + main_message, yes_message, no_message); 368 383 } 369 384 370 385 static bool yesno_pop_lines(const char *lines[], int line_cnt)
+12 -4
apps/gui/yesno.h
··· 50 50 const struct text_message * yes_message, 51 51 const struct text_message * no_message); 52 52 53 + /* Sets SBS title for the screen. Title may be NULL. */ 54 + extern enum yesno_res gui_syncyesno_run_w_title( 55 + const char *title, 56 + const struct text_message * main_message, 57 + const struct text_message * yes_message, 58 + const struct text_message * no_message); 59 + 53 60 extern enum yesno_res gui_syncyesno_run_w_tmo( 54 - int ticks, enum yesno_res tmo_default_res, 55 - const struct text_message * main_message, 56 - const struct text_message * yes_message, 57 - const struct text_message * no_message); 61 + int ticks, enum yesno_res tmo_default_res, 62 + const char *title, 63 + const struct text_message * main_message, 64 + const struct text_message * yes_message, 65 + const struct text_message * no_message); 58 66 59 67 bool yesno_pop(const char* text); 60 68 bool yesno_pop_confirm(const char* text);
+11
apps/hosted/android/yesno.c
··· 119 119 } 120 120 121 121 enum yesno_res gui_syncyesno_run_w_tmo(int ticks, enum yesno_res tmo_default_res, 122 + const char *title, 122 123 const struct text_message * main_message, 123 124 const struct text_message * yes_message, 124 125 const struct text_message * no_message) ··· 126 127 /* FIXME: create a prompt with timeout for android */ 127 128 (void)ticks; 128 129 (void)tmo_default_res; 130 + (void)title; /* Note: title ignored on Android */ 131 + return gui_syncyesno_run(main_message, yes_message, no_message); 132 + } 133 + 134 + enum yesno_res gui_syncyesno_run_w_title(const char *title, 135 + const struct text_message * main_message, 136 + const struct text_message * yes_message, 137 + const struct text_message * no_message) 138 + { 139 + (void)title; /* Note: title ignored on Android */ 129 140 return gui_syncyesno_run(main_message, yes_message, no_message); 130 141 } 131 142
+2 -2
apps/misc.c
··· 1277 1277 1278 1278 #if !defined(CHECKWPS) && !defined(DBTOOL) 1279 1279 1280 - int confirm_delete_yesno(const char *name) 1280 + int confirm_delete_yesno(const char *name, const char *title) 1281 1281 { 1282 1282 const char *lines[] = { ID2P(LANG_REALLY_DELETE), name }; 1283 1283 const char *yes_lines[] = { ID2P(LANG_DELETING), name }; 1284 1284 const struct text_message message = { lines, 2 }; 1285 1285 const struct text_message yes_message = { yes_lines, 2 }; 1286 - return gui_syncyesno_run(&message, &yes_message, NULL); 1286 + return gui_syncyesno_run_w_title(title, &message, &yes_message, NULL); 1287 1287 } 1288 1288 1289 1289 /* time_split_units()
+3 -1
apps/misc.h
··· 174 174 int hex_to_rgb(const char* hex, int* color); 175 175 #endif 176 176 177 - int confirm_delete_yesno(const char *name); 177 + /* Note: Don't rely on title being visible. It is not 178 + displayed on Android, or if SBS has no title. */ 179 + int confirm_delete_yesno(const char *name, const char *title); 178 180 179 181 char* strrsplt(char* str, int c); 180 182 char* skip_whitespace(char* const str);
+2 -1
apps/playlist_viewer.c
··· 646 646 if (viewer.num_tracks && yesno_pop(ID2P(LANG_SAVE_CHANGES))) 647 647 save_playlist_screen(viewer.playlist); 648 648 else if (!viewer.num_tracks && 649 - confirm_delete_yesno(viewer.playlist->filename) == YESNO_YES) 649 + confirm_delete_yesno(viewer.playlist->filename, 650 + viewer.title) == YESNO_YES) 650 651 { 651 652 remove(viewer.playlist->filename); 652 653 reload_directory();
+1 -1
apps/shortcuts.c
··· 633 633 { 634 634 int selection = gui_synclist_get_sel_pos(lists); 635 635 636 - if (confirm_delete_yesno("") != YESNO_YES) 636 + if (confirm_delete_yesno("", str(LANG_SHORTCUTS)) != YESNO_YES) 637 637 { 638 638 gui_synclist_set_title(lists, lists->title, lists->title_icon); 639 639 if (global_settings.talk_menu)
+2 -1
apps/tagcache.c
··· 5253 5253 ID2P(LANG_TAGCACHE_UPDATE)}; 5254 5254 static const struct text_message message = {lines, 2}; 5255 5255 5256 - if (gui_syncyesno_run_w_tmo(HZ * 5, YESNO_YES, &message, NULL, NULL) == YESNO_YES) 5256 + if (gui_syncyesno_run_w_tmo(HZ * 5, YESNO_YES, str(LANG_TAGCACHE), 5257 + &message, NULL, NULL) == YESNO_YES) 5257 5258 #endif 5258 5259 { 5259 5260 allocate_tempbuf();