[Pkg-owncloud-commits] [owncloud-client] 270/470: ProtocolWidget: Show number of non synced files in tab label.

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:25:12 UTC 2016


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 5b409215870eec72d3af881332dd1030b32c2580
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Tue Apr 5 13:57:38 2016 +0200

    ProtocolWidget: Show number of non synced files in tab label.
---
 src/gui/activitywidget.cpp | 14 +++++++++++++-
 src/gui/activitywidget.h   |  2 ++
 src/gui/protocolwidget.cpp |  1 +
 src/gui/protocolwidget.h   |  1 +
 4 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp
index ce3924e..8b74f84 100644
--- a/src/gui/activitywidget.cpp
+++ b/src/gui/activitywidget.cpp
@@ -501,6 +501,8 @@ ActivitySettings::ActivitySettings(QWidget *parent)
     _protocolWidget = new ProtocolWidget(this);
     _tab->insertTab(1, _protocolWidget, Theme::instance()->syncStateIcon(SyncResult::Success), tr("Sync Protocol"));
     connect(_protocolWidget, SIGNAL(copyToClipboard()), this, SLOT(slotCopyToClipboard()));
+    connect(_protocolWidget, SIGNAL(issueItemCountUpdated(int)),
+            this, SLOT(slotShowIssueItemCount(int)));
 
     // Add the not-synced list into the tab
     QWidget *w = new QWidget;
@@ -515,7 +517,8 @@ ActivitySettings::ActivitySettings(QWidget *parent)
     connect(_copyBtn, SIGNAL(clicked()), this, SLOT(slotCopyToClipboard()));
 
     w->setLayout(vbox2);
-    _tab->insertTab(2, w, Theme::instance()->syncStateIcon(SyncResult::Problem), tr("Not Synced"));
+    _syncIssueTabId = _tab->insertTab(2, w, Theme::instance()->syncStateIcon(SyncResult::Problem), QString());
+    slotShowIssueItemCount(0); // to display the label.
 
     // Add a progress indicator to spin if the acitivity list is updated.
     _progressIndicator = new QProgressIndicator(this);
@@ -549,6 +552,15 @@ void ActivitySettings::setActivityTabHidden(bool hidden)
     }
 }
 
+void ActivitySettings::slotShowIssueItemCount(int cnt)
+{
+    QString cntText = tr("Not Synced");
+    if( cnt ) {
+        cntText = tr("Not Synced - %n file(s)", "", cnt);
+    }
+    _tab->tabBar()->setTabText(_syncIssueTabId, cntText);
+}
+
 void ActivitySettings::slotCopyToClipboard()
 {
     QString text;
diff --git a/src/gui/activitywidget.h b/src/gui/activitywidget.h
index d5bed91..be1fc5c 100644
--- a/src/gui/activitywidget.h
+++ b/src/gui/activitywidget.h
@@ -134,6 +134,7 @@ private slots:
     void slotCopyToClipboard();
     void setActivityTabHidden(bool hidden);
     void slotRegularNotificationCheck();
+    void slotShowIssueItemCount(int cnt);
 
 signals:
     void guiLog(const QString&, const QString&);
@@ -143,6 +144,7 @@ private:
 
     QTabWidget *_tab;
     int _activityTabId;
+    int _syncIssueTabId;
 
     ActivityWidget *_activityWidget;
     ProtocolWidget *_protocolWidget;
diff --git a/src/gui/protocolwidget.cpp b/src/gui/protocolwidget.cpp
index 5c687fd..ed781ad 100644
--- a/src/gui/protocolwidget.cpp
+++ b/src/gui/protocolwidget.cpp
@@ -271,6 +271,7 @@ void ProtocolWidget::slotItemCompleted(const QString &folder, const SyncFileItem
     if(line) {
        if( item.hasErrorStatus() ) {
             _issueItemView->insertTopLevelItem(0, line);
+            emit issueItemCountUpdated(_issueItemView->topLevelItemCount());
         } else {
             _ui->_treeWidget->insertTopLevelItem(0, line);
         }
diff --git a/src/gui/protocolwidget.h b/src/gui/protocolwidget.h
index 7f8659c..6f56504 100644
--- a/src/gui/protocolwidget.h
+++ b/src/gui/protocolwidget.h
@@ -60,6 +60,7 @@ protected:
 
 signals:
     void copyToClipboard();
+    void issueItemCountUpdated(int);
 
 private:
     void setSyncResultStatus(const SyncResult& result );

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