[Pkg-owncloud-commits] [owncloud-client] 174/218: AccountSettings: Disable context menu of sync folders when not connected.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 17 14:31:05 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 440687af2184d226f9db4863bf45c33e9deacc9a
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Tue Sep 29 17:00:06 2015 +0200

    AccountSettings: Disable context menu of sync folders when not connected.
    
    This is the second part to fix #3860
---
 src/gui/accountsettings.cpp | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp
index ba416e2..df9a6fd 100644
--- a/src/gui/accountsettings.cpp
+++ b/src/gui/accountsettings.cpp
@@ -157,17 +157,24 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
 
     tv->setCurrentIndex(index);
     bool folderPaused = _model->data( index, FolderStatusDelegate::FolderSyncPaused).toBool();
+    bool folderConnected = _model->data( index, FolderStatusDelegate::FolderAccountConnected ).toBool();
 
     QMenu *menu = new QMenu(tv);
     menu->setAttribute(Qt::WA_DeleteOnClose);
-    connect(menu->addAction(tr("Open folder")), SIGNAL(triggered(bool)),
-            this, SLOT(slotOpenCurrentFolder()));
-    connect(menu->addAction(tr("Choose What to Sync")), SIGNAL(triggered(bool)),
-            this, SLOT(doExpand()));
-    connect(menu->addAction(folderPaused ? tr("Resume sync") : tr("Pause sync")), SIGNAL(triggered(bool)),
-            this, SLOT(slotEnableCurrentFolder()));
-    connect(menu->addAction(tr("Remove sync")), SIGNAL(triggered(bool)),
-            this, SLOT(slotRemoveCurrentFolder()));
+
+    QAction *ac = menu->addAction(tr("Open folder"));
+    connect(ac, SIGNAL(triggered(bool)), this, SLOT(slotOpenCurrentFolder()));
+
+    ac = menu->addAction(tr("Choose What to Sync"));
+    ac->setEnabled(folderConnected);
+    connect(ac, SIGNAL(triggered(bool)), this, SLOT(doExpand()));
+
+    ac = menu->addAction(folderPaused ? tr("Resume sync") : tr("Pause sync"));
+    ac->setEnabled(folderConnected);
+    connect(ac, SIGNAL(triggered(bool)), this, SLOT(slotEnableCurrentFolder()));
+
+    ac = menu->addAction(tr("Remove sync"));
+    connect(ac, SIGNAL(triggered(bool)), this, SLOT(slotRemoveCurrentFolder()));
     menu->exec(tv->mapToGlobal(pos));
 }
 

-- 
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