GUI: Fix error when renaming a target in the edit game dialog

The OptionsContainerWidget keeps a copy of the name of the game domain
that needs to be updated when the target is renamed.

Ideally, OptionsContainerWidget would simply keep a pointer to the
ConfigurationManager::Domain object, however that's not currently
possible as the ConfigurationManager defaults are global instead of
being per domain. As a result they are not accessible from the Domain
object.

Fixes #11416.
This commit is contained in:
Bastien Bouclet 2020-04-11 08:02:30 +02:00
parent c9f90b23ce
commit f7efd3cd7f
2 changed files with 5 additions and 1 deletions

View File

@ -584,6 +584,9 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
}
ConfMan.renameGameDomain(_domain, newDomain);
_domain = newDomain;
if (_engineOptions) {
_engineOptions->setDomain(newDomain);
}
}
}
// fall through

View File

@ -471,6 +471,7 @@ public:
virtual bool save() = 0;
void setParentDialog(Dialog *parentDialog) { _parentDialog = parentDialog; }
void setDomain(const Common::String &domain) { _domain = domain; }
protected:
enum {
@ -495,7 +496,7 @@ protected:
*/
virtual void defineLayout(ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const {}
const Common::String _domain;
Common::String _domain;
const Common::String _dialogLayout;
Dialog *_parentDialog;