summaryrefslogtreecommitdiff
path: root/apps/gui/wps.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/wps.c')
-rw-r--r--apps/gui/wps.c55
1 files changed, 12 insertions, 43 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 757160a586..e500f1c2d9 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -88,9 +88,6 @@ static struct wps_sync_data wps_sync_data = { .do_full_update = false
88static void wps_state_init(void); 88static void wps_state_init(void);
89static void track_changed_callback(void *param); 89static void track_changed_callback(void *param);
90static void nextid3available_callback(void* param); 90static void nextid3available_callback(void* param);
91#ifdef HAVE_LCD_BITMAP
92static void statusbar_toggle_handler(void *data);
93#endif
94 91
95#define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" 92#define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps"
96#ifdef HAVE_REMOTE_LCD 93#ifdef HAVE_REMOTE_LCD
@@ -562,24 +559,21 @@ static void wps_lcd_activation_hook(void *param)
562 559
563static void gwps_leave_wps(void) 560static void gwps_leave_wps(void)
564{ 561{
565 int i, oldbars = VP_SB_HIDE_ALL; 562 int i;
566 563
567 FOR_NB_SCREENS(i) 564 FOR_NB_SCREENS(i)
568 { 565 {
569 gui_wps[i].display->stop_scroll(); 566 gui_wps[i].display->stop_scroll();
570 gui_wps[i].display->backdrop_show(BACKDROP_MAIN); 567 gui_wps[i].display->backdrop_show(BACKDROP_MAIN);
571 if (statusbar_position(i) != STATUSBAR_OFF) 568 viewportmanager_theme_undo(i);
572 oldbars |= VP_SB_ONSCREEN(i);
573 } 569 }
574 570
575 viewportmanager_set_statusbar(oldbars);
576#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 571#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
577 /* Play safe and unregister the hook */ 572 /* Play safe and unregister the hook */
578 remove_event(LCD_EVENT_ACTIVATION, wps_lcd_activation_hook); 573 remove_event(LCD_EVENT_ACTIVATION, wps_lcd_activation_hook);
579#endif 574#endif
580 /* unhandle statusbar update delay */ 575 /* unhandle statusbar update delay */
581 sb_skin_set_update_delay(DEFAULT_UPDATE_DELAY); 576 sb_skin_set_update_delay(DEFAULT_UPDATE_DELAY);
582 send_event(GUI_EVENT_REFRESH, NULL);
583} 577}
584 578
585/* 579/*
@@ -591,6 +585,14 @@ static void gwps_enter_wps(void)
591 { 585 {
592 struct gui_wps *gwps = &gui_wps[i]; 586 struct gui_wps *gwps = &gui_wps[i];
593 struct screen *display = gwps->display; 587 struct screen *display = gwps->display;
588#ifdef HAVE_LCD_BITMAP
589 bool draw = false;
590 if (gui_wps[i].data->wps_sb_tag)
591 draw = gui_wps[i].data->show_sb_on_wps;
592 else if (statusbar_position(i) != STATUSBAR_OFF)
593 draw = true;
594#endif
595 viewportmanager_theme_enable(i, draw, NULL);
594 596
595 display->stop_scroll(); 597 display->stop_scroll();
596 /* Update the values in the first (default) viewport - in case the user 598 /* Update the values in the first (default) viewport - in case the user
@@ -725,8 +727,6 @@ long gui_wps_show(void)
725#ifdef HAVE_LCD_CHARCELLS 727#ifdef HAVE_LCD_CHARCELLS
726 status_set_audio(true); 728 status_set_audio(true);
727 status_set_param(false); 729 status_set_param(false);
728#else
729 statusbar_toggle_handler(NULL);
730#endif 730#endif
731 731
732#ifdef AB_REPEAT_ENABLE 732#ifdef AB_REPEAT_ENABLE
@@ -734,7 +734,7 @@ long gui_wps_show(void)
734 ab_reset_markers(); 734 ab_reset_markers();
735#endif 735#endif
736 wps_state_init(); 736 wps_state_init();
737 737
738 while ( 1 ) 738 while ( 1 )
739 { 739 {
740 bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false; 740 bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false;
@@ -1176,8 +1176,8 @@ long gui_wps_show(void)
1176 sb_skin_set_update_delay(0); 1176 sb_skin_set_update_delay(0);
1177 FOR_NB_SCREENS(i) 1177 FOR_NB_SCREENS(i)
1178 gui_wps[i].display->backdrop_show(BACKDROP_SKIN_WPS); 1178 gui_wps[i].display->backdrop_show(BACKDROP_SKIN_WPS);
1179 send_event(GUI_EVENT_REFRESH, gwps_enter_wps);
1180 wps_sync_data.do_full_update = update = false; 1179 wps_sync_data.do_full_update = update = false;
1180 gwps_enter_wps();
1181 } 1181 }
1182 else if (wps_sync_data.do_full_update || update) 1182 else if (wps_sync_data.do_full_update || update)
1183 { 1183 {
@@ -1271,33 +1271,6 @@ static void wps_state_init(void)
1271} 1271}
1272 1272
1273 1273
1274#ifdef HAVE_LCD_BITMAP
1275static void statusbar_toggle_handler(void *data)
1276{
1277 (void)data;
1278 int i;
1279
1280 int *wpsbars = &wps_sync_data.statusbars;
1281 *wpsbars = VP_SB_HIDE_ALL;
1282 FOR_NB_SCREENS(i)
1283 { /* fix viewports if needed */
1284 skin_statusbar_changed(&gui_wps[i]);
1285
1286 bool draw = false;
1287
1288 /* fix up gui_wps::statusbars, so that the viewportmanager accepts it*/
1289 if (gui_wps[i].data->wps_sb_tag)
1290 draw = gui_wps[i].data->show_sb_on_wps;
1291 else if (statusbar_position(i) != STATUSBAR_OFF)
1292 draw = true;
1293 if (draw)
1294 *wpsbars |=
1295 (VP_SB_ONSCREEN(i) | VP_SB_IGNORE_SETTING(i));
1296 }
1297}
1298#endif
1299
1300
1301void gui_sync_wps_init(void) 1274void gui_sync_wps_init(void)
1302{ 1275{
1303 int i; 1276 int i;
@@ -1315,11 +1288,7 @@ void gui_sync_wps_init(void)
1315 gui_wps[i].display->backdrop_unload(BACKDROP_SKIN_WPS); 1288 gui_wps[i].display->backdrop_unload(BACKDROP_SKIN_WPS);
1316 /* must point to the same struct for both screens */ 1289 /* must point to the same struct for both screens */
1317 gui_wps[i].sync_data = &wps_sync_data; 1290 gui_wps[i].sync_data = &wps_sync_data;
1318 gui_wps[i].sync_data->statusbars = VP_SB_ALLSCREENS;
1319 } 1291 }
1320#ifdef HAVE_LCD_BITMAP
1321 add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, statusbar_toggle_handler);
1322#endif
1323} 1292}
1324 1293
1325 1294