Users have complained that they don't see the notification when it is
shown and are not aware that their files aren't syncing.
Remove the non-interactive credentials fetch logic and add make sure
that the shibboleth popup will flash in the taskbar instead.
This will still not allow the popup to show in front in all cases,
but this is a compromise that we have to chose.
This reverts commit
dcb687929f1323e9fea8a9e4bd48cdd3fa8312d9.
Issue https://github.com/owncloud/enterprise/issues/990
, _state(AccountState::Disconnected)
, _connectionStatus(ConnectionValidator::Undefined)
, _waitingForNewCredentials(false)
- , _credentialsFetchMode(Interactive)
{
qRegisterMetaType<AccountState*>("AccountState*");
_connectionStatus = ConnectionValidator::Undefined;
_connectionErrors.clear();
} else if (oldState == SignedOut && _state == Disconnected) {
- checkConnectivity(Interactive);
+ checkConnectivity();
}
}
_timeSinceLastETagCheck.restart();
}
-void AccountState::checkConnectivity(CredentialFetchMode credentialsFetchMode)
+void AccountState::checkConnectivity()
{
if (isSignedOut() || _waitingForNewCredentials) {
return;
return;
}
- _credentialsFetchMode = credentialsFetchMode;
ConnectionValidator * conValidator = new ConnectionValidator(account());
_connectionValidator = conValidator;
connect(conValidator, SIGNAL(connectionResult(ConnectionValidator::Status,QStringList)),
{
if (!credentials->ready()) {
// No exiting credentials found in the keychain
- if (_credentialsFetchMode == Interactive)
- credentials->askFromUser();
- else {
- Logger::instance()->postOptionalGuiLog(tr("Reauthentication required"), tr("You need to re-login to continue using the account %1.").arg(_account->displayName()));
- setState(SignedOut);
- _waitingForNewCredentials = false;
- }
+ credentials->askFromUser();
return;
}
// connection validation, even if it's currently running.
delete _connectionValidator;
- checkConnectivity(_credentialsFetchMode);
+ checkConnectivity();
}
void AccountState::slotCredentialsAsked(AbstractCredentials* credentials)
// connection validation, even if it's currently running.
delete _connectionValidator;
- checkConnectivity(_credentialsFetchMode);
+ checkConnectivity();
}
std::unique_ptr<QSettings> AccountState::settings()
/// An error like invalid credentials where retrying won't help.
ConfigurationError
};
- enum CredentialFetchMode { Interactive, NonInteractive };
/// The actual current connectivity status.
typedef ConnectionValidator::Status ConnectionStatus;
/// Triggers a ping to the server to update state and
/// connection status and errors.
- void checkConnectivity(CredentialFetchMode credentialsFetchMode);
+ void checkConnectivity();
/** Returns a new settings object for this account, already in the right groups. */
std::unique_ptr<QSettings> settings();
ConnectionStatus _connectionStatus;
QStringList _connectionErrors;
bool _waitingForNewCredentials;
- CredentialFetchMode _credentialsFetchMode;
QElapsedTimer _timeSinceLastETagCheck;
QPointer<ConnectionValidator> _connectionValidator;
};
// when the error is permanent.
if (state != AccountState::SignedOut
&& state != AccountState::ConfigurationError) {
- accountState->checkConnectivity(AccountState::NonInteractive);
+ accountState->checkConnectivity();
}
}
#include "account.h"
#include "theme.h"
#include "cookiejar.h"
+#include "owncloudgui.h"
#include "syncengine.h"
#include <keychain.h>
void ShibbolethCredentials::showLoginWindow()
{
if (!_browser.isNull()) {
- _browser->activateWindow();
- _browser->raise();
- // FIXME On OS X this does not raise properly
+ ownCloudGui::raiseDialog(_browser);
return;
}
this, SLOT(onShibbolethCookieReceived(QNetworkCookie)), Qt::QueuedConnection);
connect(_browser, SIGNAL(rejected()), this, SLOT(slotBrowserRejected()));
- _browser->show();
+ ownCloudGui::raiseDialog(_browser);
}
QList<QNetworkCookie> ShibbolethCredentials::accountCookies(Account* account)
return _ready;
}
-void TokenCredentials::fetch(FetchMode)
+void TokenCredentials::fetch()
{
Q_EMIT fetched();
}
QString authType() const Q_DECL_OVERRIDE;
QNetworkAccessManager* getQNAM() const Q_DECL_OVERRIDE;
bool ready() const Q_DECL_OVERRIDE;
- void fetch(FetchMode mode = Interactive) Q_DECL_OVERRIDE;
+ void fetch() Q_DECL_OVERRIDE;
bool stillValid(QNetworkReply *reply) Q_DECL_OVERRIDE;
void persist() Q_DECL_OVERRIDE;
QString user() const Q_DECL_OVERRIDE;