diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-11-21 18:39:18 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-11-21 18:39:18 +0000 |
commit | bccfae0a58515e489c3aa7f412154db56ae205d6 (patch) | |
tree | e541651d8cd61b1ddd44e4860a6c7e5a8784901e | |
parent | f839ccb36fb40bb81e88ebca1f0ce6f572b01a51 (diff) | |
download | rockbox-bccfae0a58515e489c3aa7f412154db56ae205d6.tar.gz rockbox-bccfae0a58515e489c3aa7f412154db56ae205d6.zip |
Fixed crash with early USB. The USB screen already uses some of the new GUI code, so we have to init before. Fixed problem with gui_syncstatusbar_init() drawing the status bar(s) right away.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8030 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/statusbar.c | 7 | ||||
-rw-r--r-- | apps/gui/statusbar.h | 3 | ||||
-rw-r--r-- | apps/main.c | 7 | ||||
-rw-r--r-- | apps/tree.c | 3 |
4 files changed, 9 insertions, 11 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 70fe77facd..eec031fa93 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -95,13 +95,6 @@ void gui_statusbar_init(struct gui_statusbar * bar) | |||
95 | #endif | 95 | #endif |
96 | } | 96 | } |
97 | 97 | ||
98 | void gui_statusbar_set_screen(struct gui_statusbar * bar, | ||
99 | struct screen * display) | ||
100 | { | ||
101 | bar->display = display; | ||
102 | gui_statusbar_draw(bar, false); | ||
103 | } | ||
104 | |||
105 | void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | 98 | void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) |
106 | { | 99 | { |
107 | struct screen * display = bar->display; | 100 | struct screen * display = bar->display; |
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h index 77ceefd69f..e7fe92eaf9 100644 --- a/apps/gui/statusbar.h +++ b/apps/gui/statusbar.h | |||
@@ -85,7 +85,8 @@ extern void gui_statusbar_init(struct gui_statusbar * bar); | |||
85 | * - bar : the statusbar structure | 85 | * - bar : the statusbar structure |
86 | * - display : the screen to attach | 86 | * - display : the screen to attach |
87 | */ | 87 | */ |
88 | extern void gui_statusbar_set_screen(struct gui_statusbar * bar, struct screen * display); | 88 | #define gui_statusbar_set_screen(gui_statusbar, screen) \ |
89 | (gui_statusbar)->display = screen | ||
89 | 90 | ||
90 | /* | 91 | /* |
91 | * Draws the status bar on the attached screen | 92 | * Draws the status bar on the attached screen |
diff --git a/apps/main.c b/apps/main.c index 4f23dfaba4..9afb3e9a13 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -148,6 +148,9 @@ void init(void) | |||
148 | font_init(); | 148 | font_init(); |
149 | show_logo(); | 149 | show_logo(); |
150 | lang_init(); | 150 | lang_init(); |
151 | /* Must be done before any code uses the multi-screen APi */ | ||
152 | screen_access_init(); | ||
153 | gui_syncstatusbar_init(&statusbars); | ||
151 | settings_reset(); | 154 | settings_reset(); |
152 | settings_calc_config_sector(); | 155 | settings_calc_config_sector(); |
153 | settings_load(SETTINGS_ALL); | 156 | settings_load(SETTINGS_ALL); |
@@ -245,6 +248,10 @@ void init(void) | |||
245 | radio_init(); | 248 | radio_init(); |
246 | #endif | 249 | #endif |
247 | 250 | ||
251 | /* Must be done before any code uses the multi-screen APi */ | ||
252 | screen_access_init(); | ||
253 | gui_syncstatusbar_init(&statusbars); | ||
254 | |||
248 | #if defined(HAVE_CHARGING) && (CONFIG_CPU == SH7034) | 255 | #if defined(HAVE_CHARGING) && (CONFIG_CPU == SH7034) |
249 | if (coldstart && charger_inserted() | 256 | if (coldstart && charger_inserted() |
250 | && !global_settings.car_adapter_mode | 257 | && !global_settings.car_adapter_mode |
diff --git a/apps/tree.c b/apps/tree.c index f484463d2d..bed4fb28fc 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -213,8 +213,6 @@ bool check_rockboxdir(void) | |||
213 | 213 | ||
214 | void browse_root(void) | 214 | void browse_root(void) |
215 | { | 215 | { |
216 | /* essential to all programs that wants to display things */ | ||
217 | screen_access_init(); | ||
218 | gui_sync_wps_screen_init(); | 216 | gui_sync_wps_screen_init(); |
219 | 217 | ||
220 | filetype_init(); | 218 | filetype_init(); |
@@ -232,7 +230,6 @@ void browse_root(void) | |||
232 | /* since archos only have one screen, no need to create more than that */ | 230 | /* since archos only have one screen, no need to create more than that */ |
233 | gui_buttonbar_set_display(&tree_buttonbar, &(screens[SCREEN_MAIN]) ); | 231 | gui_buttonbar_set_display(&tree_buttonbar, &(screens[SCREEN_MAIN]) ); |
234 | #endif | 232 | #endif |
235 | gui_syncstatusbar_init(&statusbars); | ||
236 | gui_synclist_init(&tree_lists, &tree_get_filename, &tc); | 233 | gui_synclist_init(&tree_lists, &tree_get_filename, &tc); |
237 | gui_synclist_set_icon_callback(&tree_lists, | 234 | gui_synclist_set_icon_callback(&tree_lists, |
238 | global_settings.show_icons?&tree_get_fileicon:NULL); | 235 | global_settings.show_icons?&tree_get_fileicon:NULL); |