diff --git a/cockatrice/src/tab_message.cpp b/cockatrice/src/tab_message.cpp index 6369f2a6..72779d99 100644 --- a/cockatrice/src/tab_message.cpp +++ b/cockatrice/src/tab_message.cpp @@ -18,6 +18,7 @@ TabMessage::TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, c chatView = new ChatView(tabSupervisor, 0, true); connect(chatView, SIGNAL(showCardInfoPopup(QPoint, QString)), this, SLOT(showCardInfoPopup(QPoint, QString))); connect(chatView, SIGNAL(deleteCardInfoPopup(QString)), this, SLOT(deleteCardInfoPopup(QString))); + connect(chatView, SIGNAL(addMentionTag(QString)), this, SLOT(addMentionTag(QString))); sayEdit = new QLineEdit; connect(sayEdit, SIGNAL(returnPressed()), this, SLOT(sendMessage())); @@ -43,6 +44,11 @@ TabMessage::~TabMessage() delete otherUserInfo; } +void TabMessage::addMentionTag(QString mentionTag) { + sayEdit->insert(mentionTag + " "); + sayEdit->setFocus(); +} + void TabMessage::retranslateUi() { messageMenu->setTitle(tr("Personal &talk")); diff --git a/cockatrice/src/tab_message.h b/cockatrice/src/tab_message.h index 80263975..9f2b19d2 100644 --- a/cockatrice/src/tab_message.h +++ b/cockatrice/src/tab_message.h @@ -29,6 +29,7 @@ private slots: void sendMessage(); void actLeave(); void messageSent(const Response &response); + void addMentionTag(QString mentionTag); public: TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User &_ownUserInfo, const ServerInfo_User &_otherUserInfo); ~TabMessage();