(Menu) Add Content Directory option

This commit is contained in:
twinaphex 2014-05-27 07:57:28 +02:00
parent bc41b942e6
commit 3a5011afcc
2 changed files with 17 additions and 1 deletions

View File

@ -298,6 +298,7 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
case RGUI_SETTINGS_PATH_OPTIONS:
file_list_clear(rgui->selection_buf);
file_list_push(rgui->selection_buf, "Browser Directory", RGUI_BROWSER_DIR_PATH, 0);
file_list_push(rgui->selection_buf, "Content Directory", RGUI_CONTENT_DIR_PATH, 0);
file_list_push(rgui->selection_buf, "Assets Directory", RGUI_ASSETS_DIR_PATH, 0);
#ifdef HAVE_DYNAMIC
file_list_push(rgui->selection_buf, "Config Directory", RGUI_CONFIG_DIR_PATH, 0);
@ -532,7 +533,9 @@ static unsigned menu_common_type_is(unsigned type)
return ret;
}
type_found = type == RGUI_BROWSER_DIR_PATH ||
type_found =
type == RGUI_BROWSER_DIR_PATH ||
type == RGUI_CONTENT_DIR_PATH ||
type == RGUI_ASSETS_DIR_PATH ||
type == RGUI_SHADER_DIR_PATH ||
type == RGUI_FILTER_DIR_PATH ||
@ -1458,6 +1461,11 @@ static int menu_common_iterate(void *data, unsigned action)
strlcpy(g_settings.rgui_content_directory, dir, sizeof(g_settings.rgui_content_directory));
menu_flush_stack_type(rgui, RGUI_SETTINGS_PATH_OPTIONS);
}
else if (menu_type == RGUI_CONTENT_DIR_PATH)
{
strlcpy(g_settings.content_directory, dir, sizeof(g_settings.content_directory));
menu_flush_stack_type(rgui, RGUI_SETTINGS_PATH_OPTIONS);
}
else if (menu_type == RGUI_ASSETS_DIR_PATH)
{
strlcpy(g_settings.assets_directory, dir, sizeof(g_settings.assets_directory));
@ -3013,6 +3021,10 @@ static int menu_common_setting_set(void *data, unsigned setting, unsigned action
if (action == RGUI_ACTION_START)
*g_settings.rgui_content_directory = '\0';
break;
case RGUI_CONTENT_DIR_PATH:
if (action == RGUI_ACTION_START)
*g_settings.content_directory = '\0';
break;
case RGUI_ASSETS_DIR_PATH:
if (action == RGUI_ACTION_START)
*g_settings.assets_directory = '\0';
@ -4066,6 +4078,9 @@ static void menu_common_setting_set_label(char *type_str, size_t type_str_size,
case RGUI_BROWSER_DIR_PATH:
strlcpy(type_str, *g_settings.rgui_content_directory ? g_settings.rgui_content_directory : "<default>", type_str_size);
break;
case RGUI_CONTENT_DIR_PATH:
strlcpy(type_str, *g_settings.content_directory ? g_settings.content_directory : "<default>", type_str_size);
break;
case RGUI_ASSETS_DIR_PATH:
strlcpy(type_str, *g_settings.assets_directory ? g_settings.assets_directory : "<default>", type_str_size);
break;

View File

@ -117,6 +117,7 @@ typedef enum
RGUI_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST,
RGUI_SCREENSHOT_DIR_PATH,
RGUI_BROWSER_DIR_PATH,
RGUI_CONTENT_DIR_PATH,
RGUI_ASSETS_DIR_PATH,
RGUI_FILTER_DIR_PATH,
RGUI_DSP_FILTER_DIR_PATH,