summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/setup.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index 6be0399c..4fae514f 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -59,6 +59,10 @@ Setup::Setup():
x -= btn->getWidth() + 5;
btn->setPosition(x, height - btn->getHeight() - 5);
add(btn);
+
+ // Disable this button when the windows aren't created yet
+ if (!strcmp(*curBtn, "Reset Windows"))
+ btn->setEnabled(statusWindow != NULL);
}
TabbedContainer *panel = new TabbedContainer();
@@ -111,6 +115,11 @@ void Setup::action(const gcn::ActionEvent &event)
}
else if (event.getId() == "Reset Windows")
{
+ // Bail out if this action happens to be activated before the windows
+ // are created (though it should be disabled then)
+ if (!statusWindow)
+ return;
+
statusWindow->resetToDefaultSize();
minimap->resetToDefaultSize();
chatWindow->resetToDefaultSize();