From bcfc16c0f6145ea14b73f463b555f46054712115 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Sat, 29 Aug 2015 13:32:36 +0200 Subject: [PATCH] Add a sign in button in the settings window It's not obvious for users that they should sign in through the tray icon, especially if they were automatically signed out. --- src/gui/accountsettings.cpp | 7 +++++++ src/gui/accountsettings.h | 1 + src/gui/accountsettings.ui | 16 ++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index de8baa3f7..1b39ce7e3 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -120,6 +120,7 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) : connect( &_quotaInfo, SIGNAL(quotaUpdated(qint64,qint64)), this, SLOT(slotUpdateQuota(qint64,qint64))); + connect(ui->signInButton, SIGNAL(clicked()) , this, SLOT(slotSignInAccount())); connect(ui->deleteButton, SIGNAL(clicked()) , this, SLOT(slotDeleteAccount())); } @@ -443,6 +444,7 @@ void AccountSettings::slotAccountStateChanged(int state) serverWithUser = tr("%1 as %2").arg(server, cred->user()); } + ui->signInButton->setVisible(state == AccountState::SignedOut); if (state == AccountState::Connected) { showConnectionLabel( tr("Connected to %1.").arg(serverWithUser) ); } else if (state == AccountState::ServiceUnavailable) { @@ -509,6 +511,11 @@ void AccountSettings::refreshSelectiveSyncStatus() } } +void AccountSettings::slotSignInAccount() +{ + _accountState->setSignedOut(false); +} + void AccountSettings::slotDeleteAccount() { // Deleting the account potentially deletes 'this', so diff --git a/src/gui/accountsettings.h b/src/gui/accountsettings.h index c20c464df..80a85456b 100644 --- a/src/gui/accountsettings.h +++ b/src/gui/accountsettings.h @@ -77,6 +77,7 @@ protected slots: void slotOpenCurrentFolder(); void slotFolderWizardAccepted(); void slotFolderWizardRejected(); + void slotSignInAccount(); void slotDeleteAccount(); void refreshSelectiveSyncStatus(); void slotCustomContextMenuRequested(const QPoint&); diff --git a/src/gui/accountsettings.ui b/src/gui/accountsettings.ui index 43bac5740..94e3e65bd 100644 --- a/src/gui/accountsettings.ui +++ b/src/gui/accountsettings.ui @@ -61,6 +61,22 @@ + + + + + 0 + 0 + + + + Enter your credentials to connect to the server + + + Sign in + + + -- 2.30.2