Remove direct usages of TabSupervisor from Chatview
- There still might be inherited usages - It's still used in the ctor Areas to test - Mentions - Chat notifications - Username clickable links
This commit is contained in:
parent
2c3b85aed3
commit
d65a444ac5
11 changed files with 104 additions and 100 deletions
|
@ -83,7 +83,8 @@ SET(cockatrice_SOURCES
|
|||
src/replay_timeline_widget.cpp
|
||||
src/deckstats_interface.cpp
|
||||
src/tappedout_interface.cpp
|
||||
src/chatview.cpp
|
||||
src/chatview/chatview.cpp
|
||||
src/chatview/userlistProxy.h
|
||||
src/userlist.cpp
|
||||
src/userinfobox.cpp
|
||||
src/user_context_menu.cpp
|
||||
|
|
|
@ -4,32 +4,27 @@
|
|||
#include <QMouseEvent>
|
||||
#include <QDesktopServices>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include "chatview.h"
|
||||
#include "user_level.h"
|
||||
#include "user_context_menu.h"
|
||||
#include "pixmapgenerator.h"
|
||||
#include "settingscache.h"
|
||||
#include "tab_userlists.h"
|
||||
#include "soundengine.h"
|
||||
#include "room_message_type.h"
|
||||
#include "../user_context_menu.h"
|
||||
#include "../pixmapgenerator.h"
|
||||
#include "../settingscache.h"
|
||||
#include "../tab_userlists.h"
|
||||
#include "../soundengine.h"
|
||||
|
||||
const QColor DEFAULT_MENTION_COLOR = QColor(194, 31, 47);
|
||||
const QColor OTHER_USER_COLOR = QColor(0, 65, 255); // dark blue
|
||||
const QString SERVER_MESSAGE_COLOR = "#851515";
|
||||
|
||||
ChatView::ChatView(const TabSupervisor *_tabSupervisor, TabGame *_game, bool _showTimestamps, QWidget *parent)
|
||||
: QTextBrowser(parent), tabSupervisor(_tabSupervisor), game(_game), evenNumber(true), showTimestamps(_showTimestamps), hoveredItemType(HoveredNothing)
|
||||
ChatView::ChatView(const TabSupervisor *_tabSupervisor, const UserlistProxy *_userlistProxy, TabGame *_game, bool _showTimestamps, QWidget *parent)
|
||||
: QTextBrowser(parent), tabSupervisor(_tabSupervisor), userlistProxy(_userlistProxy), game(_game), evenNumber(true), showTimestamps(_showTimestamps), hoveredItemType(HoveredNothing)
|
||||
{
|
||||
document()->setDefaultStyleSheet("a { text-decoration: none; color: blue; }");
|
||||
userContextMenu = new UserContextMenu(tabSupervisor, this, game);
|
||||
connect(userContextMenu, SIGNAL(openMessageDialog(QString, bool)), this, SIGNAL(openMessageDialog(QString, bool)));
|
||||
|
||||
if(tabSupervisor->getUserInfo())
|
||||
{
|
||||
userName = QString::fromStdString(tabSupervisor->getUserInfo()->name());
|
||||
mention = "@" + userName;
|
||||
}
|
||||
|
||||
userName = userlistProxy->getOwnUsername();
|
||||
mention = "@" + userName;
|
||||
|
||||
mentionFormat.setFontWeight(QFont::Bold);
|
||||
|
||||
|
@ -142,8 +137,7 @@ void ChatView::appendMessage(QString message, RoomMessageTypeFlags messageType,
|
|||
// nickname
|
||||
if (sender.toLower() != "servatrice") {
|
||||
QTextCharFormat senderFormat;
|
||||
if (tabSupervisor && tabSupervisor->getUserInfo() &&
|
||||
(sender == QString::fromStdString(tabSupervisor->getUserInfo()->name()))) {
|
||||
if (sender == userName) {
|
||||
senderFormat.setForeground(QBrush(getCustomMentionColor()));
|
||||
senderFormat.setFontWeight(QFont::Bold);
|
||||
} else {
|
||||
|
@ -156,10 +150,10 @@ void ChatView::appendMessage(QString message, RoomMessageTypeFlags messageType,
|
|||
if (sameSender) {
|
||||
cursor.insertText(" ");
|
||||
} else {
|
||||
if (!sender.isEmpty() && tabSupervisor->getUserListsTab()) {
|
||||
if (!sender.isEmpty()) {
|
||||
const int pixelSize = QFontInfo(cursor.charFormat().font()).pixelSize();
|
||||
QMap<QString, UserListTWI *> buddyList = tabSupervisor->getUserListsTab()->getBuddyList()->getUsers();
|
||||
cursor.insertImage(UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, buddyList.contains(sender), UserPrivLevel).toImage());
|
||||
bool isBuddy = userlistProxy->isUserBuddy(sender);
|
||||
cursor.insertImage(UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, isBuddy, UserPrivLevel).toImage());
|
||||
cursor.insertText(" ");
|
||||
}
|
||||
cursor.setCharFormat(senderFormat);
|
||||
|
@ -231,6 +225,7 @@ void ChatView::appendMessage(QString message, RoomMessageTypeFlags messageType,
|
|||
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
|
||||
}
|
||||
|
||||
|
||||
void ChatView::checkTag(QTextCursor &cursor, QString &message)
|
||||
{
|
||||
if (message.startsWith("[card]"))
|
||||
|
@ -287,11 +282,10 @@ void ChatView::checkMention(QTextCursor &cursor, QString &message, QString &send
|
|||
QString fullMentionUpToSpaceOrEnd = (firstSpace == -1) ? message.mid(1) : message.mid(1, firstSpace - 1);
|
||||
QString mentionIntact = fullMentionUpToSpaceOrEnd;
|
||||
|
||||
QMap<QString, UserListTWI *> userList = tabSupervisor->getUserListsTab()->getAllUsersList()->getUsers();
|
||||
|
||||
while (fullMentionUpToSpaceOrEnd.size())
|
||||
{
|
||||
if (isFullMentionAValidUser(userList, fullMentionUpToSpaceOrEnd)) // Is there a user online named this?
|
||||
const ServerInfo_User *onlineUser = userlistProxy->getOnlineUser(fullMentionUpToSpaceOrEnd);
|
||||
if (onlineUser) // Is there a user online named this?
|
||||
{
|
||||
if (userName.toLower() == fullMentionUpToSpaceOrEnd.toLower()) // Is this user you?
|
||||
{
|
||||
|
@ -301,16 +295,10 @@ void ChatView::checkMention(QTextCursor &cursor, QString &message, QString &send
|
|||
mentionFormat.setForeground(settingsCache->getChatMentionForeground() ? QBrush(Qt::white) : QBrush(Qt::black));
|
||||
cursor.insertText(mention, mentionFormat);
|
||||
message = message.mid(mention.size());
|
||||
QApplication::alert(this);
|
||||
if (settingsCache->getShowMentionPopup() && shouldShowSystemPopup())
|
||||
{
|
||||
QString ref = sender.left(sender.length() - 2);
|
||||
showSystemPopup(ref);
|
||||
}
|
||||
showSystemPopup(sender);
|
||||
} else {
|
||||
QString correctUserName = getNameFromUserList(userList, fullMentionUpToSpaceOrEnd);
|
||||
UserListTWI *vlu = userList.value(correctUserName);
|
||||
mentionFormatOtherUser.setAnchorHref("user://" + QString::number(vlu->getUserInfo().user_level()) + "_" + correctUserName);
|
||||
QString correctUserName = QString::fromStdString(onlineUser->name());
|
||||
mentionFormatOtherUser.setAnchorHref("user://" + QString::number(onlineUser->user_level()) + "_" + correctUserName);
|
||||
cursor.insertText("@" + correctUserName, mentionFormatOtherUser);
|
||||
|
||||
message = message.mid(correctUserName.size() + 1);
|
||||
|
@ -327,12 +315,7 @@ void ChatView::checkMention(QTextCursor &cursor, QString &message, QString &send
|
|||
mentionFormat.setForeground(settingsCache->getChatMentionForeground() ? QBrush(Qt::white) : QBrush(Qt::black));
|
||||
cursor.insertText("@" + fullMentionUpToSpaceOrEnd, mentionFormat);
|
||||
message = message.mid(fullMentionUpToSpaceOrEnd.size() + 1);
|
||||
QApplication::alert(this);
|
||||
if (settingsCache->getShowMentionPopup() && shouldShowSystemPopup())
|
||||
{
|
||||
QString ref = sender.left(sender.length() - 2);
|
||||
showSystemPopup(ref);
|
||||
}
|
||||
showSystemPopup(sender);
|
||||
|
||||
cursor.setCharFormat(defaultFormat);
|
||||
return;
|
||||
|
@ -406,7 +389,7 @@ QString ChatView::extractNextWord(QString &message, QString &rest)
|
|||
message = message.mid(firstSpace);
|
||||
}
|
||||
|
||||
// remove any punctution from the end and pass it separately
|
||||
// remove any punctuation from the end and pass it separately
|
||||
for (int len = word.size() - 1; len >= 0; --len)
|
||||
{
|
||||
if(word.at(len).isLetterOrNumber())
|
||||
|
@ -428,22 +411,22 @@ bool ChatView::isModeratorSendingGlobal(QFlags<ServerInfo_User::UserLevelFlag> u
|
|||
QStringList getAttentionList;
|
||||
getAttentionList << "/all"; // Send a message to all users
|
||||
|
||||
if (getAttentionList.contains(message) && (userLevel & ServerInfo_User::IsModerator || userLevel & ServerInfo_User::IsAdmin))
|
||||
return true;
|
||||
return (getAttentionList.contains(message)
|
||||
&& (userLevel & ServerInfo_User::IsModerator
|
||||
|| userLevel & ServerInfo_User::IsAdmin));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ChatView::actMessageClicked() {
|
||||
emit messageClickedSignal();
|
||||
}
|
||||
|
||||
bool ChatView::shouldShowSystemPopup() {
|
||||
return QApplication::activeWindow() == 0 || QApplication::focusWidget() == 0 ||tabSupervisor->currentIndex() != tabSupervisor->indexOf(this);
|
||||
}
|
||||
|
||||
void ChatView::showSystemPopup(QString &sender) {
|
||||
emit showMentionPopup(sender);
|
||||
QApplication::alert(this);
|
||||
if (settingsCache->getShowMentionPopup()) {
|
||||
QString ref = sender.left(sender.length() - 2);
|
||||
emit showMentionPopup(ref);
|
||||
}
|
||||
}
|
||||
|
||||
QColor ChatView::getCustomMentionColor() {
|
||||
|
@ -458,32 +441,6 @@ QColor ChatView::getCustomHighlightColor() {
|
|||
return customColor.isValid() ? customColor : DEFAULT_MENTION_COLOR;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the correct case version of the provided username, if no correct casing version
|
||||
was found then the provided name is not available and will return an empty QString.
|
||||
*/
|
||||
QString ChatView::getNameFromUserList(QMap<QString, UserListTWI *> &userList, QString &userName) {
|
||||
QMap<QString, UserListTWI *>::iterator i;
|
||||
QString lowerUserName = userName.toLower();
|
||||
for (i = userList.begin(); i != userList.end(); ++i) {
|
||||
if (i.key().toLower() == lowerUserName)
|
||||
return i.key();
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool ChatView::isFullMentionAValidUser(QMap<QString, UserListTWI *> &userList, QString userNameToMatch)
|
||||
{
|
||||
QString userNameToMatchLower = userNameToMatch.toLower();
|
||||
QMap<QString, UserListTWI *>::iterator i;
|
||||
|
||||
for (i = userList.begin(); i != userList.end(); ++i)
|
||||
if (i.key().toLower() == userNameToMatchLower)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ChatView::clearChat() {
|
||||
document()->clear();
|
||||
lastSender = "";
|
|
@ -6,10 +6,11 @@
|
|||
#include <QTextCursor>
|
||||
#include <QColor>
|
||||
#include <QAction>
|
||||
#include "userlist.h"
|
||||
#include "../userlist.h"
|
||||
#include "user_level.h"
|
||||
#include "room_message_type.h"
|
||||
#include "tab_supervisor.h"
|
||||
#include "../tab_supervisor.h"
|
||||
#include "userlistProxy.h"
|
||||
|
||||
class QTextTable;
|
||||
class QMouseEvent;
|
||||
|
@ -23,6 +24,7 @@ protected:
|
|||
TabGame * const game;
|
||||
private:
|
||||
enum HoveredItemType { HoveredNothing, HoveredUrl, HoveredCard, HoveredUser };
|
||||
const UserlistProxy * const userlistProxy;
|
||||
UserContextMenu *userContextMenu;
|
||||
QString lastSender;
|
||||
QString userName;
|
||||
|
@ -41,11 +43,8 @@ private:
|
|||
QTextCursor prepareBlock(bool same = false);
|
||||
void appendCardTag(QTextCursor &cursor, const QString &cardName);
|
||||
void appendUrlTag(QTextCursor &cursor, QString url);
|
||||
QString getNameFromUserList(QMap<QString, UserListTWI *> &userList, QString &userName);
|
||||
bool isFullMentionAValidUser(QMap<QString, UserListTWI *> &userList, QString userNameToMatch);
|
||||
QColor getCustomMentionColor();
|
||||
QColor getCustomHighlightColor();
|
||||
bool shouldShowSystemPopup();
|
||||
void showSystemPopup(QString &sender);
|
||||
bool isModeratorSendingGlobal(QFlags<ServerInfo_User::UserLevelFlag> userLevelFlag, QString message);
|
||||
void checkTag(QTextCursor &cursor, QString &message);
|
||||
|
@ -56,7 +55,7 @@ private slots:
|
|||
void openLink(const QUrl &link);
|
||||
void actMessageClicked();
|
||||
public:
|
||||
ChatView(const TabSupervisor *_tabSupervisor, TabGame *_game, bool _showTimestamps, QWidget *parent = 0);
|
||||
ChatView(const TabSupervisor *_tabSupervisor, const UserlistProxy *_userlistProxy, TabGame *_game, bool _showTimestamps, QWidget *parent = 0);
|
||||
void retranslateUi();
|
||||
void appendHtml(const QString &html);
|
||||
void appendHtmlServerMessage(const QString &html, bool optionalIsBold = false, QString optionalFontColor = QString());
|
17
cockatrice/src/chatview/userlistProxy.h
Normal file
17
cockatrice/src/chatview/userlistProxy.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
#ifndef COCKATRICE_USERLISTPROXY_H
|
||||
#define COCKATRICE_USERLISTPROXY_H
|
||||
|
||||
class ServerInfo_User;
|
||||
|
||||
/**
|
||||
* Responsible for providing a bare-bones minimal interface into userlist information,
|
||||
* including your current connection to the server as well as buddy/ignore/alluser lists.
|
||||
*/
|
||||
class UserlistProxy {
|
||||
public:
|
||||
virtual const QString getOwnUsername() const = 0;
|
||||
virtual bool isUserBuddy(const QString &userName) const = 0;
|
||||
virtual const ServerInfo_User* getOnlineUser(const QString &userName) const = 0; // Can return nullptr
|
||||
};
|
||||
|
||||
#endif //COCKATRICE_USERLISTPROXY_H
|
|
@ -636,7 +636,7 @@ void MessageLogWidget::connectToPlayer(Player *player)
|
|||
connect(player, SIGNAL(logAlwaysRevealTopCard(Player *, CardZone *, bool)), this, SLOT(logAlwaysRevealTopCard(Player *, CardZone *, bool)));
|
||||
}
|
||||
|
||||
MessageLogWidget::MessageLogWidget(const TabSupervisor *_tabSupervisor, TabGame *_game, QWidget *parent)
|
||||
: ChatView(_tabSupervisor, _game, true, parent), currentContext(MessageContext_None)
|
||||
MessageLogWidget::MessageLogWidget(const TabSupervisor *_tabSupervisor, const UserlistProxy *_userlistProxy, TabGame *_game, QWidget *parent)
|
||||
: ChatView(_tabSupervisor, _userlistProxy, _game, true, parent), currentContext(MessageContext_None)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef MESSAGELOGWIDGET_H
|
||||
#define MESSAGELOGWIDGET_H
|
||||
|
||||
#include "chatview.h"
|
||||
#include "chatview/chatview.h"
|
||||
#include "translation.h"
|
||||
#include "user_level.h"
|
||||
|
||||
|
@ -83,7 +83,7 @@ public slots:
|
|||
void containerProcessingDone();
|
||||
public:
|
||||
void connectToPlayer(Player *player);
|
||||
MessageLogWidget(const TabSupervisor *_tabSupervisor, TabGame *_game, QWidget *parent = 0);
|
||||
MessageLogWidget(const TabSupervisor *_tabSupervisor, const UserlistProxy *_userlistProxy, TabGame *_game, QWidget *parent = 0);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1574,7 +1574,7 @@ void TabGame::createPlayerListDock(bool bReplay)
|
|||
|
||||
void TabGame::createMessageDock(bool bReplay)
|
||||
{
|
||||
messageLog = new MessageLogWidget(tabSupervisor, this);
|
||||
messageLog = new MessageLogWidget(tabSupervisor, tabSupervisor, this);
|
||||
connect(messageLog, SIGNAL(cardNameHovered(QString)), cardInfo, SLOT(setCard(QString)));
|
||||
connect(messageLog, SIGNAL(showCardInfoPopup(QPoint, QString)), this, SLOT(showCardInfoPopup(QPoint, QString)));
|
||||
connect(messageLog, SIGNAL(deleteCardInfoPopup(QString)), this, SLOT(deleteCardInfoPopup(QString)));
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
#include <QLineEdit>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include "tab_message.h"
|
||||
#include "abstractclient.h"
|
||||
#include "chatview.h"
|
||||
#include "chatview/chatview.h"
|
||||
#include "main.h"
|
||||
#include "settingscache.h"
|
||||
#include "soundengine.h"
|
||||
|
@ -21,7 +19,7 @@
|
|||
TabMessage::TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User &_ownUserInfo, const ServerInfo_User &_otherUserInfo)
|
||||
: Tab(_tabSupervisor), client(_client), ownUserInfo(new ServerInfo_User(_ownUserInfo)), otherUserInfo(new ServerInfo_User(_otherUserInfo)), userOnline(true)
|
||||
{
|
||||
chatView = new ChatView(tabSupervisor, 0, true);
|
||||
chatView = new ChatView(tabSupervisor, 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)));
|
||||
|
|
|
@ -1,29 +1,24 @@
|
|||
#include <QLineEdit>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
#include <QPushButton>
|
||||
#include <QMessageBox>
|
||||
#include <QCheckBox>
|
||||
#include <QLabel>
|
||||
#include <QToolButton>
|
||||
#include <QSplitter>
|
||||
#include <QApplication>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QCompleter>
|
||||
#include <QWidget>
|
||||
#include <QtCore/qdatetime.h>
|
||||
#include "tab_supervisor.h"
|
||||
#include "tab_room.h"
|
||||
#include "tab_userlists.h"
|
||||
#include "userlist.h"
|
||||
#include "abstractclient.h"
|
||||
#include "chatview.h"
|
||||
#include "chatview/chatview.h"
|
||||
#include "gameselector.h"
|
||||
#include "settingscache.h"
|
||||
#include "main.h"
|
||||
#include "lineeditcompleter.h"
|
||||
#include "get_pb_extension.h"
|
||||
#include "pb/room_commands.pb.h"
|
||||
#include "pb/serverinfo_room.pb.h"
|
||||
|
@ -48,7 +43,7 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, ServerI
|
|||
userList = new UserList(tabSupervisor, client, UserList::RoomList);
|
||||
connect(userList, SIGNAL(openMessageDialog(const QString &, bool)), this, SIGNAL(openMessageDialog(const QString &, bool)));
|
||||
|
||||
chatView = new ChatView(tabSupervisor, 0, true);
|
||||
chatView = new ChatView(tabSupervisor, tabSupervisor, 0, true);
|
||||
connect(chatView, SIGNAL(showMentionPopup(QString&)), this, SLOT(actShowMentionPopup(QString&)));
|
||||
connect(chatView, SIGNAL(messageClickedSignal()), this, SLOT(focusTab()));
|
||||
connect(chatView, SIGNAL(openMessageDialog(QString, bool)), this, SIGNAL(openMessageDialog(QString, bool)));
|
||||
|
@ -156,8 +151,11 @@ void TabRoom::focusTab() {
|
|||
}
|
||||
|
||||
void TabRoom::actShowMentionPopup(QString &sender) {
|
||||
if (trayIcon && (tabSupervisor->currentIndex() != tabSupervisor->indexOf(this) || QApplication::activeWindow() == 0
|
||||
|| QApplication::focusWidget() == 0)) {
|
||||
if (trayIcon
|
||||
&& (tabSupervisor->currentIndex() != tabSupervisor->indexOf(this)
|
||||
|| QApplication::activeWindow() == 0
|
||||
|| QApplication::focusWidget() == 0)
|
||||
) {
|
||||
disconnect(trayIcon, SIGNAL(messageClicked()), 0, 0);
|
||||
trayIcon->showMessage(sender + tr(" mentioned you."), tr("Click to view"));
|
||||
connect(trayIcon, SIGNAL(messageClicked()), chatView, SLOT(actMessageClicked()));
|
||||
|
|
|
@ -604,4 +604,34 @@ void TabSupervisor::processNotifyUserEvent(const Event_NotifyUser &event)
|
|||
default: ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
const QString TabSupervisor::getOwnUsername() const
|
||||
{
|
||||
return QString::fromStdString(userInfo->name());
|
||||
}
|
||||
|
||||
bool TabSupervisor::isUserBuddy(const QString &userName) const
|
||||
{
|
||||
if (!getUserListsTab()) return false;
|
||||
if (!getUserListsTab()->getBuddyList()) return false;
|
||||
QMap<QString, UserListTWI *> buddyList = getUserListsTab()->getBuddyList()->getUsers();
|
||||
bool senderIsBuddy = buddyList.contains(userName);
|
||||
return senderIsBuddy;
|
||||
}
|
||||
|
||||
const ServerInfo_User * TabSupervisor::getOnlineUser(const QString &userName) const
|
||||
{
|
||||
if (!getUserListsTab()) return nullptr;
|
||||
if (!getUserListsTab()->getAllUsersList()) return nullptr;
|
||||
QMap<QString, UserListTWI *> userList = getUserListsTab()->getAllUsersList()->getUsers();
|
||||
const QString &userNameToMatchLower = userName.toLower();
|
||||
QMap<QString, UserListTWI *>::iterator i;
|
||||
|
||||
for (i = userList.begin(); i != userList.end(); ++i)
|
||||
if (i.key().toLower() == userNameToMatchLower) {
|
||||
const ServerInfo_User &userInfo = i.value()->getUserInfo();
|
||||
return &userInfo;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <QMap>
|
||||
#include <QAbstractButton>
|
||||
#include "deck_loader.h"
|
||||
#include "chatview/userlistProxy.h"
|
||||
|
||||
class QMenu;
|
||||
class AbstractClient;
|
||||
|
@ -41,7 +42,7 @@ protected:
|
|||
void paintEvent(QPaintEvent *event);
|
||||
};
|
||||
|
||||
class TabSupervisor : public QTabWidget {
|
||||
class TabSupervisor : public QTabWidget, public UserlistProxy {
|
||||
Q_OBJECT
|
||||
private:
|
||||
ServerInfo_User *userInfo;
|
||||
|
@ -78,6 +79,9 @@ public:
|
|||
const QMap<int, TabRoom *> &getRoomTabs() const { return roomTabs; }
|
||||
bool getAdminLocked() const;
|
||||
bool closeRequest();
|
||||
const QString getOwnUsername() const;
|
||||
bool isUserBuddy(const QString &userName) const;
|
||||
const ServerInfo_User* getOnlineUser(const QString &userName) const;
|
||||
signals:
|
||||
void setMenu(const QList<QMenu *> &newMenuList = QList<QMenu *>());
|
||||
void localGameEnded();
|
||||
|
|
Loading…
Reference in a new issue