Skip to content

Commit

Permalink
Merge pull request #7488 from nextcloud/bugfix/close-wizard-properly
Browse files Browse the repository at this point in the history
  • Loading branch information
claucambra authored Nov 15, 2024
2 parents 3078664 + fe7c121 commit 73947c7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/owncloudsetupwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
15 changes: 15 additions & 0 deletions src/gui/wizard/owncloudwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions src/gui/wizard/owncloudwizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,12 @@ public slots:
void needCertificate();
void styleChanged();
void onActivate();
void wizardClosed();

protected:
void changeEvent(QEvent *) override;
void hideEvent(QHideEvent *) override;
void closeEvent(QCloseEvent *) override;

private:
void customizeStyle();
Expand Down

0 comments on commit 73947c7

Please sign in to comment.