From ef607eeb4c5bfc7a5490fa986adb582821a98e9c Mon Sep 17 00:00:00 2001 From: Matt Lowe Date: Wed, 4 Feb 2015 17:13:52 +0100 Subject: [PATCH] Added mentions to PMs + adds client wide continuity + one day we might have multiuser pms + I use it when greeting users who pm me: "hello @username!" --- cockatrice/src/tab_message.cpp | 6 ++++++ cockatrice/src/tab_message.h | 1 + 2 files changed, 7 insertions(+) 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();