[Pkg-owncloud-commits] [owncloud-client] 294/484: ActivityView: Add a progress indicator widget to indicate action.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:55 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 5e98894a972654bdd7bd38bbe499ac02152fa442
Author: Klaas Freitag <freitag at owncloud.com>
Date: Tue Nov 10 18:10:58 2015 +0100
ActivityView: Add a progress indicator widget to indicate action.
---
src/gui/activitywidget.cpp | 22 +++++++++++++++++-----
src/gui/activitywidget.h | 3 +++
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp
index 8ad1fd3..97c1a61 100644
--- a/src/gui/activitywidget.cpp
+++ b/src/gui/activitywidget.cpp
@@ -32,6 +32,7 @@
#include "accountmanager.h"
#include "activityitemdelegate.h"
#include "protocolwidget.h"
+#include "QProgressIndicator.h"
#include "ui_activitywidget.h"
@@ -270,6 +271,8 @@ ActivityWidget::ActivityWidget(QWidget *parent) :
_copyBtn = _ui->_dialogButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
_copyBtn->setToolTip( tr("Copy the activity list to the clipboard."));
connect(_copyBtn, SIGNAL(clicked()), SIGNAL(copyToClipboard()));
+
+ connect(_model, SIGNAL(rowsInserted(QModelIndex,int,int)), SIGNAL(rowsInserted()));
}
ActivityWidget::~ActivityWidget()
@@ -351,24 +354,32 @@ ActivitySettings::ActivitySettings(QWidget *parent)
_tab->addTab(_activityWidget, Theme::instance()->applicationIcon(), tr("Server Activity"));
connect(_activityWidget, SIGNAL(copyToClipboard()), this, SLOT(slotCopyToClipboard()));
+
_protocolWidget = new ProtocolWidget(this);
_tab->addTab(_protocolWidget, Theme::instance()->syncStateIcon(SyncResult::Success), tr("Sync Protocol"));
connect(_protocolWidget, SIGNAL(copyToClipboard()), this, SLOT(slotCopyToClipboard()));
// Add the not-synced list into the tab
QWidget *w = new QWidget;
- QVBoxLayout *vbox = new QVBoxLayout(this);
- vbox->addWidget(new QLabel(tr("List of ignored or errornous files"), this));
- vbox->addWidget(_protocolWidget->issueWidget());
+ QVBoxLayout *vbox2 = new QVBoxLayout(this);
+ vbox2->addWidget(new QLabel(tr("List of ignored or errornous files"), this));
+ vbox2->addWidget(_protocolWidget->issueWidget());
QDialogButtonBox *dlgButtonBox = new QDialogButtonBox(this);
- vbox->addWidget(dlgButtonBox);
+ vbox2->addWidget(dlgButtonBox);
QPushButton *_copyBtn = dlgButtonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
_copyBtn->setToolTip( tr("Copy the activity list to the clipboard."));
_copyBtn->setEnabled(true);
connect(_copyBtn, SIGNAL(clicked()), this, SLOT(slotCopyToClipboard()));
- w->setLayout(vbox);
+ w->setLayout(vbox2);
_tab->addTab(w, Theme::instance()->syncStateIcon(SyncResult::Problem), tr("Not Synced"));
+
+ // Add a progress indicator to spin if the acitivity list is updated.
+ _progressIndicator = new QProgressIndicator(this);
+ _tab->setCornerWidget(_progressIndicator);
+
+ // connect a model signal to stop the animation.
+ connect(_activityWidget, SIGNAL(rowsInserted()), _progressIndicator, SLOT(stopAnimation()));
}
void ActivitySettings::slotCopyToClipboard()
@@ -399,6 +410,7 @@ void ActivitySettings::slotCopyToClipboard()
void ActivitySettings::slotRefresh( AccountState* ptr )
{
+ _progressIndicator->startAnimation();
_activityWidget->slotRefresh(ptr);
}
diff --git a/src/gui/activitywidget.h b/src/gui/activitywidget.h
index 64b3d06..a27fbb1 100644
--- a/src/gui/activitywidget.h
+++ b/src/gui/activitywidget.h
@@ -26,6 +26,7 @@
#include "ui_activitywidget.h"
class QPushButton;
+class QProgressIndicator;
namespace OCC {
@@ -129,6 +130,7 @@ public slots:
signals:
void guiLog(const QString&, const QString&);
void copyToClipboard();
+ void rowsInserted();
private:
QString timeString(QDateTime dt, QLocale::FormatType format) const;
@@ -158,6 +160,7 @@ private:
QTabWidget *_tab;
ActivityWidget *_activityWidget;
ProtocolWidget *_protocolWidget;
+ QProgressIndicator *_progressIndicator;
};
--
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