summaryrefslogtreecommitdiff
path: root/src/gui/socialwindow.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-03-21 18:50:22 -0600
committerJared Adams <jaxad0127@gmail.com>2010-03-21 18:55:18 -0600
commit7365f367e74a1353a6254d8e3adedf52f1b5bdb2 (patch)
treee795537e6178ca678c8b05419eb987b1643deb3d /src/gui/socialwindow.cpp
parenteb2a133b9534868b6e0ba86babb5d98b498e07b4 (diff)
downloadmana-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/socialwindow.cpp')
-rw-r--r--src/gui/socialwindow.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index 4fdd5e9e..1396ab98 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -121,6 +121,10 @@ public:
BY_SERVER);
mInviteDialog = NULL;
}
+ else if (event.getId() == "~do invite")
+ {
+ mInviteDialog = NULL;
+ }
else if (event.getId() == "yes")
{
Net::getGuildHandler()->leave(mGuild->getId());
@@ -128,6 +132,10 @@ public:
mGuild->getName().c_str()), BY_SERVER);
mConfirmDialog = NULL;
}
+ else if (event.getId() == "~yes")
+ {
+ mConfirmDialog = NULL;
+ }
}
protected:
@@ -138,7 +146,7 @@ protected:
strprintf(_("Who would you like to invite to guild %s?"),
mGuild->getName().c_str()),
socialWindow);
- mInviteDialog->setOKButtonActionId("do invite");
+ mInviteDialog->setActionEventId("do invite");
mInviteDialog->addActionListener(this);
}
@@ -184,6 +192,10 @@ public:
name.c_str()), BY_SERVER);
mInviteDialog = NULL;
}
+ else if (event.getId() == "~do invite")
+ {
+ mInviteDialog = NULL;
+ }
else if (event.getId() == "yes")
{
Net::getPartyHandler()->leave();
@@ -191,6 +203,10 @@ public:
mParty->getName().c_str()), BY_SERVER);
mConfirmDialog = NULL;
}
+ else if (event.getId() == "~yes")
+ {
+ mConfirmDialog = NULL;
+ }
}
protected:
@@ -201,7 +217,7 @@ protected:
strprintf(_("Who would you like to invite to party %s?"),
mParty->getName().c_str()),
socialWindow);
- mInviteDialog->setOKButtonActionId("do invite");
+ mInviteDialog->setActionEventId("do invite");
mInviteDialog->addActionListener(this);
}
@@ -468,6 +484,12 @@ void SocialWindow::action(const gcn::ActionEvent &event)
Net::getGuildHandler()->create(name);
localChatTab->chatLog(strprintf(_("Creating guild called %s."),
name.c_str()), BY_SERVER);
+
+ mGuildCreateDialog = NULL;
+ }
+ else if (event.getId() == "~create guild")
+ {
+ mGuildCreateDialog = NULL;
}
else if (event.getId() == "create party")
{
@@ -482,6 +504,12 @@ void SocialWindow::action(const gcn::ActionEvent &event)
Net::getPartyHandler()->create(name);
localChatTab->chatLog(strprintf(_("Creating party called %s."),
name.c_str()), BY_SERVER);
+
+ mPartyCreateDialog = NULL;
+ }
+ else if (event.getId() == "~create party")
+ {
+ mPartyCreateDialog = NULL;
}
}
@@ -489,7 +517,7 @@ void SocialWindow::showGuildCreate()
{
mGuildCreateDialog = new TextDialog(_("Guild Name"),
_("Choose your guild's name."), this);
- mGuildCreateDialog->setOKButtonActionId("create guild");
+ mGuildCreateDialog->setActionEventId("create guild");
mGuildCreateDialog->addActionListener(this);
}
@@ -575,6 +603,6 @@ void SocialWindow::showPartyCreate()
mPartyCreateDialog = new TextDialog(_("Party Name"),
_("Choose your party's name."), this);
- mPartyCreateDialog->setOKButtonActionId("create party");
+ mPartyCreateDialog->setActionEventId("create party");
mPartyCreateDialog->addActionListener(this);
}