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