summaryrefslogtreecommitdiff
path: root/src/gui/ok_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/ok_dialog.cpp')
-rw-r--r--src/gui/ok_dialog.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/ok_dialog.cpp b/src/gui/ok_dialog.cpp
index fa704ecc..54ddf3e9 100644
--- a/src/gui/ok_dialog.cpp
+++ b/src/gui/ok_dialog.cpp
@@ -24,9 +24,21 @@
#include "ok_dialog.h"
#include "button.h"
-OkDialog::OkDialog(const std::string& title, const std::string& msg):
+OkDialog::OkDialog(const std::string &title, const std::string &msg):
Window(title, true)
{
+ init(msg);
+}
+
+OkDialog::OkDialog(Window *parent, const std::string &title,
+ const std::string &msg):
+ Window(title, true, parent)
+{
+ init(msg);
+}
+
+void OkDialog::init(const std::string &msg)
+{
userLabel = new gcn::Label(msg);
okButton = new Button("OK");
@@ -59,7 +71,7 @@ OkDialog::~OkDialog()
delete okButton;
}
-void OkDialog::action(const std::string& eventId)
+void OkDialog::action(const std::string &eventId)
{
if (eventId == "ok") {
windowContainer->scheduleDelete(this);