mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
almost finished pre-game deck loading
This commit is contained in:
parent
8dcf81654e
commit
cf21528a69
16 changed files with 140 additions and 64 deletions
|
|
@ -173,6 +173,11 @@ QVector<QPair<int, int> > InnerDecklistNode::sort(Qt::SortOrder order)
|
|||
return result;
|
||||
}
|
||||
|
||||
const QStringList DeckList::fileNameFilters = QStringList()
|
||||
<< QObject::tr("Cockatrice decks (*.cod)")
|
||||
<< QObject::tr("Plain text decks (*.dec *.mwDeck)")
|
||||
<< QObject::tr("All files (*.*)");
|
||||
|
||||
DeckList::DeckList(QObject *parent)
|
||||
: QObject(parent), currentZone(0)
|
||||
{
|
||||
|
|
@ -341,6 +346,15 @@ bool DeckList::saveToFile(const QString &fileName, FileFormat fmt)
|
|||
return result;
|
||||
}
|
||||
|
||||
DeckList::FileFormat DeckList::getFormatFromNameFilter(const QString &selectedNameFilter)
|
||||
{
|
||||
switch (fileNameFilters.indexOf(selectedNameFilter)) {
|
||||
case 0: return CockatriceFormat;
|
||||
case 1: return PlainTextFormat;
|
||||
}
|
||||
return PlainTextFormat;
|
||||
}
|
||||
|
||||
void DeckList::cleanList()
|
||||
{
|
||||
root->clearTree();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue