summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-03-07 10:07:49 -0500
committerWilliam Wilgus <wilgus.william@gmail.com>2021-03-07 10:07:49 -0500
commit9712d375ce31d8394cc30b9121577a7646c1af12 (patch)
tree15496f9654ae0fbeecb50017d48b34f2f6463216 /apps
parent0dce97372987a0b25446c33c7bfd616780d9d7c0 (diff)
downloadrockbox-9712d375ce31d8394cc30b9121577a7646c1af12.tar.gz
rockbox-9712d375ce31d8394cc30b9121577a7646c1af12.tar.bz2
rockbox-9712d375ce31d8394cc30b9121577a7646c1af12.zip
Shortcuts.c -- Update
Fix returns from shortcuts -- should now run plugins Fix formatting of file names to remove path from browser shortcuts Change-Id: I46e337110d04b84bedcb0c2945d5dd29a1860847
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/quickscreen.c4
-rw-r--r--apps/gui/quickscreen.h2
-rw-r--r--apps/gui/wps.c7
-rw-r--r--apps/menu.c8
-rw-r--r--apps/root_menu.c32
-rw-r--r--apps/shortcuts.c13
-rw-r--r--apps/tree.c7
7 files changed, 51 insertions, 22 deletions
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index b5113df8f6..f1c95ffef2 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -398,7 +398,7 @@ static const struct settings_list *get_setting(int gs_value,
return defaultval;
}
-bool quick_screen_quick(int button_enter)
+int quick_screen_quick(int button_enter)
{
struct gui_quickscreen qs;
bool oldshuffle = global_settings.playlist_shuffle;
@@ -439,7 +439,7 @@ bool quick_screen_quick(int button_enter)
playlist_sort(NULL, true);
}
}
- return usb;
+ return (usb ? 1:0);
}
/* stuff to make the quickscreen configurable */
diff --git a/apps/gui/quickscreen.h b/apps/gui/quickscreen.h
index acce5cf9bf..015928ee8a 100644
--- a/apps/gui/quickscreen.h
+++ b/apps/gui/quickscreen.h
@@ -43,7 +43,7 @@ struct gui_quickscreen
item is changed */
};
-extern bool quick_screen_quick(int button_enter);
+extern int quick_screen_quick(int button_enter);
int quickscreen_set_option(void *data);
bool is_setting_quickscreenable(const struct settings_list *setting);
void set_as_qs_item(const struct settings_list *setting,
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 846c952baf..78ab8dc8dd 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -836,7 +836,12 @@ long gui_wps_show(void)
case ACTION_WPS_QUICKSCREEN:
{
gwps_leave_wps();
- if (quick_screen_quick(button))
+ if (global_settings.shortcuts_replaces_qs)
+ {
+ global_status.last_screen = GO_TO_SHORTCUTMENU;
+ return quick_screen_quick(button);
+ }
+ else if (quick_screen_quick(button) > 0)
return GO_TO_ROOT;
restore = true;
}
diff --git a/apps/menu.c b/apps/menu.c
index fefc8fca2b..30a098f331 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -427,7 +427,13 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
#ifdef HAVE_QUICKSCREEN
else if (action == ACTION_STD_QUICKSCREEN)
{
- quick_screen_quick(action);
+ if (global_settings.shortcuts_replaces_qs)
+ {
+ global_status.last_screen = GO_TO_SHORTCUTMENU;
+ ret = quick_screen_quick(action);
+ }
+ else
+ quick_screen_quick(action);
redraw_lists = true;
}
#endif
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 77a092018a..fb7b5218e2 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -822,21 +822,27 @@ void root_menu(void)
case GO_TO_PLUGIN:
{
char *key;
- switch (last_screen)
+ if (global_status.last_screen == GO_TO_SHORTCUTMENU)
{
- case GO_TO_ROOT:
- key = ID2P(LANG_START_SCREEN);
- break;
- case GO_TO_WPS:
- key = ID2P(LANG_OPEN_PLUGIN_SET_WPS_CONTEXT_PLUGIN);
- break;
- case GO_TO_SHORTCUTMENU:
- key = ID2P(LANG_SHORTCUTS);
- break;
- default:
- key = ID2P(LANG_OPEN_PLUGIN);
- break;
+ global_status.last_screen = last_screen;
+ key = ID2P(LANG_SHORTCUTS);
}
+ else
+ switch (last_screen)
+ {
+ case GO_TO_ROOT:
+ key = ID2P(LANG_START_SCREEN);
+ break;
+ case GO_TO_WPS:
+ key = ID2P(LANG_OPEN_PLUGIN_SET_WPS_CONTEXT_PLUGIN);
+ break;
+ case GO_TO_SHORTCUTMENU:
+ key = ID2P(LANG_SHORTCUTS);
+ break;
+ default:
+ key = ID2P(LANG_OPEN_PLUGIN);
+ break;
+ }
open_plugin_get_entry(key, &open_plugin_entry);
char *path = open_plugin_entry.path;
diff --git a/apps/shortcuts.c b/apps/shortcuts.c
index aa9a32bbb2..70f140d42e 100644
--- a/apps/shortcuts.c
+++ b/apps/shortcuts.c
@@ -395,8 +395,6 @@ static const char * shortcut_menu_get_name(int selected_item, void * data,
char * buffer, size_t buffer_len)
{
(void)data;
- (void)buffer;
- (void)buffer_len;
struct shortcut *sc = get_shortcut(selected_item);
if (!sc)
return "";
@@ -409,6 +407,16 @@ static const char * shortcut_menu_get_name(int selected_item, void * data,
/* No translation support as only soft_shutdown has LANG_SHUTDOWN defined */
return type_strings[SHORTCUT_SHUTDOWN];
}
+ else if (sc->type == SHORTCUT_BROWSER && (sc->u.path)[0] != '\0')
+ {
+ char* pos;
+ if (path_basename(sc->u.path, (const char **)&pos) > 0)
+ {
+ if (snprintf(buffer, buffer_len, "%s (%s)", pos, sc->u.path) < (int)buffer_len)
+ return buffer;
+ }
+ }
+
return sc->name[0] ? sc->name : sc->u.path;
}
@@ -609,7 +617,6 @@ int do_shortcut_menu(void *ignored)
/* else fall through */
case SHORTCUT_BROWSER:
{
-
if(open_plugin_add_path(ID2P(LANG_SHORTCUTS), sc->u.path, NULL) != 0)
{
done = GO_TO_PLUGIN;
diff --git a/apps/tree.c b/apps/tree.c
index fc54b06f33..44af918804 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -738,7 +738,12 @@ static int dirbrowse(void)
/* don't enter f2 from plugin browser */
if (*tc.dirfilter < NUM_FILTER_MODES)
{
- if (quick_screen_quick(button))
+ if (global_settings.shortcuts_replaces_qs)
+ {
+ global_status.last_screen = GO_TO_SHORTCUTMENU;
+ return quick_screen_quick(button);
+ }
+ else if (quick_screen_quick(button))
reload_dir = true;
restore = true;
}