mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 19:18:55 -07:00
fixed issue #49: when editing a remote deck, be able to directly save it there
This commit is contained in:
parent
f00eaa83d4
commit
0eee6d7ab9
23 changed files with 324 additions and 181 deletions
33
cockatrice/src/deck_loader.h
Normal file
33
cockatrice/src/deck_loader.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef DECK_LOADER_H
|
||||
#define DECK_LOADER_H
|
||||
|
||||
#include "decklist.h"
|
||||
|
||||
class DeckLoader : public DeckList {
|
||||
Q_OBJECT
|
||||
signals:
|
||||
void deckLoaded();
|
||||
public:
|
||||
enum FileFormat { PlainTextFormat, CockatriceFormat };
|
||||
static const QStringList fileNameFilters;
|
||||
private:
|
||||
QString lastFileName;
|
||||
FileFormat lastFileFormat;
|
||||
int lastRemoteDeckId;
|
||||
public:
|
||||
DeckLoader();
|
||||
DeckLoader(const QString &nativeString);
|
||||
DeckLoader(const DeckList &other);
|
||||
DeckLoader(const DeckLoader &other);
|
||||
const QString &getLastFileName() const { return lastFileName; }
|
||||
FileFormat getLastFileFormat() const { return lastFileFormat; }
|
||||
int getLastRemoteDeckId() const { return lastRemoteDeckId; }
|
||||
|
||||
static FileFormat getFormatFromNameFilter(const QString &selectedNameFilter);
|
||||
|
||||
bool loadFromFile(const QString &fileName, FileFormat fmt);
|
||||
bool loadFromRemote(const QString &nativeString, int remoteDeckId);
|
||||
bool saveToFile(const QString &fileName, FileFormat fmt);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue