Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
tab_replays.h
Go to the documentation of this file.
1
7
8#ifndef TAB_REPLAYS_H
9#define TAB_REPLAYS_H
10
11#include "tab.h"
12
13#include <QString>
14#include <QVariant>
16// IWYU pragma: keep
17// GameReplay is a protobuf message passed through the openReplay signal,
18// so the moc-generated code needs the complete type.
19#include <libcockatrice/protocol/pb/game_replay.pb.h>
20#include <qtmetamacros.h>
21
22class ServerInfo_User;
23class Response;
24class QTreeView;
25class QFileSystemModel;
26class QGroupBox;
30class QAction;
31class QModelIndex;
32class TabSupervisor;
33
34class TabReplays : public Tab
35{
36 Q_OBJECT
37private:
39 QTreeView *localDirView;
40 QFileSystemModel *localDirModel;
43
48
49 QGroupBox *createLeftLayout();
50 QGroupBox *createRightLayout();
51
52 void setRemoteEnabled(bool enabled);
53
54 void downloadNodeAtIndex(const QModelIndex &curLeft, const QModelIndex &curRight);
55
56private slots:
57 void handleConnected(const ServerInfo_User &userInfo);
59
60 void actLocalDoubleClick(const QModelIndex &curLeft);
61 void actRenameLocal();
62 void actOpenLocalReplay();
63 void actNewLocalFolder();
65
67
68 void actRemoteDoubleClick(const QModelIndex &curLeft);
71
72 void actDownload();
73 void downloadFinished(const Response &r, const CommandContainer &commandContainer, const QVariant &extraData);
74
76 void keepRemoteReplayFinished(const Response &r, const CommandContainer &commandContainer);
77
79 void deleteRemoteReplayFinished(const Response &r, const CommandContainer &commandContainer);
80
81 void actGetReplayCode();
82 void getReplayCodeFinished(const Response &r, const CommandContainer &commandContainer);
83
85 void submitReplayCodeFinished(const Response &r, const CommandContainer &commandContainer);
86
88signals:
89 void openReplay(GameReplay *replay);
90
91public:
92 TabReplays(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User *currentUserInfo);
93 void retranslateUi() override;
94 [[nodiscard]] QString getTabText() const override
95 {
96 return tr("Game Replays");
97 }
98};
99
100#endif
ClientStatus
Definition abstract_client.h:58
Definition abstract_client.h:73
Definition remote_replay_list_tree_widget.h:124
void submitReplayCodeFinished(const Response &r, const CommandContainer &commandContainer)
Definition tab_replays.cpp:646
void handleConnectionChanged(ClientStatus status)
Definition tab_replays.cpp:270
void actDeleteLocalReplay()
Definition tab_replays.cpp:380
void actKeepRemoteReplay()
Definition tab_replays.cpp:511
QAction * aGetReplayCode
Definition tab_replays.h:46
void downloadNodeAtIndex(const QModelIndex &curLeft, const QModelIndex &curRight)
Definition tab_replays.cpp:459
QGroupBox * rightGroupBox
Definition tab_replays.h:42
void actNewLocalFolder()
Definition tab_replays.cpp:359
QAction * aRenameLocal
Definition tab_replays.h:44
void deleteRemoteReplayFinished(const Response &r, const CommandContainer &commandContainer)
Definition tab_replays.cpp:569
QAction * aSubmitReplayCode
Definition tab_replays.h:47
QAction * aDeleteRemoteReplay
Definition tab_replays.h:46
void actOpenRemoteReplay()
Definition tab_replays.cpp:413
RemoteReplayList_TreeWidget * serverDirView
Definition tab_replays.h:41
QAction * aOpenLocalReplay
Definition tab_replays.h:44
void retranslateUi() override
Definition tab_replays.cpp:243
void actDeleteRemoteReplay()
Definition tab_replays.cpp:545
void downloadFinished(const Response &r, const CommandContainer &commandContainer, const QVariant &extraData)
Definition tab_replays.cpp:490
QGroupBox * createRightLayout()
Definition tab_replays.cpp:177
void openRemoteReplayFinished(const Response &r)
Definition tab_replays.cpp:431
void handleConnected(const ServerInfo_User &userInfo)
Definition tab_replays.cpp:262
void actGetReplayCode()
Definition tab_replays.cpp:580
QAction * aOpenRemoteReplay
Definition tab_replays.h:46
void replayAddedEventReceived(const Event_ReplayAdded &event)
Definition tab_replays.cpp:675
void actRenameLocal()
Definition tab_replays.cpp:329
void actDownload()
Definition tab_replays.cpp:447
QGroupBox * leftGroupBox
Definition tab_replays.h:42
TabReplays(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User *currentUserInfo)
Definition tab_replays.cpp:78
QAction * aDownload
Definition tab_replays.h:46
QAction * aNewLocalFolder
Definition tab_replays.h:44
QAction * aDeleteLocalReplay
Definition tab_replays.h:44
QAction * aOpenReplaysFolder
Definition tab_replays.h:45
QString getTabText() const override
Definition tab_replays.h:94
void openReplay(GameReplay *replay)
QAction * aKeep
Definition tab_replays.h:46
void actOpenReplaysFolder()
Definition tab_replays.cpp:400
void getReplayCodeFinished(const Response &r, const CommandContainer &commandContainer)
Definition tab_replays.cpp:597
void actLocalDoubleClick(const QModelIndex &curLeft)
Definition tab_replays.cpp:293
AbstractClient * client
Definition tab_replays.h:38
void setRemoteEnabled(bool enabled)
Definition tab_replays.cpp:277
void actOpenLocalReplay()
Definition tab_replays.cpp:300
void actSubmitReplayCode()
Definition tab_replays.cpp:628
void keepRemoteReplayFinished(const Response &r, const CommandContainer &commandContainer)
Definition tab_replays.cpp:530
QTreeView * localDirView
Definition tab_replays.h:39
QFileSystemModel * localDirModel
Definition tab_replays.h:40
QGroupBox * createLeftLayout()
Definition tab_replays.cpp:102
void actRemoteDoubleClick(const QModelIndex &curLeft)
Definition tab_replays.cpp:406
Definition tab_supervisor.h:92
Tab(TabSupervisor *_tabSupervisor)
Definition tab.cpp:16
Definition commands.proto:8
Definition event_replay_added.proto:4
Definition game_replay.proto:4
Definition response.proto:11
Definition serverinfo_user.proto:2