mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-20 07:45:17 -05:00
almost finished pre-game deck loading
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user