Moved some stuff from the EditGameDialog constructor to its open() method to

avoid uninitialised variables. (This is similar to some bugs that were fixed
earlier today.)

svn-id: r35811
This commit is contained in:
Torbjörn Andersson 2009-01-10 23:38:30 +00:00
parent b4eb116f65
commit 20638a0f97

View File

@ -246,16 +246,10 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
// GUI: Button + Label for the additional path
new ButtonWidget(tab, "GameOptions_Paths.Extrapath", "Extra Path:", kCmdExtraBrowser, 0);
_extraPathWidget = new StaticTextWidget(tab, "GameOptions_Paths.ExtrapathText", extraPath);
if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
_extraPathWidget->setLabel("None");
}
// GUI: Button + Label for the save path
new ButtonWidget(tab, "GameOptions_Paths.Savepath", "Save Path:", kCmdSaveBrowser, 0);
_savePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.SavepathText", savePath);
if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) {
_savePathWidget->setLabel("Default");
}
// Activate the first tab
tab->setActiveTab(0);
@ -280,6 +274,16 @@ void EditGameDialog::reflowLayout() {
void EditGameDialog::open() {
OptionsDialog::open();
String extraPath(ConfMan.get("extrapath", _domain));
if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
_extraPathWidget->setLabel("None");
}
String savePath(ConfMan.get("savepath", _domain));
if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) {
_savePathWidget->setLabel("Default");
}
int sel, i;
bool e;