[Move refactor] Move dialogs to interface/widgets/ (#6234)

* Move dialogs/ underneath interface/widgets since QDialog inherits from QWidget.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2025-10-09 15:25:18 +02:00 committed by GitHub
parent b8983f27ab
commit 474c1d0d89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 60 additions and 60 deletions

View file

@ -0,0 +1,49 @@
#include "dlg_startup_card_check.h"
#include <QDate>
#include <libcockatrice/settings/cache_settings.h>
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);
}