Allow offline Deck Storage tab (#5518)

* make deck storage tab no longer close on disconnect

* add method for clearing remote decklist model

* handle connect/disconnect in deck storage tab
This commit is contained in:
RickyRister 2025-01-24 19:16:40 -08:00 committed by GitHub
parent e8b1e3ef0c
commit f428148f64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 63 additions and 15 deletions

View file

@ -2,8 +2,10 @@
#define TAB_DECK_STORAGE_H
#include "../../server/remote/remote_decklist_tree_widget.h"
#include "../game_logic/abstract_client.h"
#include "tab.h"
class ServerInfo_User;
class AbstractClient;
class QTreeView;
class QFileSystemModel;
@ -31,12 +33,17 @@ private:
QAction *aOpenRemoteDeck, *aDownload, *aNewFolder, *aDeleteRemoteDeck;
QString getTargetPath() const;
void setRemoteEnabled(bool enabled);
void uploadDeck(const QString &filePath, const QString &targetPath);
void deleteRemoteDeck(const RemoteDeckList_TreeModel::Node *node);
void downloadNodeAtIndex(const QModelIndex &curLeft, const QModelIndex &curRight);
private slots:
void handleConnected(const ServerInfo_User &userInfo);
void handleConnectionChanged(ClientStatus status);
void actLocalDoubleClick(const QModelIndex &curLeft);
void actOpenLocalDeck();
@ -63,7 +70,7 @@ private slots:
void deleteDeckFinished(const Response &response, const CommandContainer &commandContainer);
public:
TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_client);
TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User *currentUserInfo);
void retranslateUi() override;
QString getTabText() const override
{