Skip to content
Open

Profiles #19067

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include "file_path_special.h"
#include "command.h"
#include "configuration.h"
#include "profile_manager.h"
#include "profile_manager.c"
#include "content.h"
#include "config.def.h"
#include "config.features.h"
Expand Down Expand Up @@ -3816,9 +3818,23 @@ void config_set_defaults(void *data)
*/
void config_load(void *data)
{
global_t *global = (global_t*)data;
global_t *global = (global_t*)data;
const char *config_path = path_get(RARCH_PATH_CONFIG);

config_set_defaults(global);
#ifdef HAVE_CONFIGFILE
if (config_path && *config_path)
{
char config_dir[PATH_MAX_LENGTH];
char profile_redirect[PATH_MAX_LENGTH];
fill_pathname_basedir(config_dir, config_path, sizeof(config_dir));

profile_manager_init(config_dir, config_path);

if (profile_manager_get_startup_redirect(config_path,
profile_redirect, sizeof(profile_redirect)))
path_set(RARCH_PATH_CONFIG, profile_redirect);
}
config_parse_file(global);
#endif
}
Expand Down Expand Up @@ -4192,6 +4208,27 @@ static bool config_load_file(global_t *global,
}
#endif

if (conf)
{
const char *current_config_path = path_get(RARCH_PATH_CONFIG);
if (!path_is_empty(RARCH_PATH_CONFIG))
{
char config_dir[PATH_MAX_LENGTH];
char profile_redirect[PATH_MAX_LENGTH];
fill_pathname_basedir(config_dir, current_config_path, sizeof(config_dir));

profile_manager_init(config_dir, current_config_path);

if (profile_manager_get_startup_redirect(current_config_path,
profile_redirect, sizeof(profile_redirect)))
{
config_file_free(conf);
path_set(RARCH_PATH_CONFIG, profile_redirect);
conf = config_file_new_from_path_to_string(profile_redirect);
}
}
}

if (!conf)
{
first_load = false;
Expand Down
32 changes: 32 additions & 0 deletions intl/msg_hash_lbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,34 @@ MSG_HASH(
MENU_ENUM_LABEL_CONFIGURATIONS_LIST,
MENU_ENUM_LABEL_CONFIGURATIONS_LIST_STR
)
MSG_HASH(
MENU_ENUM_LABEL_PROFILES_LIST,
MENU_ENUM_LABEL_PROFILES_LIST_STR
)
MSG_HASH(
MENU_ENUM_LABEL_PROFILE_CREATE,
MENU_ENUM_LABEL_PROFILE_CREATE_STR
)
MSG_HASH(
MENU_ENUM_LABEL_PROFILE_SELECT,
MENU_ENUM_LABEL_PROFILE_SELECT_STR
)
MSG_HASH(
MENU_ENUM_LABEL_PROFILE_ICON_SELECT,
MENU_ENUM_LABEL_PROFILE_ICON_SELECT_STR
)
MSG_HASH(
MENU_ENUM_LABEL_PROFILE_SAVE_CURRENT,
MENU_ENUM_LABEL_PROFILE_SAVE_CURRENT_STR
)
MSG_HASH(
MENU_ENUM_LABEL_PROFILE_SAVE_NEW,
MENU_ENUM_LABEL_PROFILE_SAVE_NEW_STR
)
MSG_HASH(
MENU_ENUM_LABEL_PROFILE_DELETE,
MENU_ENUM_LABEL_PROFILE_DELETE_STR
)
MSG_HASH(
MENU_ENUM_LABEL_EXPLORE_TAB,
MENU_ENUM_LABEL_EXPLORE_TAB_STR
Expand Down Expand Up @@ -1004,6 +1032,10 @@ MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_CONFIGURATIONS_LIST,
MENU_ENUM_LABEL_DEFERRED_CONFIGURATIONS_LIST_STR
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_PROFILES_LIST,
MENU_ENUM_LABEL_DEFERRED_PROFILES_LIST_STR
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST,
MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST_STR
Expand Down
64 changes: 64 additions & 0 deletions intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,70 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_CONFIGURATIONS_LIST,
"Manage and create configuration files."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PROFILES_LIST,
"Profiles"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_PROFILES_LIST,
"Manage and switch user profiles."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PROFILE_CREATE,
"Create Profile"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_PROFILE_CREATE,
"Create a new user profile."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PROFILE_SELECT,
"Select Profile"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_PROFILE_SELECT,
"Select this profile."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PROFILE_ICON_SELECT,
"Select Profile Icon"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_PROFILE_ICON_SELECT,
"Choose an icon for this profile."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PROFILE_SAVE_CURRENT,
"Save Settings to Current Profile"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_PROFILE_SAVE_CURRENT,
"Save current RetroArch settings to the active profile's configuration file."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PROFILE_SAVE_NEW,
"Save Current Settings to New Profile"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_PROFILE_SAVE_NEW,
"Create a new profile using the current settings as a starting point."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PROFILE_DELETE,
"Delete Profile"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_PROFILE_DELETE,
"Remove this profile permanently."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PROFILE_CHANGE_ICON,
"Change Icon"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_PROFILE_CHANGE_ICON,
"Change the icon for this profile."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_HELP_LIST,
"Help"
Expand Down
10 changes: 10 additions & 0 deletions menu/cbs/menu_cbs_deferred_push.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ GENERIC_DEFERRED_PUSH(deferred_push_history_list, DISPLAYLIST_
GENERIC_DEFERRED_PUSH(deferred_push_database_manager_list, DISPLAYLIST_DATABASES)
GENERIC_DEFERRED_PUSH(deferred_push_content_collection_list, DISPLAYLIST_DATABASE_PLAYLISTS)
GENERIC_DEFERRED_PUSH(deferred_push_configurations_list, DISPLAYLIST_CONFIGURATIONS_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_profiles_list, DISPLAYLIST_PROFILES_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_profile_icons_list, DISPLAYLIST_PROFILE_ICONS_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_load_content_special, DISPLAYLIST_LOAD_CONTENT_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_load_content_list, DISPLAYLIST_LOAD_CONTENT_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_dump_disk_list, DISPLAYLIST_DUMP_DISC)
Expand Down Expand Up @@ -698,6 +700,8 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
{MENU_ENUM_LABEL_COLLECTION, deferred_push_content_collection_list},
{MENU_ENUM_LABEL_SETTINGS, deferred_push_settings},
{MENU_ENUM_LABEL_CONFIGURATIONS_LIST, deferred_push_configurations_list},
{MENU_ENUM_LABEL_PROFILES_LIST, deferred_push_profiles_list},
{MENU_ENUM_LABEL_PROFILE_ICON_SELECT, deferred_push_profile_icons_list},
{MENU_ENUM_LABEL_DEFERRED_PLAYLIST_MANAGER_LIST, deferred_push_playlist_manager_list},
{MENU_ENUM_LABEL_DEFERRED_PLAYLIST_MANAGER_SETTINGS, deferred_push_playlist_manager_settings},
{MENU_ENUM_LABEL_LOAD_CONTENT_LIST, deferred_push_load_content_list},
Expand Down Expand Up @@ -907,6 +911,12 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
case MENU_ENUM_LABEL_CONFIGURATIONS_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_configurations_list);
break;
case MENU_ENUM_LABEL_PROFILES_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_profiles_list);
break;
case MENU_ENUM_LABEL_PROFILE_ICON_SELECT:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_profile_icons_list);
break;
case MENU_ENUM_LABEL_LOAD_CONTENT_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_load_content_list);
break;
Expand Down
Loading
Loading