add OSD message for remap saving too

This commit is contained in:
radius 2015-04-07 22:40:42 -05:00
parent 72136d4c20
commit dd8b1faac4
3 changed files with 23 additions and 8 deletions

View File

@ -69,9 +69,12 @@ bool input_remapping_load_file(const char *path)
* @path : Path to remapping file (relative path).
*
* Saves remapping values to file.
*
* Returns: true (1) if successfull, otherwise false (0).
**/
void input_remapping_save_file(const char *path)
bool input_remapping_save_file(const char *path)
{
bool ret;
unsigned i, j;
char buf[PATH_MAX_LENGTH];
char remap_file[PATH_MAX_LENGTH];
@ -86,10 +89,10 @@ void input_remapping_save_file(const char *path)
conf = config_file_new(remap_file);
if (!conf)
{
conf = config_file_new(NULL);
if (!conf)
return;
return false;
}
for (i = 0; i < settings->input.max_users; i++)
{
@ -106,8 +109,10 @@ void input_remapping_save_file(const char *path)
}
}
config_file_write(conf, remap_file);
ret = config_file_write(conf, remap_file);
config_file_free(conf);
return ret;
}
void input_remapping_set_defaults(void)

View File

@ -39,8 +39,10 @@ bool input_remapping_load_file(const char *path);
* @path : Path to remapping file (relative path).
*
* Saves remapping values to file.
*
* Returns: true (1) if successfull, otherwise false (0).
**/
void input_remapping_save_file(const char *path);
bool input_remapping_save_file(const char *path);
void input_remapping_set_defaults(void);

View File

@ -535,7 +535,11 @@ static int action_ok_remap_file_save_core(const char *path,
if(!path_file_exists(directory))
path_mkdir(directory);
input_remapping_save_file(file);
if(input_remapping_save_file(file))
rarch_main_msg_queue_push("Remap file saved successfully", 1, 100, true);
else
rarch_main_msg_queue_push("Error saving remap file", 1, 100, true);
return 0;
}
@ -560,7 +564,11 @@ static int action_ok_remap_file_save_game(const char *path,
if(!path_file_exists(directory))
path_mkdir(directory);
input_remapping_save_file(file);
if(input_remapping_save_file(file))
rarch_main_msg_queue_push("Remap file saved successfully", 1, 100, true);
else
rarch_main_msg_queue_push("Error saving remap file", 1, 100, true);
return 0;
}