Load .cod files from clipboard
This commit is contained in:
parent
bfa002e50a
commit
0b8fab4721
1 changed files with 14 additions and 1 deletions
|
@ -48,7 +48,20 @@ void DlgLoadDeckFromClipboard::actOK()
|
||||||
QTextStream stream(&buffer);
|
QTextStream stream(&buffer);
|
||||||
|
|
||||||
DeckLoader *l = new DeckLoader;
|
DeckLoader *l = new DeckLoader;
|
||||||
if (l->loadFromStream_Plain(stream)) {
|
if (buffer.contains("<cockatrice_deck version=\"1\">"))
|
||||||
|
{
|
||||||
|
if (l->loadFromString_Native(buffer))
|
||||||
|
{
|
||||||
|
deckList = l;
|
||||||
|
accept();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::critical(this, tr("Error"), tr("Invalid deck list."));
|
||||||
|
delete l;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (l->loadFromStream_Plain(stream)) {
|
||||||
deckList = l;
|
deckList = l;
|
||||||
accept();
|
accept();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue