return;
}
- if ((_lastConnectionValidatorStatus == ConnectionValidator::NeedToSignTermsOfService && status == ConnectionValidator::Connected) ||
- (status == ConnectionValidator::NeedToSignTermsOfService && _lastConnectionValidatorStatus != status)) {
-
- emit termsOfServiceChanged(_account);
- }
-
+ const auto oldConnectionValidatorStatus = _lastConnectionValidatorStatus;
_lastConnectionValidatorStatus = status;
// Come online gradually from 503, captive portal(redirection) or maintenance mode
setState(NeedToSignTermsOfService);
break;
}
+
+ if ((oldConnectionValidatorStatus == ConnectionValidator::NeedToSignTermsOfService && status == ConnectionValidator::Connected) ||
+ (status == ConnectionValidator::NeedToSignTermsOfService && oldConnectionValidatorStatus != status)) {
+
+ emit termsOfServiceChanged(_account, status == ConnectionValidator::NeedToSignTermsOfService ? AccountState::NeedToSignTermsOfService : AccountState::Connected);
+ }
}
void AccountState::slotHandleRemoteWipeCheck()
void hasFetchedNavigationApps();
void statusChanged();
void desktopNotificationsAllowedChanged();
- void termsOfServiceChanged(OCC::AccountPtr account);
+ void termsOfServiceChanged(OCC::AccountPtr account, AccountState::State state);
protected Q_SLOTS:
void slotConnectionValidatorResult(OCC::ConnectionValidator::Status status, const QStringList &errors);
}
}
-void ownCloudGui::slotNeedToAcceptTermsOfService(OCC::AccountPtr account)
-{
- slotShowTrayMessage(
- tr("Terms of service"),
- tr("Your account %1 requires you to accept the terms of service of your server. "
- "You will be redirected to %2 to acknowledge that you have read it and agrees with it.")
- .arg(account->displayName(), account->url().toString()));
- QDesktopServices::openUrl(account->url());
+void ownCloudGui::slotNeedToAcceptTermsOfService(OCC::AccountPtr account,
+ AccountState::State state)
+{
+ if (state == AccountState::NeedToSignTermsOfService) {
+ slotShowTrayMessage(
+ tr("Terms of service"),
+ tr("Your account %1 requires you to accept the terms of service of your server. "
+ "You will be redirected to %2 to acknowledge that you have read it and agrees with it.")
+ .arg(account->displayName(), account->url().toString()));
+ QDesktopServices::openUrl(account->url());
+ }
}
void ownCloudGui::slotComputeOverallSyncStatus()
void slotOpenPath(const QString &path);
void slotAccountStateChanged();
void slotTrayMessageIfServerUnsupported(OCC::Account *account);
- void slotNeedToAcceptTermsOfService(OCC::AccountPtr account);
+ void slotNeedToAcceptTermsOfService(OCC::AccountPtr account,
+ OCC::AccountState::State state);
/**
* Open a share dialog for a file or folder.