servatrice/cockatrice/src/tab_deck_storage.h
ebbit1q 994704d353
implement max lengths for input dialogs that are sent to the server (#4522)
* implement max lengths for input dialogs that are sent to the server

* missed a double setMaxLength

* implement max string lengths server side

* add custom getText dialog with max length

* fix deck storage tab and miscellaneous server side

* add max size for deck uploads

* final pass on client side limits
2022-01-16 17:57:01 -05:00

63 lines
1.8 KiB
C++

#ifndef TAB_DECK_STORAGE_H
#define TAB_DECK_STORAGE_H
#include "tab.h"
class AbstractClient;
class QTreeView;
class QFileSystemModel;
class QToolBar;
class QTreeWidget;
class QTreeWidgetItem;
class QGroupBox;
class RemoteDeckList_TreeWidget;
class CommandContainer;
class Response;
class DeckLoader;
class TabDeckStorage : public Tab
{
Q_OBJECT
private:
AbstractClient *client;
QTreeView *localDirView;
QFileSystemModel *localDirModel;
QToolBar *leftToolBar, *rightToolBar;
RemoteDeckList_TreeWidget *serverDirView;
QGroupBox *leftGroupBox, *rightGroupBox;
QAction *aOpenLocalDeck, *aUpload, *aDeleteLocalDeck, *aOpenRemoteDeck, *aDownload, *aNewFolder, *aDeleteRemoteDeck;
QString getTargetPath() const;
private slots:
void actOpenLocalDeck();
void actUpload();
void uploadFinished(const Response &r, const CommandContainer &commandContainer);
void actDeleteLocalDeck();
void actOpenRemoteDeck();
void openRemoteDeckFinished(const Response &r, const CommandContainer &commandContainer);
void actDownload();
void downloadFinished(const Response &r, const CommandContainer &commandContainer, const QVariant &extraData);
void actNewFolder();
void newFolderFinished(const Response &response, const CommandContainer &commandContainer);
void actDeleteRemoteDeck();
void deleteFolderFinished(const Response &response, const CommandContainer &commandContainer);
void deleteDeckFinished(const Response &response, const CommandContainer &commandContainer);
public:
TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_client);
void retranslateUi();
QString getTabText() const
{
return tr("Deck storage");
}
signals:
void openDeckEditor(const DeckLoader *deckLoader);
};
#endif