Skip to content

Commit

Permalink
refactor: Don't populate "default" in config name automatically
Browse files Browse the repository at this point in the history
The "default" config name is special for Amiberry, since if it exists, it will be loaded automatically on startup.
Previously, that would be populated in the Name field if no other config was loaded.
Changing this behavior to leave it empty, unless a config was loaded last (in which case, the field will contain the name of the last loaded config).
  • Loading branch information
midwan committed Nov 30, 2023
1 parent 41c9132 commit d57accb
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/osdep/gui/PanelConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,19 +288,15 @@ void InitPanelConfig(const struct config_category& category)
button_x += BUTTON_WIDTH + DISTANCE_NEXT_X;
button_x = category.panel->getWidth() - DISTANCE_BORDER - BUTTON_WIDTH;
category.panel->add(cmdDelete, button_x, buttonY);
if (strlen(last_active_config) == 0)

if (strlen(last_loaded_config) > 0)
{
if (strlen(last_loaded_config) == 0)
strncpy(last_active_config, OPTIONSFILENAME, MAX_DPATH);
else
{
strcpy(last_active_config, last_loaded_config);
remove_file_extension(last_active_config);
}
strcpy(last_active_config, last_loaded_config);
remove_file_extension(last_active_config);
txtName->setText(last_active_config);
txtDesc->setText(changed_prefs.description);
}
txtName->setText(last_active_config);
txtDesc->setText(changed_prefs.description);

ensureVisible = -1;
RefreshPanelConfig();
}
Expand Down

0 comments on commit d57accb

Please sign in to comment.