summaryrefslogtreecommitdiff
path: root/src/gui/didyouknowwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/didyouknowwindow.cpp')
-rw-r--r--src/gui/didyouknowwindow.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/gui/didyouknowwindow.cpp b/src/gui/didyouknowwindow.cpp
index 54b8c5d88..bd59e8cd3 100644
--- a/src/gui/didyouknowwindow.cpp
+++ b/src/gui/didyouknowwindow.cpp
@@ -91,17 +91,28 @@ DidYouKnowWindow::DidYouKnowWindow():
void DidYouKnowWindow::action(const gcn::ActionEvent &event)
{
- if (event.getId() == "close")
+ const std::string &eventId = event.getId();
+ if (eventId == "close")
+ {
setVisible(false);
-
- const unsigned num = config.getIntValue("currentTip");
-
- if (event.getId() == "prev")
- loadData(num - 1);
- else if (event.getId() == "next")
- loadData(num + 1);
- else if (event.getId() == "openagain")
- config.setValue("showDidYouKnow", mOpenAgainCheckBox->isSelected());
+ }
+ else
+ {
+ const unsigned num = config.getIntValue("currentTip");
+ if (eventId == "prev")
+ {
+ loadData(num - 1);
+ }
+ else if (eventId == "next")
+ {
+ loadData(num + 1);
+ }
+ else if (eventId == "openagain")
+ {
+ config.setValue("showDidYouKnow",
+ mOpenAgainCheckBox->isSelected());
+ }
+ }
}
void DidYouKnowWindow::handleLink(const std::string &link A_UNUSED,