diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-30 02:04:39 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-30 02:04:39 +0000 |
commit | 093d95683bfcbbff6e0ddd87414e2cd723f17dc9 (patch) | |
tree | c6d07ce0bb312c7e4d7e165ee5c1cb348a6e44fa /src/gui/confirm_dialog.cpp | |
parent | 69ccb03b44f324f17d02b9e27e71c34850f71139 (diff) | |
download | mana-client-093d95683bfcbbff6e0ddd87414e2cd723f17dc9.tar.gz mana-client-093d95683bfcbbff6e0ddd87414e2cd723f17dc9.tar.bz2 mana-client-093d95683bfcbbff6e0ddd87414e2cd723f17dc9.tar.xz mana-client-093d95683bfcbbff6e0ddd87414e2cd723f17dc9.zip |
A few cleanups and simplifications.
Diffstat (limited to 'src/gui/confirm_dialog.cpp')
-rw-r--r-- | src/gui/confirm_dialog.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/gui/confirm_dialog.cpp b/src/gui/confirm_dialog.cpp index 59d48318..2babbf23 100644 --- a/src/gui/confirm_dialog.cpp +++ b/src/gui/confirm_dialog.cpp @@ -26,28 +26,15 @@ #include <guichan/widgets/label.hpp> #include "button.h" -#include "windowcontainer.h" ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg, - gcn::ActionListener *listener): - Window(title, true) -{ - init(msg, listener); -} - -ConfirmDialog::ConfirmDialog(Window *parent, const std::string &title, - const std::string &msg, gcn::ActionListener *listener): + gcn::ActionListener *listener, Window *parent): Window(title, true, parent) { - init(msg, listener); -} - -void ConfirmDialog::init(const std::string &msg, gcn::ActionListener *listener) -{ - textLabel = new gcn::Label(msg); - yesButton = new Button("Yes"); - noButton = new Button("No"); + gcn::Label *textLabel = new gcn::Label(msg); + gcn::Button *yesButton = new Button("Yes"); + gcn::Button *noButton = new Button("No"); int w = textLabel->getWidth() + 20; int inWidth = yesButton->getWidth() + noButton->getWidth() + 5; @@ -88,7 +75,8 @@ void ConfirmDialog::init(const std::string &msg, gcn::ActionListener *listener) void ConfirmDialog::action(const std::string &eventId) { + // Can we receive anything else anyway? if (eventId == "yes" || eventId == "no") { - windowContainer->scheduleDelete(this); + scheduleDelete(); } } |