From 85408961bae3bc98d9f45e40cad2a52f938b5659 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 7 Jun 2017 16:49:38 +0200 Subject: [PATCH] Wizard: Don't let the second to last page go back with OAuth2 We don't want to re-open the browser in that case. --- src/gui/owncloudsetupwizard.cpp | 2 +- src/gui/wizard/owncloudwizard.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp index 2f1d73b10..f124fa265 100644 --- a/src/gui/owncloudsetupwizard.cpp +++ b/src/gui/owncloudsetupwizard.cpp @@ -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)); diff --git a/src/gui/wizard/owncloudwizard.cpp b/src/gui/wizard/owncloudwizard.cpp index eb80a37c0..9fb20ced6 100644 --- a/src/gui/wizard/owncloudwizard.cpp +++ b/src/gui/wizard/owncloudwizard.cpp @@ -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) -- 2.30.2