From 3a160a4dce5f0698023043585763c70aefd9b35e Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Fri, 20 Dec 2019 04:01:54 +0100 Subject: [PATCH] Flow2: Bring account setup wizard to top (raise) on auth result Show and raise the wizard on success / error in the Login Flow v2 auth. Signed-off-by: Michael Schuster --- src/gui/owncloudsetupwizard.cpp | 3 ++- src/gui/wizard/flow2authcredspage.cpp | 6 +++++- src/gui/wizard/owncloudwizard.cpp | 7 +++++++ src/gui/wizard/owncloudwizard.h | 2 ++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp index ec2512f85..875dacf55 100644 --- a/src/gui/owncloudsetupwizard.cpp +++ b/src/gui/owncloudsetupwizard.cpp @@ -407,7 +407,8 @@ void OwncloudSetupWizard::slotAuthError() errorMsg = tr("There was an invalid response to an authenticated webdav request"); } - _ocWizard->show(); + // bring wizard to top + _ocWizard->bringToTop(); if (_ocWizard->currentId() == WizardCommon::Page_ShibbolethCreds || _ocWizard->currentId() == WizardCommon::Page_OAuthCreds || _ocWizard->currentId() == WizardCommon::Page_Flow2AuthCreds) { _ocWizard->back(); } diff --git a/src/gui/wizard/flow2authcredspage.cpp b/src/gui/wizard/flow2authcredspage.cpp index 85bcb89dc..4bc85722c 100644 --- a/src/gui/wizard/flow2authcredspage.cpp +++ b/src/gui/wizard/flow2authcredspage.cpp @@ -113,7 +113,11 @@ int Flow2AuthCredsPage::nextId() const void Flow2AuthCredsPage::setConnected() { - wizard()->show(); + OwncloudWizard *ocWizard = qobject_cast(wizard()); + Q_ASSERT(ocWizard); + + // bring wizard to top + ocWizard->bringToTop(); } AbstractCredentials *Flow2AuthCredsPage::getCredentials() const diff --git a/src/gui/wizard/owncloudwizard.cpp b/src/gui/wizard/owncloudwizard.cpp index 19f6d33cf..8be68668d 100644 --- a/src/gui/wizard/owncloudwizard.cpp +++ b/src/gui/wizard/owncloudwizard.cpp @@ -307,4 +307,11 @@ void OwncloudWizard::customizeStyle() // HINT: Customize wizard's own style here, if necessary in the future (Dark-/Light-Mode switching) } +void OwncloudWizard::bringToTop() +{ + // bring wizard to top + show(); + raise(); +} + } // end namespace diff --git a/src/gui/wizard/owncloudwizard.h b/src/gui/wizard/owncloudwizard.h index 88ca4d731..5ea2ba349 100644 --- a/src/gui/wizard/owncloudwizard.h +++ b/src/gui/wizard/owncloudwizard.h @@ -74,6 +74,8 @@ public: void displayError(const QString &, bool retryHTTPonly); AbstractCredentials *getCredentials() const; + void bringToTop(); + // FIXME: Can those be local variables? // Set from the OwncloudSetupPage, later used from OwncloudHttpCredsPage QSslKey _clientSslKey; -- 2.30.2