Merge pull request #7488 from nextcloud/bugfix/close-wizard-properly

This commit is contained in:
Claudio Cambra 2024-11-15 13:50:44 +08:00 committed by GitHub
commit 73947c7296
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 0 deletions

View File

@ -85,6 +85,7 @@ void OwncloudSetupWizard::runWizard(QObject *obj, const char *amember, QWidget *
wiz = new OwncloudSetupWizard(parent);
connect(wiz, SIGNAL(ownCloudWizardDone(int)), obj, amember);
connect(wiz->_ocWizard, &OwncloudWizard::wizardClosed, obj, [] { wiz.clear(); });
FolderMan::instance()->setSyncEnabled(false);
wiz->startWizard();
}

View File

@ -408,6 +408,21 @@ void OwncloudWizard::changeEvent(QEvent *e)
QWizard::changeEvent(e);
}
void OwncloudWizard::hideEvent(QHideEvent *event)
{
QWizard::hideEvent(event);
#ifdef Q_OS_MACOS
// Closing the window on macOS hides it rather than closes it, so emit a wizardClosed here
emit wizardClosed();
#endif
}
void OwncloudWizard::closeEvent(QCloseEvent *event)
{
emit wizardClosed();
QWizard::closeEvent(event);
}
void OwncloudWizard::customizeStyle()
{
// HINT: Customize wizard's own style here, if necessary in the future (Dark-/Light-Mode switching)

View File

@ -110,9 +110,12 @@ signals:
void needCertificate();
void styleChanged();
void onActivate();
void wizardClosed();
protected:
void changeEvent(QEvent *) override;
void hideEvent(QHideEvent *) override;
void closeEvent(QCloseEvent *) override;
private:
void customizeStyle();