[Pkg-owncloud-commits] [owncloud-client] 05/115: ProtocolWidget: Disable copy button if widget is empty.

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Aug 29 22:03:53 UTC 2014


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 1b4c613fa6ebc468e07a34f153d4b46961d971e9
Author: Daniel Molkentin <danimo at owncloud.com>
Date:   Mon Aug 11 16:38:51 2014 +0200

    ProtocolWidget: Disable copy button if widget is empty.
---
 src/mirall/protocolwidget.cpp | 10 +++++++---
 src/mirall/protocolwidget.h   |  1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/mirall/protocolwidget.cpp b/src/mirall/protocolwidget.cpp
index 20926d1..744532a 100644
--- a/src/mirall/protocolwidget.cpp
+++ b/src/mirall/protocolwidget.cpp
@@ -67,9 +67,10 @@ ProtocolWidget::ProtocolWidget(QWidget *parent) :
     _clearBlacklistBtn->setEnabled(false);
     connect(_clearBlacklistBtn, SIGNAL(clicked()), SLOT(slotClearBlacklist()));
 
-    QPushButton *copyBtn = _ui->_dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
-    copyBtn->setToolTip( tr("Copy the activity list to the clipboard."));
-    connect(copyBtn, SIGNAL(clicked()), SLOT(copyToClipboard()));
+    _copyBtn = _ui->_dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
+    _copyBtn->setToolTip( tr("Copy the activity list to the clipboard."));
+    _copyBtn->setEnabled(false);
+    connect(_copyBtn, SIGNAL(clicked()), SLOT(copyToClipboard()));
 
     MirallConfigFile cfg;
     cfg.restoreGeometryHeader(_ui->_treeWidget->header());
@@ -260,6 +261,9 @@ void ProtocolWidget::slotProgressInfo( const QString& folder, const Progress::In
     QTreeWidgetItem *item = createCompletedTreewidgetItem(folder, last);
     if(item) {
         _ui->_treeWidget->insertTopLevelItem(0, item);
+        if (!_copyBtn->isEnabled()) {
+            _copyBtn->setEnabled(true);
+        }
     }
 }
 
diff --git a/src/mirall/protocolwidget.h b/src/mirall/protocolwidget.h
index 88e2ee7..765c6b1 100644
--- a/src/mirall/protocolwidget.h
+++ b/src/mirall/protocolwidget.h
@@ -64,6 +64,7 @@ private:
     const int IgnoredIndicatorRole;
     Ui::ProtocolWidget *_ui;
     QPushButton *_clearBlacklistBtn;
+    QPushButton *_copyBtn;
 };
 
 }

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