Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
tab_deck_storage.h
Go to the documentation of this file.
1
7
8#ifndef TAB_DECK_STORAGE_H
9#define TAB_DECK_STORAGE_H
10
11#include "../interface/widgets/server/remote/remote_decklist_tree_widget.h"
12#include "tab.h"
13
14#include <QList>
15#include <QString>
16#include <QStringList>
17#include <QVariant>
19#include <qtmetamacros.h>
20
21struct LoadedDeck;
22class ServerInfo_User;
23class QTreeView;
24class QFileSystemModel;
25class QToolBar;
26class QGroupBox;
27class QTimer;
29class Response;
30class ShareBarWidget;
31class QAction;
32class QModelIndex;
33class TabSupervisor;
34
35class TabDeckStorage : public Tab
36{
37 Q_OBJECT
38private:
40 QTreeView *localDirView;
41 QFileSystemModel *localDirModel;
49
55 QStringList visibilityFailures;
56 QString getTargetPath() const;
57
58 void setRemoteEnabled(bool enabled);
59
60 void showShareNotice(const QString &message, bool warning = false);
61
62 void setShareModeEnabled(bool enabled);
63
64 void uploadDeck(const QString &filePath, const QString &targetPath);
66
67 void downloadNodeAtIndex(const QModelIndex &curLeft, const QModelIndex &curRight);
68
69private slots:
70 void handleConnected(const ServerInfo_User &userInfo);
72
73 void actLocalDoubleClick(const QModelIndex &curLeft);
74 void actOpenLocalDeck();
75
76 void actRenameLocal();
77
78 void actUpload();
79 void uploadFinished(const Response &r, const CommandContainer &commandContainer);
80
81 void actNewLocalFolder();
82 void actDeleteLocalDeck();
83
84 void actOpenDecksFolder();
85
86 void actRemoteDoubleClick(const QModelIndex &curRight);
87 void actOpenRemoteDeck();
88 void openRemoteDeckFinished(const Response &r, const CommandContainer &commandContainer);
89
90 void actDownload();
91 void downloadFinished(const Response &r, const CommandContainer &commandContainer, const QVariant &extraData);
92
93 void actNewFolder();
94 void newFolderFinished(const Response &response, const CommandContainer &commandContainer);
95
96 void actShareDecks();
97 void actShareSelection();
98 void cancelShareDecks();
100 void shareFromTreeFinished(const Response &r, const CommandContainer &commandContainer);
102
103 void actPublishDeck();
104 void setVisibilityFinished(const Response &r, const CommandContainer &commandContainer);
106
107 void actDeleteRemoteDeck();
108 void deleteFolderFinished(const Response &response, const CommandContainer &commandContainer);
109 void deleteDeckFinished(const Response &response, const CommandContainer &commandContainer);
110
111public:
112 TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User *currentUserInfo);
113 void retranslateUi() override;
114 QString getTabText() const override
115 {
116 return tr("Deck Storage");
117 }
118signals:
119 void openDeckEditor(const LoadedDeck &deck);
120};
121
122#endif
ClientStatus
Definition abstract_client.h:58
Definition abstract_client.h:73
Definition remote_decklist_tree_widget.h:37
Definition remote_decklist_tree_widget.h:152
The activated toolbar used to create a temporary deck share.
Definition share_bar_widget.h:27
QFileSystemModel * localDirModel
Definition tab_deck_storage.h:41
QAction * aDeleteRemoteDeck
Definition tab_deck_storage.h:52
QAction * aDeleteLocalDeck
Definition tab_deck_storage.h:50
QToolBar * leftToolBar
Definition tab_deck_storage.h:42
void downloadNodeAtIndex(const QModelIndex &curLeft, const QModelIndex &curRight)
Definition tab_deck_storage.cpp:583
void deleteFolderFinished(const Response &response, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:731
void actOpenLocalDeck()
Definition tab_deck_storage.cpp:343
void retranslateUi() override
Definition tab_deck_storage.cpp:259
QAction * aShareDecks
Definition tab_deck_storage.h:52
QAction * aOpenDecksFolder
Definition tab_deck_storage.h:51
QAction * aOpenLocalDeck
Definition tab_deck_storage.h:50
void onShareFromTreeTimeout()
Definition tab_deck_storage.cpp:899
QAction * aNewFolder
Definition tab_deck_storage.h:52
QAction * aUpload
Definition tab_deck_storage.h:50
QString getTargetPath() const
Definition tab_deck_storage.cpp:282
void openRemoteDeckFinished(const Response &r, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:554
QAction * aRenameLocal
Definition tab_deck_storage.h:50
void handleConnectionChanged(ClientStatus status)
Definition tab_deck_storage.cpp:309
int shareInFlightSeq
Definition tab_deck_storage.h:48
QAction * aNewLocalFolder
Definition tab_deck_storage.h:50
void actShareSelection()
Definition tab_deck_storage.cpp:808
void setVisibilityFinished(const Response &r, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:947
QAction * aPublishDeck
Definition tab_deck_storage.h:52
QTreeView * localDirView
Definition tab_deck_storage.h:40
ShareBarWidget * shareBar
Definition tab_deck_storage.h:45
TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User *currentUserInfo)
Definition tab_deck_storage.cpp:89
QString getTabText() const override
Definition tab_deck_storage.h:114
void actShareDecks()
Definition tab_deck_storage.cpp:744
void actRemoteDoubleClick(const QModelIndex &curRight)
Definition tab_deck_storage.cpp:530
void actOpenRemoteDeck()
Definition tab_deck_storage.cpp:537
QStringList visibilityFailures
Definition tab_deck_storage.h:55
void actLocalDoubleClick(const QModelIndex &curLeft)
Definition tab_deck_storage.cpp:336
void uploadDeck(const QString &filePath, const QString &targetPath)
Definition tab_deck_storage.cpp:418
void actPublishDeck()
Definition tab_deck_storage.cpp:909
void newFolderFinished(const Response &response, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:658
QAction * aDownload
Definition tab_deck_storage.h:52
QGroupBox * leftGroupBox
Definition tab_deck_storage.h:44
void actNewLocalFolder()
Definition tab_deck_storage.cpp:483
void actDownload()
Definition tab_deck_storage.cpp:571
QToolBar * rightToolBar
Definition tab_deck_storage.h:42
int shareRequestSeq
Definition tab_deck_storage.h:47
RemoteDeckList_TreeWidget * serverDirView
Definition tab_deck_storage.h:43
void onVisibilityRefreshTimeout()
Definition tab_deck_storage.cpp:970
QAction * aOpenRemoteDeck
Definition tab_deck_storage.h:52
void setRemoteEnabled(bool enabled)
Definition tab_deck_storage.cpp:318
void actNewFolder()
Definition tab_deck_storage.cpp:630
void actUpload()
Definition tab_deck_storage.cpp:395
void setShareModeEnabled(bool enabled)
Definition tab_deck_storage.cpp:754
void cancelShareDecks()
Definition tab_deck_storage.cpp:749
void actDeleteRemoteDeck()
Definition tab_deck_storage.cpp:669
bool visibilityRefreshStarted
Definition tab_deck_storage.h:53
void shareFromTreeFinished(const Response &r, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:874
void openDeckEditor(const LoadedDeck &deck)
void deleteRemoteDeck(const RemoteDeckList_TreeModel::Node *node)
Definition tab_deck_storage.cpp:687
QTimer * visibilityRefreshTimer
Definition tab_deck_storage.h:54
QGroupBox * rightGroupBox
Definition tab_deck_storage.h:44
void actRenameLocal()
Definition tab_deck_storage.cpp:365
void uploadFinished(const Response &r, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:469
void actDeleteLocalDeck()
Definition tab_deck_storage.cpp:504
void deleteDeckFinished(const Response &response, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:718
void onServerSelectionChanged()
Definition tab_deck_storage.cpp:771
QTimer * shareTimeoutTimer
Definition tab_deck_storage.h:46
void showShareNotice(const QString &message, bool warning=false)
Definition tab_deck_storage.cpp:892
void handleConnected(const ServerInfo_User &userInfo)
Definition tab_deck_storage.cpp:301
void downloadFinished(const Response &r, const CommandContainer &commandContainer, const QVariant &extraData)
Definition tab_deck_storage.cpp:614
AbstractClient * client
Definition tab_deck_storage.h:39
void actOpenDecksFolder()
Definition tab_deck_storage.cpp:524
Definition tab_supervisor.h:92
Tab(TabSupervisor *_tabSupervisor)
Definition tab.cpp:16
Definition commands.proto:8
Represents a deck that was loaded from somewhere. Contains the DeckList itself, as well as info about...
Definition loaded_deck.h:14
Definition response.proto:11
Definition serverinfo_user.proto:2