mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Move UserlistProxy to src/server/user and fix capitalization (#5475)
* move file * fix capitalization
This commit is contained in:
parent
2def02e140
commit
455d68f9ea
15 changed files with 34 additions and 33 deletions
|
|
@ -123,7 +123,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay)
|
|||
}
|
||||
|
||||
TabGame::TabGame(TabSupervisor *_tabSupervisor,
|
||||
UserlistProxy *_userListProxy,
|
||||
UserListProxy *_userListProxy,
|
||||
QList<AbstractClient *> &_clients,
|
||||
const Event_GameJoined &event,
|
||||
const QMap<int, QString> &_roomGameTypes)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <QCompleter>
|
||||
#include <QMap>
|
||||
|
||||
class UserlistProxy;
|
||||
class UserListProxy;
|
||||
class DeckViewContainer;
|
||||
class AbstractClient;
|
||||
class CardDatabase;
|
||||
|
|
@ -67,7 +67,7 @@ class TabGame : public Tab
|
|||
private:
|
||||
QTimer *gameTimer;
|
||||
int secondsElapsed;
|
||||
UserlistProxy *userListProxy;
|
||||
UserListProxy *userListProxy;
|
||||
QList<AbstractClient *> clients;
|
||||
ServerInfo_Game gameInfo;
|
||||
QMap<int, QString> roomGameTypes;
|
||||
|
|
@ -212,7 +212,7 @@ private slots:
|
|||
|
||||
public:
|
||||
TabGame(TabSupervisor *_tabSupervisor,
|
||||
UserlistProxy *_userListProxy,
|
||||
UserListProxy *_userListProxy,
|
||||
QList<AbstractClient *> &_clients,
|
||||
const Event_GameJoined &event,
|
||||
const QMap<int, QString> &_roomGameTypes);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
TabRoom::TabRoom(TabSupervisor *_tabSupervisor,
|
||||
AbstractClient *_client,
|
||||
ServerInfo_User *_ownUser,
|
||||
const UserlistProxy *_userListProxy,
|
||||
const UserListProxy *_userListProxy,
|
||||
const ServerInfo_Room &info)
|
||||
: Tab(_tabSupervisor), client(_client), roomId(info.room_id()), roomName(QString::fromStdString(info.name())),
|
||||
ownUser(_ownUser), userListProxy(_userListProxy)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <QKeyEvent>
|
||||
#include <QMap>
|
||||
|
||||
class UserlistProxy;
|
||||
class UserListProxy;
|
||||
class UserListManager;
|
||||
namespace google
|
||||
{
|
||||
|
|
@ -51,7 +51,7 @@ private:
|
|||
|
||||
GameSelector *gameSelector;
|
||||
UserListWidget *userList;
|
||||
const UserlistProxy *userListProxy;
|
||||
const UserListProxy *userListProxy;
|
||||
ChatView *chatView;
|
||||
QLabel *sayLabel;
|
||||
LineEditCompleter *sayEdit;
|
||||
|
|
@ -92,7 +92,7 @@ public:
|
|||
TabRoom(TabSupervisor *_tabSupervisor,
|
||||
AbstractClient *_client,
|
||||
ServerInfo_User *_ownUser,
|
||||
const UserlistProxy *_userListProxy,
|
||||
const UserListProxy *_userListProxy,
|
||||
const ServerInfo_Room &info);
|
||||
void retranslateUi() override;
|
||||
void closeRequest(bool forced = false) override;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define TAB_SUPERVISOR_H
|
||||
|
||||
#include "../../deck/deck_loader.h"
|
||||
#include "../../server/chat_view/user_list_proxy.h"
|
||||
#include "../../server/user/user_list_proxy.h"
|
||||
#include "visual_deck_storage/tab_deck_storage_visual.h"
|
||||
|
||||
#include <QAbstractButton>
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ void GamesModel::updateGameList(const ServerInfo_Game &game)
|
|||
endInsertRows();
|
||||
}
|
||||
|
||||
GamesProxyModel::GamesProxyModel(QObject *parent, const UserlistProxy *_userListProxy)
|
||||
GamesProxyModel::GamesProxyModel(QObject *parent, const UserListProxy *_userListProxy)
|
||||
: QSortFilterProxyModel(parent), userListProxy(_userListProxy)
|
||||
{
|
||||
resetFilterParameters();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <QStringList>
|
||||
#include <QTime>
|
||||
|
||||
class UserlistProxy;
|
||||
class UserListProxy;
|
||||
|
||||
class GamesModel : public QAbstractTableModel
|
||||
{
|
||||
|
|
@ -66,7 +66,7 @@ class GamesProxyModel : public QSortFilterProxyModel
|
|||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
const UserlistProxy *userListProxy;
|
||||
const UserListProxy *userListProxy;
|
||||
|
||||
// If adding any additional filters, make sure to update:
|
||||
// - GamesProxyModel()
|
||||
|
|
@ -88,7 +88,7 @@ private:
|
|||
showOnlyIfSpectatorsCanSeeHands;
|
||||
|
||||
public:
|
||||
GamesProxyModel(QObject *parent = nullptr, const UserlistProxy *_userListProxy = nullptr);
|
||||
GamesProxyModel(QObject *parent = nullptr, const UserListProxy *_userListProxy = nullptr);
|
||||
|
||||
bool getShowBuddiesOnlyGames() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include "../../client/ui/pixel_map_generator.h"
|
||||
#include "../../settings/cache_settings.h"
|
||||
#include "../user/user_context_menu.h"
|
||||
#include "../user/user_list_proxy.h"
|
||||
#include "user_level.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
|
@ -22,11 +23,11 @@ UserMessagePosition::UserMessagePosition(QTextCursor &cursor)
|
|||
}
|
||||
|
||||
ChatView::ChatView(TabSupervisor *_tabSupervisor,
|
||||
const UserlistProxy *_userlistProxy,
|
||||
const UserListProxy *_userListProxy,
|
||||
TabGame *_game,
|
||||
bool _showTimestamps,
|
||||
QWidget *parent)
|
||||
: QTextBrowser(parent), tabSupervisor(_tabSupervisor), game(_game), userlistProxy(_userlistProxy), evenNumber(true),
|
||||
: QTextBrowser(parent), tabSupervisor(_tabSupervisor), game(_game), userListProxy(_userListProxy), evenNumber(true),
|
||||
showTimestamps(_showTimestamps), hoveredItemType(HoveredNothing)
|
||||
{
|
||||
if (palette().windowText().color().lightness() > 200) {
|
||||
|
|
@ -45,10 +46,10 @@ ChatView::ChatView(TabSupervisor *_tabSupervisor,
|
|||
linkColor = palette().link().color();
|
||||
}
|
||||
|
||||
userContextMenu = new UserContextMenu(tabSupervisor, userlistProxy, this, game);
|
||||
userContextMenu = new UserContextMenu(tabSupervisor, userListProxy, this, game);
|
||||
connect(userContextMenu, SIGNAL(openMessageDialog(QString, bool)), this, SIGNAL(openMessageDialog(QString, bool)));
|
||||
|
||||
ownUserName = userlistProxy->getOwnUsername();
|
||||
ownUserName = userListProxy->getOwnUsername();
|
||||
mention = "@" + ownUserName;
|
||||
|
||||
mentionFormat.setFontWeight(QFont::Bold);
|
||||
|
|
@ -189,7 +190,7 @@ void ChatView::appendMessage(QString message,
|
|||
cursor.insertText(" ");
|
||||
} else {
|
||||
const int pixelSize = QFontInfo(cursor.charFormat().font()).pixelSize();
|
||||
bool isBuddy = userlistProxy->isUserBuddy(userName);
|
||||
bool isBuddy = userListProxy->isUserBuddy(userName);
|
||||
cursor.insertImage(
|
||||
UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, isBuddy, UserPrivLevel).toImage());
|
||||
cursor.insertText(" ");
|
||||
|
|
@ -328,7 +329,7 @@ void ChatView::checkMention(QTextCursor &cursor, QString &message, const QString
|
|||
QString mentionIntact = fullMentionUpToSpaceOrEnd;
|
||||
|
||||
while (fullMentionUpToSpaceOrEnd.size()) {
|
||||
const ServerInfo_User *onlineUser = userlistProxy->getOnlineUser(fullMentionUpToSpaceOrEnd);
|
||||
const ServerInfo_User *onlineUser = userListProxy->getOnlineUser(fullMentionUpToSpaceOrEnd);
|
||||
if (onlineUser) // Is there a user online named this?
|
||||
{
|
||||
if (ownUserName.toLower() == fullMentionUpToSpaceOrEnd.toLower()) // Is this user you?
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
#include "../user/user_list_widget.h"
|
||||
#include "room_message_type.h"
|
||||
#include "user_level.h"
|
||||
#include "user_list_proxy.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QColor>
|
||||
|
|
@ -16,6 +15,7 @@
|
|||
class QTextTable;
|
||||
class QMouseEvent;
|
||||
class UserContextMenu;
|
||||
class UserListProxy;
|
||||
class TabGame;
|
||||
|
||||
class UserMessagePosition
|
||||
|
|
@ -44,7 +44,7 @@ private:
|
|||
HoveredCard,
|
||||
HoveredUser
|
||||
};
|
||||
const UserlistProxy *const userlistProxy;
|
||||
const UserListProxy *const userListProxy;
|
||||
UserContextMenu *userContextMenu;
|
||||
QString lastSender;
|
||||
QString ownUserName;
|
||||
|
|
@ -84,7 +84,7 @@ private slots:
|
|||
|
||||
public:
|
||||
ChatView(TabSupervisor *_tabSupervisor,
|
||||
const UserlistProxy *_userlistProxy,
|
||||
const UserListProxy *_userListProxy,
|
||||
TabGame *_game,
|
||||
bool _showTimestamps,
|
||||
QWidget *parent = nullptr);
|
||||
|
|
|
|||
|
|
@ -863,10 +863,10 @@ void MessageLogWidget::connectToPlayer(Player *player)
|
|||
}
|
||||
|
||||
MessageLogWidget::MessageLogWidget(TabSupervisor *_tabSupervisor,
|
||||
const UserlistProxy *_userlistProxy,
|
||||
const UserListProxy *_userListProxy,
|
||||
TabGame *_game,
|
||||
QWidget *parent)
|
||||
: ChatView(_tabSupervisor, _userlistProxy, _game, true, parent), mulliganNumber(0),
|
||||
: ChatView(_tabSupervisor, _userListProxy, _game, true, parent), mulliganNumber(0),
|
||||
currentContext(MessageContext_None)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public slots:
|
|||
public:
|
||||
void connectToPlayer(Player *player);
|
||||
MessageLogWidget(TabSupervisor *_tabSupervisor,
|
||||
const UserlistProxy *_userlistProxy,
|
||||
const UserListProxy *_userListProxy,
|
||||
TabGame *_game,
|
||||
QWidget *parent = nullptr);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
#include "../../client/tabs/tab_game.h"
|
||||
#include "../../client/tabs/tab_supervisor.h"
|
||||
#include "../../game/game_selector.h"
|
||||
#include "../../server/chat_view/user_list_proxy.h"
|
||||
#include "../chat_view/chat_view.h"
|
||||
#include "../pending_command.h"
|
||||
#include "pb/command_kick_from_game.pb.h"
|
||||
|
|
@ -19,6 +18,7 @@
|
|||
#include "pb/response_warn_list.pb.h"
|
||||
#include "pb/session_commands.pb.h"
|
||||
#include "user_info_box.h"
|
||||
#include "user_list_proxy.h"
|
||||
#include "user_list_widget.h"
|
||||
|
||||
#include <QAction>
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
#include <QtWidgets>
|
||||
|
||||
UserContextMenu::UserContextMenu(TabSupervisor *_tabSupervisor,
|
||||
const UserlistProxy *_userListProxy,
|
||||
const UserListProxy *_userListProxy,
|
||||
QWidget *parent,
|
||||
TabGame *_game)
|
||||
: QObject(parent), client(_tabSupervisor->getClient()), tabSupervisor(_tabSupervisor),
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
class UserlistProxy;
|
||||
class UserListProxy;
|
||||
class AbstractClient;
|
||||
class ChatView;
|
||||
class CommandContainer;
|
||||
|
|
@ -23,7 +23,7 @@ class UserContextMenu : public QObject
|
|||
private:
|
||||
AbstractClient *client;
|
||||
TabSupervisor *tabSupervisor;
|
||||
const UserlistProxy *userListProxy;
|
||||
const UserListProxy *userListProxy;
|
||||
TabGame *game;
|
||||
|
||||
QAction *aUserName;
|
||||
|
|
@ -55,7 +55,7 @@ private slots:
|
|||
|
||||
public:
|
||||
UserContextMenu(TabSupervisor *_tabSupervisor,
|
||||
const UserlistProxy *_userListProxy,
|
||||
const UserListProxy *_userListProxy,
|
||||
QWidget *_parent,
|
||||
TabGame *_game = 0);
|
||||
void retranslateUi();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef COCKATRICE_USER_LIST_MANAGER_H
|
||||
#define COCKATRICE_USER_LIST_MANAGER_H
|
||||
|
||||
#include "../chat_view/user_list_proxy.h"
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include "user_list_proxy.h"
|
||||
|
||||
#include <QMap>
|
||||
#include <QWidget>
|
||||
|
|
@ -17,7 +17,7 @@ class Response;
|
|||
class ServerInfo_User;
|
||||
class TabSupervisor;
|
||||
|
||||
class UserListManager : public QWidget, public UserlistProxy
|
||||
class UserListManager : public QWidget, public UserListProxy
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ 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
|
||||
class UserListProxy
|
||||
{
|
||||
public:
|
||||
virtual bool isOwnUserRegistered() const = 0;
|
||||
Loading…
Add table
Add a link
Reference in a new issue