Wizard: Don't let the second to last page go back with OAuth2
authorOlivier Goffart <ogoffart@woboq.com>
Wed, 7 Jun 2017 14:49:38 +0000 (16:49 +0200)
committerOlivier Goffart <olivier@woboq.com>
Mon, 12 Jun 2017 10:58:20 +0000 (12:58 +0200)
We don't want to re-open the browser in that case.

src/gui/owncloudsetupwizard.cpp
src/gui/wizard/owncloudwizard.cpp

index 2f1d73b10155451bfb74c46c1e64c9d854d1e579..f124fa265b2e685887a31b1332d0d54e16cabab6 100644 (file)
@@ -346,7 +346,7 @@ void OwncloudSetupWizard::slotAuthError()
     }
 
     _ocWizard->show();
-    if (_ocWizard->currentId() == WizardCommon::Page_ShibbolethCreds) {
+    if (_ocWizard->currentId() == WizardCommon::Page_ShibbolethCreds || _ocWizard->currentId() == WizardCommon::Page_OAuthCreds) {
         _ocWizard->back();
     }
     _ocWizard->displayError(errorMsg, _ocWizard->currentId() == WizardCommon::Page_ServerSetup && checkDowngradeAdvised(reply));
index eb80a37c0bdada90ec1a8afcce980cda7fc677aa..9fb20ced65a87276ed642c8912c7fb99fd1c11b4 100644 (file)
@@ -201,6 +201,11 @@ void OwncloudWizard::slotCurrentPageChanged(int id)
     }
 
     setOption(QWizard::HaveCustomButton1, id == WizardCommon::Page_AdvancedSetup);
+    if (id == WizardCommon::Page_AdvancedSetup && _credentialsPage == _browserCredsPage) {
+        // For OAuth, disable the back button in the Page_AdvancedSetup because we don't want
+        // to re-open the browser.
+        button(QWizard::BackButton)->setEnabled(false);
+    }
 }
 
 void OwncloudWizard::displayError(const QString &msg, bool retryHTTPonly)