[Pkg-owncloud-commits] [owncloud-client] 313/498: Tray menu: Make sign in/out actions more consistent.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Tue Aug 11 14:49:01 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 65a3847a35ef2343430ecfefa76f5e9915ed32b9
Author: Christian Kamm <kamm at incasoftware.de>
Date: Wed Jul 15 15:05:30 2015 +0200
Tray menu: Make sign in/out actions more consistent.
In particular:
* It's always possible to sign out, even if there's currently a
network problem or the service is unavailable.
* You can only sign in when you explicitly signed out before.
---
src/gui/owncloudgui.cpp | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp
index 7f7b5ad..83f2efd 100644
--- a/src/gui/owncloudgui.cpp
+++ b/src/gui/owncloudgui.cpp
@@ -295,14 +295,14 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
QObject::connect(actionOpenoC, SIGNAL(triggered(bool)), SLOT(slotOpenOwnCloud()));
if (separateMenu) {
- if (accountState->isConnected()) {
- QAction* signout = menu->addAction(tr("Sign out"));
- signout->setProperty(propertyAccountC, QVariant::fromValue(accountState));
- connect(signout, SIGNAL(triggered()), this, SLOT(slotLogout()));
- } else {
+ if (accountState->isSignedOut()) {
QAction* signin = menu->addAction(tr("Sign in..."));
signin->setProperty(propertyAccountC, QVariant::fromValue(accountState));
connect(signin, SIGNAL(triggered()), this, SLOT(slotLogin()));
+ } else {
+ QAction* signout = menu->addAction(tr("Sign out"));
+ signout->setProperty(propertyAccountC, QVariant::fromValue(accountState));
+ connect(signout, SIGNAL(triggered()), this, SLOT(slotLogout()));
}
}
@@ -340,12 +340,16 @@ void ownCloudGui::setupContextMenu()
bool isConfigured = (!accountList.isEmpty());
bool atLeastOneConnected = false;
- bool atLeastOneDisconnected = false;
+ bool atLeastOneSignedOut = false;
+ bool atLeastOneSignedIn = false;
foreach (auto a, accountList) {
if (a->isConnected()) {
atLeastOneConnected = true;
+ }
+ if (a->isSignedOut()){
+ atLeastOneSignedOut = true;
} else {
- atLeastOneDisconnected = true;
+ atLeastOneSignedIn = true;
}
}
@@ -395,7 +399,7 @@ void ownCloudGui::setupContextMenu()
}
_contextMenu->addSeparator();
- if (atLeastOneConnected) {
+ if (atLeastOneSignedIn) {
if (accountList.count() > 1) {
_actionLogout->setText(tr("Sign out everywhere"));
} else {
@@ -403,7 +407,7 @@ void ownCloudGui::setupContextMenu()
}
_contextMenu->addAction(_actionLogout);
}
- if (atLeastOneDisconnected) {
+ if (atLeastOneSignedOut) {
if (accountList.count() > 1) {
_actionLogin->setText(tr("Sign in everywhere..."));
} else {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list