diff options
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/quickscreen.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c index 64d938d8aa..908e1183f2 100644 --- a/apps/gui/quickscreen.c +++ b/apps/gui/quickscreen.c | |||
@@ -305,7 +305,7 @@ static int quickscreen_touchscreen_button(const struct viewport | |||
305 | } | 305 | } |
306 | #endif | 306 | #endif |
307 | 307 | ||
308 | static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) | 308 | static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter, bool *usb) |
309 | { | 309 | { |
310 | int button; | 310 | int button; |
311 | struct viewport parent[NB_SCREENS]; | 311 | struct viewport parent[NB_SCREENS]; |
@@ -317,7 +317,7 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente | |||
317 | * - an action taken while pressing the enter button, | 317 | * - an action taken while pressing the enter button, |
318 | * then release the enter button*/ | 318 | * then release the enter button*/ |
319 | bool can_quit = false; | 319 | bool can_quit = false; |
320 | 320 | ||
321 | push_current_activity(ACTIVITY_QUICKSCREEN); | 321 | push_current_activity(ACTIVITY_QUICKSCREEN); |
322 | 322 | ||
323 | FOR_NB_SCREENS(i) | 323 | FOR_NB_SCREENS(i) |
@@ -328,6 +328,7 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente | |||
328 | quickscreen_fix_viewports(qs, &screens[i], &parent[i], vps[i], &vp_icons[i]); | 328 | quickscreen_fix_viewports(qs, &screens[i], &parent[i], vps[i], &vp_icons[i]); |
329 | gui_quickscreen_draw(qs, &screens[i], &parent[i], vps[i], &vp_icons[i]); | 329 | gui_quickscreen_draw(qs, &screens[i], &parent[i], vps[i], &vp_icons[i]); |
330 | } | 330 | } |
331 | *usb = false; | ||
331 | /* Announce current selection on entering this screen. This is all | 332 | /* Announce current selection on entering this screen. This is all |
332 | queued up, but can be interrupted as soon as a setting is | 333 | queued up, but can be interrupted as soon as a setting is |
333 | changed. */ | 334 | changed. */ |
@@ -343,7 +344,10 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente | |||
343 | button = quickscreen_touchscreen_button(vps[SCREEN_MAIN]); | 344 | button = quickscreen_touchscreen_button(vps[SCREEN_MAIN]); |
344 | #endif | 345 | #endif |
345 | if (default_event_handler(button) == SYS_USB_CONNECTED) | 346 | if (default_event_handler(button) == SYS_USB_CONNECTED) |
346 | return(true); | 347 | { |
348 | *usb = true; | ||
349 | break; | ||
350 | } | ||
347 | if (gui_quickscreen_do_button(qs, button)) | 351 | if (gui_quickscreen_do_button(qs, button)) |
348 | { | 352 | { |
349 | changed = true; | 353 | changed = true; |
@@ -390,6 +394,7 @@ bool quick_screen_quick(int button_enter) | |||
390 | struct gui_quickscreen qs; | 394 | struct gui_quickscreen qs; |
391 | bool oldshuffle = global_settings.playlist_shuffle; | 395 | bool oldshuffle = global_settings.playlist_shuffle; |
392 | int oldrepeat = global_settings.repeat_mode; | 396 | int oldrepeat = global_settings.repeat_mode; |
397 | bool usb = false; | ||
393 | 398 | ||
394 | if (global_settings.shortcuts_replaces_qs) | 399 | if (global_settings.shortcuts_replaces_qs) |
395 | return do_shortcut_menu(NULL); | 400 | return do_shortcut_menu(NULL); |
@@ -406,7 +411,7 @@ bool quick_screen_quick(int button_enter) | |||
406 | get_setting(global_settings.qs_items[QUICKSCREEN_BOTTOM], NULL); | 411 | get_setting(global_settings.qs_items[QUICKSCREEN_BOTTOM], NULL); |
407 | 412 | ||
408 | qs.callback = NULL; | 413 | qs.callback = NULL; |
409 | if (gui_syncquickscreen_run(&qs, button_enter)) | 414 | if (gui_syncquickscreen_run(&qs, button_enter, &usb)) |
410 | { | 415 | { |
411 | settings_save(); | 416 | settings_save(); |
412 | settings_apply(false); | 417 | settings_apply(false); |
@@ -426,13 +431,14 @@ bool quick_screen_quick(int button_enter) | |||
426 | playlist_sort(NULL, true); | 431 | playlist_sort(NULL, true); |
427 | } | 432 | } |
428 | } | 433 | } |
429 | return(0); | 434 | return usb; |
430 | } | 435 | } |
431 | 436 | ||
432 | #ifdef BUTTON_F3 | 437 | #ifdef BUTTON_F3 |
433 | bool quick_screen_f3(int button_enter) | 438 | bool quick_screen_f3(int button_enter) |
434 | { | 439 | { |
435 | struct gui_quickscreen qs; | 440 | struct gui_quickscreen qs; |
441 | bool usb = false: | ||
436 | qs.items[QUICKSCREEN_TOP] = NULL; | 442 | qs.items[QUICKSCREEN_TOP] = NULL; |
437 | qs.items[QUICKSCREEN_LEFT] = | 443 | qs.items[QUICKSCREEN_LEFT] = |
438 | find_setting(&global_settings.scrollbar, NULL); | 444 | find_setting(&global_settings.scrollbar, NULL); |
@@ -445,12 +451,12 @@ bool quick_screen_f3(int button_enter) | |||
445 | NULL; | 451 | NULL; |
446 | #endif | 452 | #endif |
447 | qs.callback = NULL; | 453 | qs.callback = NULL; |
448 | if (gui_syncquickscreen_run(&qs, button_enter)) | 454 | if (gui_syncquickscreen_run(&qs, button_enter), &usb) |
449 | { | 455 | { |
450 | settings_save(); | 456 | settings_save(); |
451 | settings_apply(false); | 457 | settings_apply(false); |
452 | } | 458 | } |
453 | return(0); | 459 | return usb; |
454 | } | 460 | } |
455 | #endif /* BUTTON_F3 */ | 461 | #endif /* BUTTON_F3 */ |
456 | 462 | ||