Merge pull request #26 from jfreake/master
Deck Load Mods and Movable Tabs
This commit is contained in:
commit
0da2647a7b
3 changed files with 9 additions and 4 deletions
|
@ -4,9 +4,9 @@
|
|||
#include "decklist.h"
|
||||
|
||||
const QStringList DeckLoader::fileNameFilters = QStringList()
|
||||
<< QObject::tr("All files (*.*)")
|
||||
<< QObject::tr("Cockatrice decks (*.cod)")
|
||||
<< QObject::tr("Plain text decks (*.dec *.mwDeck)")
|
||||
<< QObject::tr("All files (*.*)");
|
||||
<< QObject::tr("Plain text decks (*.dec *.mwDeck)");
|
||||
|
||||
DeckLoader::DeckLoader()
|
||||
: DeckList(),
|
||||
|
@ -94,8 +94,8 @@ bool DeckLoader::saveToFile(const QString &fileName, FileFormat fmt)
|
|||
DeckLoader::FileFormat DeckLoader::getFormatFromNameFilter(const QString &selectedNameFilter)
|
||||
{
|
||||
switch (fileNameFilters.indexOf(selectedNameFilter)) {
|
||||
case 0: return CockatriceFormat;
|
||||
case 1: return PlainTextFormat;
|
||||
case 1: return CockatriceFormat;
|
||||
case 2: return PlainTextFormat;
|
||||
}
|
||||
return PlainTextFormat;
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ TabSupervisor::TabSupervisor(AbstractClient *_client, QWidget *parent)
|
|||
{
|
||||
tabChangedIcon = new QIcon(":/resources/icon_tab_changed.svg");
|
||||
setElideMode(Qt::ElideRight);
|
||||
setMovable(true);
|
||||
setIconSize(QSize(15, 15));
|
||||
connect(this, SIGNAL(currentChanged(int)), this, SLOT(updateCurrent(int)));
|
||||
|
||||
|
|
|
@ -449,8 +449,12 @@ bool DeckList::loadFromStream_Plain(QTextStream &in)
|
|||
line.remove(rx);
|
||||
rx.setPattern("\\(.*\\)");
|
||||
line.remove(rx);
|
||||
//Filter out post card name editions
|
||||
rx.setPattern("\\|.*$");
|
||||
line.remove(rx);
|
||||
line = line.simplified();
|
||||
|
||||
|
||||
int i = line.indexOf(' ');
|
||||
bool ok;
|
||||
int number = line.left(i).toInt(&ok);
|
||||
|
|
Loading…
Reference in a new issue