summaryrefslogtreecommitdiff
path: root/src/gui/socialwindow.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-08-25 20:38:06 +0200
committerJared Adams <jaxad0127@gmail.com>2010-08-25 12:59:25 -0600
commit627e1271f0ac2e7bd95a83f521ecbcf1b554ba80 (patch)
tree5071591268bdfa40add8a07b859fb1bf4d123db4 /src/gui/socialwindow.cpp
parent38474d0c3c14cf595aed61ee1e4a69d48abbcf92 (diff)
downloadmana-627e1271f0ac2e7bd95a83f521ecbcf1b554ba80.tar.gz
mana-627e1271f0ac2e7bd95a83f521ecbcf1b554ba80.tar.bz2
mana-627e1271f0ac2e7bd95a83f521ecbcf1b554ba80.tar.xz
mana-627e1271f0ac2e7bd95a83f521ecbcf1b554ba80.zip
Adding autoComplete for invite
Signed-off-by: Jared Adams <jaxad0127@gmail.com>
Diffstat (limited to 'src/gui/socialwindow.cpp')
-rw-r--r--src/gui/socialwindow.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index 7a13f96b..3d8afa44 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -121,12 +121,16 @@ public:
if (event.getId() == "do invite")
{
std::string name = mInviteDialog->getText();
- Net::getGuildHandler()->invite(mGuild->getId(), name);
- localChatTab->chatLog(strprintf(_("Invited user %s to guild %s."),
+ if (!name.empty())
+ {
+ Net::getGuildHandler()->invite(mGuild->getId(), name);
+ localChatTab->chatLog(strprintf(_("Invited user %s to guild %s."),
name.c_str(),
mGuild->getName().c_str()),
BY_SERVER);
+ }
+
mInviteDialog = NULL;
}
else if (event.getId() == "~do invite")
@@ -153,7 +157,7 @@ protected:
mInviteDialog = new TextDialog(_("Member Invite to Guild"),
strprintf(_("Who would you like to invite to guild %s?"),
mGuild->getName().c_str()),
- socialWindow);
+ socialWindow, true);
mInviteDialog->setActionEventId("do invite");
mInviteDialog->addActionListener(this);
}
@@ -202,7 +206,10 @@ public:
if (event.getId() == "do invite")
{
std::string name = mInviteDialog->getText();
- Net::getPartyHandler()->invite(name);
+
+ if (!name.empty())
+ Net::getPartyHandler()->invite(name);
+
mInviteDialog = NULL;
}
else if (event.getId() == "~do invite")
@@ -229,7 +236,7 @@ protected:
mInviteDialog = new TextDialog(_("Member Invite to Party"),
strprintf(_("Who would you like to invite to party %s?"),
mParty->getName().c_str()),
- socialWindow);
+ socialWindow, true);
mInviteDialog->setActionEventId("do invite");
mInviteDialog->addActionListener(this);
}