summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-24 00:03:59 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-24 00:03:59 +0000
commit5850207d332f78d4fcf4a7ec22ae8b95b921a183 (patch)
tree3a2be4c63c11c69b1a1fae5d0a5008bf217677c1
parent19f44a61cfb333c363d823e43b5de282ef2d2ed0 (diff)
downloadrockbox-5850207d332f78d4fcf4a7ec22ae8b95b921a183.tar.gz
rockbox-5850207d332f78d4fcf4a7ec22ae8b95b921a183.tar.bz2
rockbox-5850207d332f78d4fcf4a7ec22ae8b95b921a183.zip
Slightly change parts of the previous commit to reuse existing code, and enforce enum statusbar_values instead of just int,
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22485 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/statusbar.c10
-rw-r--r--apps/gui/statusbar.h2
-rw-r--r--apps/menus/display_menu.c8
-rw-r--r--apps/settings.h4
4 files changed, 6 insertions, 18 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index 1a724406ef..7a361e58ed 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -827,13 +827,7 @@ void gui_statusbar_changed( enum screen_type screen,
enum statusbar_values old)
{
/* clear and update the statusbar area to remove old parts */
- enum statusbar_values bar;
-#ifdef HAVE_REMOTE_LCD
- if (screen == SCREEN_REMOTE)
- bar = global_settings.remote_statusbar;
- else
-#endif
- bar = global_settings.statusbar;
+ enum statusbar_values bar = statusbar_position(screen);
struct screen *display = &screens[screen];
struct viewport vp;
@@ -850,7 +844,7 @@ void gui_statusbar_changed( enum screen_type screen,
#endif
#ifdef HAVE_REMOTE_LCD
-int statusbar_position(int screen)
+enum statusbar_values statusbar_position(int screen)
{
if (screen == SCREEN_REMOTE)
return global_settings.remote_statusbar;
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h
index 169b76b15a..84d37858e2 100644
--- a/apps/gui/statusbar.h
+++ b/apps/gui/statusbar.h
@@ -107,7 +107,7 @@ void gui_statusbar_changed(enum screen_type screen,
#if !defined(HAVE_REMOTE_LCD) || defined(__PCTOOL__)
#define statusbar_position(a) (global_settings.statusbar)
#else
-int statusbar_position(int screen);
+enum statusbar_values statusbar_position(int screen);
#endif
#endif /*_GUI_STATUSBAR_H_*/
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
index 0b2769831e..04360d8251 100644
--- a/apps/menus/display_menu.c
+++ b/apps/menus/display_menu.c
@@ -319,13 +319,7 @@ static int statusbar_callback_ex(int action,const struct menu_item_ex *this_item
switch (action)
{
case ACTION_ENTER_MENUITEM:
-#ifdef HAVE_REMOTE_LCD
- if (screen == SCREEN_REMOTE)
- old_bar[screen] = global_settings.remote_statusbar;
- else
-#endif
- old_bar[screen] = global_settings.statusbar;
- break;
+ old_bar[screen] = statusbar_position(screen);
case ACTION_EXIT_MENUITEM:
gui_statusbar_changed(screen, old_bar[screen]);
send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL);
diff --git a/apps/settings.h b/apps/settings.h
index 1365736ecf..bd28b99401 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -552,9 +552,9 @@ struct user_settings
int volume_type; /* how volume is displayed: 0=graphic, 1=percent */
int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
bool show_icons; /* 0=hide 1=show */
- int statusbar; /* STATUSBAR_* enum values */
+ enum statusbar_values statusbar; /* STATUSBAR_* enum values */
#ifdef HAVE_REMOTE_LCD
- int remote_statusbar;
+ enum statusbar_values remote_statusbar;
#endif
#if CONFIG_KEYPAD == RECORDER_PAD