Commit 1edc34f0 authored by Fabio Bas's avatar Fabio Bas
Browse files

Add an option to force selection of save path

By default oracle saves cards.xml to the correct path, where cockatrice
will be able to pick it up;
if oracle is not able to determine the path or the user unchecks the
option, oracle will ask for a save path
parent bb9a79f8
......@@ -322,11 +322,16 @@ SaveSetsPage::SaveSetsPage(QWidget *parent)
setSubTitle(tr("The following sets has been imported. "
"Press \"Save\" to save the imported cards to the Cockatrice database."));
defaultPathCheckBox = new QCheckBox(this);
defaultPathCheckBox->setText(tr("Save to the default path (recommended)"));
defaultPathCheckBox->setChecked(true);
messageLog = new QTextEdit(this);
messageLog->setReadOnly(true);
QGridLayout *layout = new QGridLayout(this);
layout->addWidget(messageLog, 0, 0);
layout->addWidget(defaultPathCheckBox, 0, 0);
layout->addWidget(messageLog, 1, 0);
setLayout(layout);
}
......@@ -366,7 +371,7 @@ bool SaveSetsPage::validatePage()
QString savePath = dataDir + "/cards.xml";
do {
QString fileName;
if (savePath.isEmpty())
if (savePath.isEmpty() || !defaultPathCheckBox->isChecked())
fileName = QFileDialog::getSaveFileName(this, tr("Save card database"), dataDir + "/cards.xml", tr("XML card database (*.xml)"));
else {
fileName = savePath;
......
......@@ -100,6 +100,7 @@ public:
SaveSetsPage(QWidget *parent = 0);
private:
QTextEdit *messageLog;
QCheckBox * defaultPathCheckBox;
protected:
void initializePage();
void cleanupPage();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment