mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 18:43:55 -07:00
Some checks are pending
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 15 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Docker Image / amd64 & arm64 (push) Waiting to run
* [Room] Additionally show a tab for friends and ignored users instead of just all online users.
Took 21 minutes
Took 12 minutes
* [Room][UserList] Introduce style delegate for user list
- Allow users to set a card name and parameters as their background banner
- Allow mods to white/blacklist cards
- Allow toggling back to the old display style
Took 7 minutes
Took 28 seconds
Took 2 minutes
Took 2 minutes
* Right checkstate.
Took 14 minutes
Took 2 minutes
* Utility for test.
Took 9 minutes
Took 8 seconds
Took 2 seconds
* Lint.
Took 10 minutes
* Algorithm for sql schema migration
Took 13 minutes
* Use {prefix}, bound card name, return errors.
Took 27 seconds
* Convert queue to while loop.
Took 19 seconds
* Hover popup.
Took 36 minutes
Took 1 minute
* More granular signals, popup for user info.
Took 25 minutes
Took 8 seconds
Took 16 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
135 lines
3.2 KiB
C++
135 lines
3.2 KiB
C++
/**
|
|
* @file tab_room.h
|
|
* @ingroup RoomTabs
|
|
* @ingroup Lobby
|
|
*/
|
|
//! \todo Document this file.
|
|
|
|
#ifndef TAB_ROOM_H
|
|
#define TAB_ROOM_H
|
|
|
|
#include "../interface/widgets/utility/line_edit_completer.h"
|
|
#include "tab.h"
|
|
|
|
#include <QFocusEvent>
|
|
#include <QGroupBox>
|
|
#include <QMap>
|
|
|
|
class UserListProxy;
|
|
class UserListManager;
|
|
namespace google
|
|
{
|
|
namespace protobuf
|
|
{
|
|
class Message;
|
|
}
|
|
} // namespace google
|
|
class AbstractClient;
|
|
class UserListWidget;
|
|
class QLabel;
|
|
class ChatView;
|
|
class QPushButton;
|
|
class QTextTable;
|
|
class QCompleter;
|
|
class RoomEvent;
|
|
class ServerInfo_Room;
|
|
class ServerInfo_Game;
|
|
class Event_ListGames;
|
|
class Event_JoinRoom;
|
|
class Event_LeaveRoom;
|
|
class Event_RoomSay;
|
|
class Event_RemoveMessages;
|
|
class GameSelector;
|
|
class Response;
|
|
class PendingCommand;
|
|
class ServerInfo_User;
|
|
class LineEditCompleter;
|
|
|
|
class TabRoom : public Tab
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
AbstractClient *client;
|
|
int roomId;
|
|
QString roomName;
|
|
ServerInfo_User *ownUser;
|
|
QMap<int, QString> gameTypes;
|
|
|
|
GameSelector *gameSelector;
|
|
UserListWidget *friendsList;
|
|
UserListWidget *userList;
|
|
UserListWidget *ignoreList;
|
|
const UserListProxy *userListProxy;
|
|
ChatView *chatView;
|
|
QLabel *sayLabel;
|
|
LineEditCompleter *sayEdit;
|
|
QGroupBox *chatGroupBox;
|
|
|
|
QMenu *roomMenu;
|
|
QAction *aLeaveRoom;
|
|
QAction *aOpenChatSettings;
|
|
QAction *aClearChat;
|
|
[[nodiscard]] QString sanitizeHtml(QString dirty) const;
|
|
|
|
QStringList autocompleteUserList;
|
|
QCompleter *completer;
|
|
signals:
|
|
void roomClosing(TabRoom *tab);
|
|
void openMessageDialog(const QString &userName, bool focus);
|
|
void maximizeClient();
|
|
void notIdle();
|
|
private slots:
|
|
void sendMessage();
|
|
void sayFinished(const Response &response);
|
|
void actClearChat();
|
|
void actOpenChatSettings();
|
|
void addMentionTag(QString mentionTag);
|
|
void focusTab();
|
|
void actShowMentionPopup(const QString &sender);
|
|
void actShowPopup(const QString &message);
|
|
void actCompleterChanged();
|
|
|
|
void processListGamesEvent(const Event_ListGames &event);
|
|
void processJoinRoomEvent(const Event_JoinRoom &event);
|
|
void processLeaveRoomEvent(const Event_LeaveRoom &event);
|
|
void processRoomSayEvent(const Event_RoomSay &event);
|
|
void processRemoveMessagesEvent(const Event_RemoveMessages &event);
|
|
void refreshShortcuts();
|
|
|
|
protected slots:
|
|
void closeEvent(QCloseEvent *event) override;
|
|
|
|
public:
|
|
TabRoom(TabSupervisor *_tabSupervisor,
|
|
AbstractClient *_client,
|
|
ServerInfo_User *_ownUser,
|
|
const ServerInfo_Room &info);
|
|
void retranslateUi() override;
|
|
void tabActivated() override;
|
|
void processRoomEvent(const RoomEvent &event);
|
|
[[nodiscard]] int getRoomId() const
|
|
{
|
|
return roomId;
|
|
}
|
|
[[nodiscard]] const QMap<int, QString> &getGameTypes() const
|
|
{
|
|
return gameTypes;
|
|
}
|
|
[[nodiscard]] QString getChannelName() const
|
|
{
|
|
return roomName;
|
|
}
|
|
[[nodiscard]] QString getTabText() const override
|
|
{
|
|
return roomName;
|
|
}
|
|
[[nodiscard]] const ServerInfo_User *getUserInfo() const
|
|
{
|
|
return ownUser;
|
|
}
|
|
|
|
PendingCommand *prepareRoomCommand(const ::google::protobuf::Message &cmd);
|
|
void sendRoomCommand(PendingCommand *pend);
|
|
};
|
|
|
|
#endif
|