Flow2: Bring account setup wizard to top (raise) on auth result
authorMichael Schuster <michael@schuster.ms>
Fri, 20 Dec 2019 03:01:54 +0000 (04:01 +0100)
committerMichael Schuster <48932272+misch7@users.noreply.github.com>
Tue, 24 Dec 2019 06:46:57 +0000 (07:46 +0100)
Show and raise the wizard on success / error in the Login Flow v2 auth.

Signed-off-by: Michael Schuster <michael@schuster.ms>
src/gui/owncloudsetupwizard.cpp
src/gui/wizard/flow2authcredspage.cpp
src/gui/wizard/owncloudwizard.cpp
src/gui/wizard/owncloudwizard.h

index ec2512f85a4f067b1446aa374e52975dd6947b82..875dacf556e1159b58bf1f457fbdb1e97e51ff09 100644 (file)
@@ -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();
     }
index 85bcb89dc615f08376aed18ee1771582ea0382e5..4bc85722c7e452fc4c1a6dd98e0c01354cd3f912 100644 (file)
@@ -113,7 +113,11 @@ int Flow2AuthCredsPage::nextId() const
 
 void Flow2AuthCredsPage::setConnected()
 {
-    wizard()->show();
+    OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
+    Q_ASSERT(ocWizard);
+
+    // bring wizard to top
+    ocWizard->bringToTop();
 }
 
 AbstractCredentials *Flow2AuthCredsPage::getCredentials() const
index 19f6d33cfbff53884ce5e0f5a5e113093571f978..8be68668d538bceba233bbedbad391c24d2b27c3 100644 (file)
@@ -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
index 88ca4d731a5b53275887d4573c19d7ddf96ed7ba..5ea2ba349a1ef6567333dca7a17748c89285de1d 100644 (file)
@@ -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;