mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
Automatic Card Database Updates (#6004)
* Add the option to background the oracle wizard, add an option to automatically launch oracle wizard in background every X days since last launch. * Mocks and a typo. * Lint. * Lint? * qOverload the spinBox. * Change to a prompt instead. * An Label. * Update window_main.cpp --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: Zach H <zahalpern+github@gmail.com>
This commit is contained in:
parent
76fdbfaa2f
commit
f3913949b2
16 changed files with 360 additions and 17 deletions
50
cockatrice/src/dialogs/dlg_startup_card_check.cpp
Normal file
50
cockatrice/src/dialogs/dlg_startup_card_check.cpp
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#include "dlg_startup_card_check.h"
|
||||
|
||||
#include "../settings/cache_settings.h"
|
||||
|
||||
#include <QDate>
|
||||
|
||||
DlgStartupCardCheck::DlgStartupCardCheck(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
setWindowTitle(tr("Card Update Check"));
|
||||
|
||||
layout = new QVBoxLayout(this);
|
||||
|
||||
QDate lastCheckDate = SettingsCache::instance().getLastCardUpdateCheck();
|
||||
int daysAgo = lastCheckDate.daysTo(QDate::currentDate());
|
||||
|
||||
instructionLabel = new QLabel(
|
||||
tr("It has been more than %2 days since you last checked your card database for updates.\nChoose how you would "
|
||||
"like to run the card database updater.\nYou can always change this behavior in the 'General' settings tab.")
|
||||
.arg(daysAgo));
|
||||
|
||||
layout->addWidget(instructionLabel);
|
||||
|
||||
group = new QButtonGroup(this);
|
||||
|
||||
foregroundBtn = new QRadioButton(tr("Run in foreground"));
|
||||
backgroundBtn = new QRadioButton(tr("Run in background"));
|
||||
backgroundAlwaysBtn = new QRadioButton(tr("Run in background and always from now on"));
|
||||
dontPromptBtn = new QRadioButton(tr("Don't prompt again and don't run"));
|
||||
dontRunBtn = new QRadioButton(tr("Don't run this time"));
|
||||
|
||||
group->addButton(foregroundBtn, 0);
|
||||
group->addButton(backgroundBtn, 1);
|
||||
group->addButton(backgroundAlwaysBtn, 2);
|
||||
group->addButton(dontPromptBtn, 3);
|
||||
group->addButton(dontRunBtn, 4);
|
||||
|
||||
foregroundBtn->setChecked(true); // default
|
||||
|
||||
layout->addWidget(foregroundBtn);
|
||||
layout->addWidget(backgroundBtn);
|
||||
layout->addWidget(backgroundAlwaysBtn);
|
||||
layout->addWidget(dontPromptBtn);
|
||||
layout->addWidget(dontRunBtn);
|
||||
|
||||
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
layout->addWidget(buttonBox);
|
||||
|
||||
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue