almost finished pre-game deck loading

This commit is contained in:
Max-Wilhelm Bruker 2009-11-22 01:30:16 +01:00
parent 8dcf81654e
commit cf21528a69
16 changed files with 140 additions and 64 deletions

View file

@ -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();