summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-06-01 14:41:49 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-06-01 14:41:49 +0000
commitb58d3656d79e5f9752a22d55c139294412084e4f (patch)
treebd98c9d2ab0db1e0df432814bb398cdb49739fe1 /apps/gui
parentc54f4b34400ea96bd3e2d86ba919a0ae509a56a9 (diff)
FS#11925 - Add a proper system to keep track of the current screen/activity to make %cs far more useful
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29944 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/option_select.c2
-rw-r--r--apps/gui/quickscreen.c4
-rw-r--r--apps/gui/skin_engine/skin_render.c2
-rw-r--r--apps/gui/skin_engine/skin_tokens.c32
4 files changed, 8 insertions, 32 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c
index f954268c18..7f829d26c3 100644
--- a/apps/gui/option_select.c
+++ b/apps/gui/option_select.c
@@ -486,6 +486,7 @@ bool option_screen(const struct settings_list *setting,
temp_var = oldvalue = *(bool*)setting->setting?1:0;
}
else return false; /* only int/bools can go here */
+ push_current_activity(ACTIVITY_OPTIONSELECT);
gui_synclist_init(&lists, value_setting_get_name_cb,
(void*)setting, false, 1, parent);
if (setting->lang_id == -1)
@@ -566,6 +567,7 @@ bool option_screen(const struct settings_list *setting,
if (function == sound_get_fn(SOUND_VOLUME))
global_status.last_volume_change = current_tick;
}
+ pop_current_activity();
return false;
}
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index f03043d611..3922c94c4b 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -317,6 +317,9 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente
* - an action taken while pressing the enter button,
* then release the enter button*/
bool can_quit = false;
+
+ push_current_activity(ACTIVITY_QUICKSCREEN);
+
FOR_NB_SCREENS(i)
{
screens[i].set_viewport(NULL);
@@ -369,6 +372,7 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente
viewportmanager_theme_undo(i, true);
}
+ pop_current_activity();
return changed;
}
diff --git a/apps/gui/skin_engine/skin_render.c b/apps/gui/skin_engine/skin_render.c
index 3037a955c7..349dc07d0a 100644
--- a/apps/gui/skin_engine/skin_render.c
+++ b/apps/gui/skin_engine/skin_render.c
@@ -780,7 +780,7 @@ static __attribute__((noinline)) void skin_render_playlistviewer(struct playlist
int cur_pos, start_item, max;
int nb_lines = viewport_get_nb_lines(viewer->vp);
#if CONFIG_TUNER
- if (current_screen() == GO_TO_FM)
+ if (get_current_activity() == ACTIVITY_FM)
{
cur_pos = radio_current_preset();
start_item = cur_pos + viewer->start_offset;
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 3aa7947edc..3c6a817ea8 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -1730,37 +1730,7 @@ const char *get_token_value(struct gui_wps *gwps,
case SKIN_TOKEN_CURRENT_SCREEN:
{
- int curr_screen = current_screen();
-
-#ifdef HAVE_RECORDING
- /* override current_screen() for recording screen since it may
- * be entered from the radio screen */
- if (in_recording_screen())
- curr_screen = GO_TO_RECSCREEN;
-#endif
-
- switch (curr_screen)
- {
- case GO_TO_WPS:
- curr_screen = 2;
- break;
-#ifdef HAVE_RECORDING
- case GO_TO_RECSCREEN:
- curr_screen = 3;
- break;
-#endif
-#if CONFIG_TUNER
- case GO_TO_FM:
- curr_screen = 4;
- break;
-#endif
- case GO_TO_PLAYLIST_VIEWER:
- curr_screen = 5;
- break;
- default: /* lists */
- curr_screen = 1;
- break;
- }
+ int curr_screen = get_current_activity();
if (intval)
{
*intval = curr_screen;