Allow starting wizard from settings

This commit is contained in:
Martchus 2022-08-27 15:06:55 +02:00
parent 3bbbab035c
commit a435cab604
2 changed files with 25 additions and 0 deletions

View File

@ -1,4 +1,6 @@
#include "./settingsdialog.h"
#include "./settings.h"
#include "./wizard.h"
#include "../misc/syncthinglauncher.h"
@ -1463,10 +1465,30 @@ void SettingsDialog::init()
setWindowIcon(
QIcon::fromTheme(QStringLiteral("preferences-other"), QIcon(QStringLiteral(":/icons/hicolor/scalable/apps/preferences-other.svg"))));
// add button for starting wizard
if (!::Settings::values().enableWipFeatures) {
return;
}
auto *startWizardButton = new QPushButton(this);
startWizardButton->setToolTip(tr("Start wizard"));
startWizardButton->setIcon(
QIcon::fromTheme(QStringLiteral("tools-wizard"), QIcon(QStringLiteral(":/icons/hicolor/scalable/actions/tools-wizard.svg"))));
startWizardButton->setFlat(true);
startWizardButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
connect(startWizardButton, &QPushButton::clicked, this, &SettingsDialog::showWizard);
addHeadingWidget(startWizardButton);
// some settings could be applied without restarting the application, good idea?
//connect(this, &Dialogs::SettingsDialog::applied, bind(&Dialogs::QtSettings::apply, &Settings::qtSettings()));
}
void SettingsDialog::showWizard()
{
auto *const wizard = Wizard::instance();
QtUtilities::centerWidget(wizard);
wizard->show();
}
void SettingsDialog::hideConnectionStatus()
{
m_connectionsOptionPage->hideConnectionStatus();

View File

@ -175,6 +175,9 @@ public:
~SettingsDialog() override;
void hideConnectionStatus();
private Q_SLOTS:
void showWizard();
private:
void init();