Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform 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
15
16class ServerInfo_User;
17class AbstractClient;
18class QTreeView;
19class QFileSystemModel;
20class QToolBar;
21class QTreeWidget;
22class QTreeWidgetItem;
23class QGroupBox;
24class CommandContainer;
25class Response;
26class DeckLoader;
27
28class TabDeckStorage : public Tab
29{
30 Q_OBJECT
31private:
33 QTreeView *localDirView;
34 QFileSystemModel *localDirModel;
38
42 QString getTargetPath() const;
43
44 void setRemoteEnabled(bool enabled);
45
46 void uploadDeck(const QString &filePath, const QString &targetPath);
48
49 void downloadNodeAtIndex(const QModelIndex &curLeft, const QModelIndex &curRight);
50
51private slots:
52 void handleConnected(const ServerInfo_User &userInfo);
54
55 void actLocalDoubleClick(const QModelIndex &curLeft);
56 void actOpenLocalDeck();
57
58 void actRenameLocal();
59
60 void actUpload();
61 void uploadFinished(const Response &r, const CommandContainer &commandContainer);
62
63 void actNewLocalFolder();
64 void actDeleteLocalDeck();
65
66 void actOpenDecksFolder();
67
68 void actRemoteDoubleClick(const QModelIndex &curRight);
69 void actOpenRemoteDeck();
70 void openRemoteDeckFinished(const Response &r, const CommandContainer &commandContainer);
71
72 void actDownload();
73 void downloadFinished(const Response &r, const CommandContainer &commandContainer, const QVariant &extraData);
74
75 void actNewFolder();
76 void newFolderFinished(const Response &response, const CommandContainer &commandContainer);
77
79 void deleteFolderFinished(const Response &response, const CommandContainer &commandContainer);
80 void deleteDeckFinished(const Response &response, const CommandContainer &commandContainer);
81
82public:
83 TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User *currentUserInfo);
84 void retranslateUi() override;
85 QString getTabText() const override
86 {
87 return tr("Deck Storage");
88 }
89signals:
90 void openDeckEditor(DeckLoader *deckLoader);
91};
92
93#endif
TODO: Document this.
ClientStatus
Definition abstract_client.h:36
Definition abstract_client.h:51
Definition remote_decklist_tree_widget.h:26
Definition remote_decklist_tree_widget.h:120
QFileSystemModel * localDirModel
Definition tab_deck_storage.h:34
QAction * aDeleteRemoteDeck
Definition tab_deck_storage.h:41
QAction * aDeleteLocalDeck
Definition tab_deck_storage.h:39
QToolBar * leftToolBar
Definition tab_deck_storage.h:35
void downloadNodeAtIndex(const QModelIndex &curLeft, const QModelIndex &curRight)
Definition tab_deck_storage.cpp:454
void deleteFolderFinished(const Response &response, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:594
void actOpenLocalDeck()
Definition tab_deck_storage.cpp:236
void retranslateUi() override
Definition tab_deck_storage.cpp:164
QAction * aOpenDecksFolder
Definition tab_deck_storage.h:40
QAction * aOpenLocalDeck
Definition tab_deck_storage.h:39
QAction * aNewFolder
Definition tab_deck_storage.h:41
QAction * aUpload
Definition tab_deck_storage.h:39
QString getTargetPath() const
Definition tab_deck_storage.cpp:181
void openRemoteDeckFinished(const Response &r, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:427
QAction * aRenameLocal
Definition tab_deck_storage.h:39
void handleConnectionChanged(ClientStatus status)
Definition tab_deck_storage.cpp:207
QAction * aNewLocalFolder
Definition tab_deck_storage.h:39
QTreeView * localDirView
Definition tab_deck_storage.h:33
TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User *currentUserInfo)
Definition tab_deck_storage.cpp:32
QString getTabText() const override
Definition tab_deck_storage.h:85
void actRemoteDoubleClick(const QModelIndex &curRight)
Definition tab_deck_storage.cpp:404
void actOpenRemoteDeck()
Definition tab_deck_storage.cpp:411
void actLocalDoubleClick(const QModelIndex &curLeft)
Definition tab_deck_storage.cpp:229
void uploadDeck(const QString &filePath, const QString &targetPath)
Definition tab_deck_storage.cpp:305
void newFolderFinished(const Response &response, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:525
QAction * aDownload
Definition tab_deck_storage.h:41
QGroupBox * leftGroupBox
Definition tab_deck_storage.h:37
void actNewLocalFolder()
Definition tab_deck_storage.cpp:359
void actDownload()
Definition tab_deck_storage.cpp:442
QToolBar * rightToolBar
Definition tab_deck_storage.h:35
RemoteDeckList_TreeWidget * serverDirView
Definition tab_deck_storage.h:36
QAction * aOpenRemoteDeck
Definition tab_deck_storage.h:41
void setRemoteEnabled(bool enabled)
Definition tab_deck_storage.cpp:214
void actNewFolder()
Definition tab_deck_storage.cpp:499
void actUpload()
Definition tab_deck_storage.cpp:282
void actDeleteRemoteDeck()
Definition tab_deck_storage.cpp:535
void openDeckEditor(DeckLoader *deckLoader)
void deleteRemoteDeck(const RemoteDeckList_TreeModel::Node *node)
Definition tab_deck_storage.cpp:553
QGroupBox * rightGroupBox
Definition tab_deck_storage.h:37
void actRenameLocal()
Definition tab_deck_storage.cpp:252
void uploadFinished(const Response &r, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:345
void actDeleteLocalDeck()
Definition tab_deck_storage.cpp:379
void deleteDeckFinished(const Response &response, const CommandContainer &commandContainer)
Definition tab_deck_storage.cpp:583
void handleConnected(const ServerInfo_User &userInfo)
Definition tab_deck_storage.cpp:199
void downloadFinished(const Response &r, const CommandContainer &commandContainer, const QVariant &extraData)
Definition tab_deck_storage.cpp:485
AbstractClient * client
Definition tab_deck_storage.h:32
void actOpenDecksFolder()
Definition tab_deck_storage.cpp:398
Definition tab_supervisor.h:83
Tab(TabSupervisor *_tabSupervisor)
Definition tab.cpp:11
TODO: Document this.