mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 17:45:09 -07:00
* [Application] Add single instance guard and mime types. Took 2 hours 39 minutes Took 18 minutes Took 5 minutes Took 12 seconds Took 11 seconds * Rework Took 30 minutes Took 50 seconds * Only enforce single instance if launched with arguments. Took 5 minutes * Prototype intents Took 53 minutes Took 6 seconds * Connect/disconnect and join game/room intents. Took 3 hours 14 minutes Took 2 seconds Took 15 seconds * Fix include. Took 1 minute Took 23 seconds Took 2 seconds * Mac handling. Took 10 minutes Took 12 seconds Took 3 minutes * Lint. Took 3 minutes * Rebase. Took 3 minutes Took 17 seconds * Implement UrlSchemeEventFilter Took 10 minutes Took 7 seconds * Qt Moc Took 3 minutes * Modern PList. Took 21 minutes Took 1 minute * Debug output. Took 6 minutes Took 19 minutes * Watch file:// prefix. Took 15 minutes Took 7 seconds * Better handler. Took 6 minutes * Don't store reference in member Took 5 minutes * Move impl to cpp, fix lifetime issues. Took 11 minutes Took 2 minutes * Better single-instance handoff, url intent harded copy game link context-menu Polish for installers Took 35 minutes Took 8 seconds --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
76 lines
1.7 KiB
C++
76 lines
1.7 KiB
C++
/**
|
|
* @file tab_server.h
|
|
* @ingroup ServerTabs
|
|
*/
|
|
//! \todo Document this file.
|
|
|
|
#ifndef TAB_SERVER_H
|
|
#define TAB_SERVER_H
|
|
|
|
#include "tab.h"
|
|
|
|
#include <QGroupBox>
|
|
#include <QTextBrowser>
|
|
#include <QTreeWidget>
|
|
|
|
class AbstractClient;
|
|
class QTextEdit;
|
|
class QLabel;
|
|
class UserListWidget;
|
|
class QPushButton;
|
|
|
|
class Event_ListRooms;
|
|
class Event_ServerMessage;
|
|
class Response;
|
|
class ServerInfo_Room;
|
|
class CommandContainer;
|
|
|
|
class RoomSelector : public QGroupBox
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
QTreeWidget *roomList;
|
|
QPushButton *joinButton;
|
|
AbstractClient *client;
|
|
QString getRoomPermissionDisplay(const ServerInfo_Room &room);
|
|
private slots:
|
|
void processListRoomsEvent(const Event_ListRooms &event);
|
|
void joinClicked();
|
|
signals:
|
|
void joinRoomRequest(int, bool setCurrent);
|
|
|
|
public:
|
|
explicit RoomSelector(AbstractClient *_client, QWidget *parent = nullptr);
|
|
void retranslateUi();
|
|
};
|
|
|
|
class TabServer : public Tab
|
|
{
|
|
Q_OBJECT
|
|
signals:
|
|
void roomJoined(const ServerInfo_Room &info, bool setCurrent);
|
|
void roomJoinFailed(int roomId);
|
|
private slots:
|
|
void processServerMessageEvent(const Event_ServerMessage &event);
|
|
void joinRoomFinished(const Response &resp,
|
|
const CommandContainer &commandContainer,
|
|
const QVariant &extraData,
|
|
int roomId);
|
|
|
|
private:
|
|
AbstractClient *client;
|
|
RoomSelector *roomSelector;
|
|
QTextBrowser *serverInfoBox;
|
|
bool shouldEmitUpdate = false;
|
|
|
|
public:
|
|
TabServer(TabSupervisor *_tabSupervisor, AbstractClient *_client);
|
|
void joinRoom(int id, bool setCurrent);
|
|
void retranslateUi() override;
|
|
[[nodiscard]] QString getTabText() const override
|
|
{
|
|
return tr("Server");
|
|
}
|
|
};
|
|
|
|
#endif
|