summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-19 22:01:05 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-19 22:01:05 +0300
commita348d4a8882300fa308d210e860dd29a4b974622 (patch)
tree87f4317eb9610b59f431a3688d2d76d38381dc00 /src/gui/widgets/tabs
parent718714eef1dd302a9426689fff71fd9c13fbacdf (diff)
downloadplus-a348d4a8882300fa308d210e860dd29a4b974622.tar.gz
plus-a348d4a8882300fa308d210e860dd29a4b974622.tar.bz2
plus-a348d4a8882300fa308d210e860dd29a4b974622.tar.xz
plus-a348d4a8882300fa308d210e860dd29a4b974622.zip
Use input manager for most commands in party tab.
Diffstat (limited to 'src/gui/widgets/tabs')
-rw-r--r--src/gui/widgets/tabs/chat/partytab.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/gui/widgets/tabs/chat/partytab.cpp b/src/gui/widgets/tabs/chat/partytab.cpp
index 10104cd63..3786e916b 100644
--- a/src/gui/widgets/tabs/chat/partytab.cpp
+++ b/src/gui/widgets/tabs/chat/partytab.cpp
@@ -30,11 +30,13 @@
#include "const/sound.h"
+#include "gui/windows/chatwindow.h"
+
+#include "input/inputmanager.h"
+
#include "net/partyhandler.h"
#include "net/serverfeatures.h"
-#include "gui/windows/chatwindow.h"
-
#include "utils/booleanoptions.h"
#include "debug.h"
@@ -64,29 +66,21 @@ void PartyTab::handleInput(const std::string &msg)
bool PartyTab::handleCommand(const std::string &restrict type,
const std::string &restrict args)
{
- if (type == "create" || type == "new")
- {
- if (args.empty())
- {
- // TRANSLATORS: chat error message
- chatLog(_("Party name is missing."), ChatMsgType::BY_SERVER);
- }
- else
- {
- partyHandler->create(args);
- }
- }
- else if (type == "invite")
+ if (type == "invite")
{
partyHandler->invite(args);
}
else if (type == "leave")
{
- partyHandler->leave();
+ inputManager.executeChatCommand(InputAction::LEAVE_PARTY,
+ args,
+ this);
}
else if (type == "kick")
{
- partyHandler->kick(args);
+ inputManager.executeChatCommand(InputAction::KICK_PARTY,
+ args,
+ this);
}
else if (type == "item")
{
@@ -193,7 +187,10 @@ bool PartyTab::handleCommand(const std::string &restrict type,
else if (type == "setleader"
&& serverFeatures->haveChangePartyLeader())
{
- partyHandler->changeLeader(args);
+ inputManager.executeChatCommand(
+ InputAction::COMMAND_CHANGE_PARTY_LEADER,
+ args,
+ this);
}
else
{