diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-03-21 18:50:22 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-03-21 18:55:18 -0600 |
commit | 7365f367e74a1353a6254d8e3adedf52f1b5bdb2 (patch) | |
tree | e795537e6178ca678c8b05419eb987b1643deb3d /src/gui/textdialog.cpp | |
parent | eb2a133b9534868b6e0ba86babb5d98b498e07b4 (diff) | |
download | mana-7365f367e74a1353a6254d8e3adedf52f1b5bdb2.tar.gz mana-7365f367e74a1353a6254d8e3adedf52f1b5bdb2.tar.bz2 mana-7365f367e74a1353a6254d8e3adedf52f1b5bdb2.tar.xz mana-7365f367e74a1353a6254d8e3adedf52f1b5bdb2.zip |
Make TextDialog send an appropriate event for cancel
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/gui/textdialog.cpp')
-rw-r--r-- | src/gui/textdialog.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/gui/textdialog.cpp b/src/gui/textdialog.cpp index b33b664b..120780fe 100644 --- a/src/gui/textdialog.cpp +++ b/src/gui/textdialog.cpp @@ -78,21 +78,14 @@ TextDialog::~TextDialog() void TextDialog::action(const gcn::ActionEvent &event) { - setActionEventId(event.getId()); - distributeActionEvent(); + if (event.getId() == "CANCEL") + setActionEventId("~" + getActionEventId()); - if (event.getId() == "CANCEL" || event.getSource() == mOkButton) - { - scheduleDelete(); - } + distributeActionEvent(); + scheduleDelete(); } const std::string &TextDialog::getText() const { return mTextField->getText(); } - -void TextDialog::setOKButtonActionId(const std::string &name) -{ - mOkButton->setActionEventId(name); -} |