1
0
Fork 0
forked from len0rd/rockbox

[Feature] Add parameters when viewer is selected for open plugin

ask th user if they want to add a parameter when a viewer is set to an
open plugin entry (wps hotkey, start screen, etc)

Change-Id: I403ac79af15162aeecabb3607923113e27496e4f
This commit is contained in:
William Wilgus 2025-01-15 11:40:01 -05:00
parent 1a17b5cb8e
commit a5663ab3c0
2 changed files with 33 additions and 6 deletions

View file

@ -411,7 +411,21 @@ void open_plugin_browse(const char *key)
};
if (rockbox_browse(&browse) == GO_TO_PREVIOUS)
{
open_plugin_add_path(key, tmp_buf, NULL);
/* if this is a viewer ask the user if they want to set a parameter */
if (op_entry->lang_id > 0
&& strncmp(tmp_buf, VIEWERS_DIR, sizeof(VIEWERS_DIR) -1) == 0)
{
if (yesno_pop(ID2P(LANG_PARAMETER)))
{
strcpy(op_entry->param, str(op_entry->lang_id));
op_update_dat(op_entry, true); /* flush to disk so plugin can find it */
plugin_load(VIEWERS_DIR "/open_plugins.rock",
P2STR((unsigned char *)key));
}
}
}
}
/* open_plugin_load_entry()