mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 10:04:46 -07:00
Add options to include/exclude set name and collector number during clipboard import/export. (#5482)
* Add options to include/exclude set name and collector number during clipboard import/export. * Missing parentheses in action label. * Revert the silliest lint in the world. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
315c224f24
commit
80165c28a9
6 changed files with 108 additions and 17 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "../settings/cache_settings.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCheckBox>
|
||||
#include <QClipboard>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QMessageBox>
|
||||
|
|
@ -24,9 +25,16 @@ DlgLoadDeckFromClipboard::DlgLoadDeckFromClipboard(QWidget *parent) : QDialog(pa
|
|||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOK()));
|
||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
||||
loadSetNameAndNumberCheckBox = new QCheckBox(tr("Parse Set Name and Number (if available)"));
|
||||
loadSetNameAndNumberCheckBox->setChecked(true);
|
||||
|
||||
auto *buttonLayout = new QHBoxLayout;
|
||||
buttonLayout->addWidget(loadSetNameAndNumberCheckBox);
|
||||
buttonLayout->addWidget(buttonBox);
|
||||
|
||||
auto *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addWidget(contentsEdit);
|
||||
mainLayout->addWidget(buttonBox);
|
||||
mainLayout->addLayout(buttonLayout);
|
||||
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
@ -65,7 +73,11 @@ void DlgLoadDeckFromClipboard::actOK()
|
|||
}
|
||||
} else if (deckLoader->loadFromStream_Plain(stream)) {
|
||||
deckList = deckLoader;
|
||||
deckList->resolveSetNameAndNumberToProviderID();
|
||||
if (loadSetNameAndNumberCheckBox->isChecked()) {
|
||||
deckList->resolveSetNameAndNumberToProviderID();
|
||||
} else {
|
||||
deckList->clearSetNamesAndNumbers();
|
||||
}
|
||||
accept();
|
||||
} else {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Invalid deck list."));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue