[Pkg-owncloud-commits] [owncloud-client] 429/470: Add spinner during sharee search (#4764)

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:25:38 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 31c13f74fbc2149fd9e58a5796dc17bb209440fb
Author: Roeland Douma <rullzer at users.noreply.github.com>
Date:   Fri Apr 29 14:11:27 2016 +0200

    Add spinner during sharee search (#4764)
    
    Fixed #4740
    
    When searching for sharees we should display a loading spinner.
---
 src/gui/shareusergroupwidget.cpp |  7 ++++++-
 src/gui/shareusergroupwidget.h   |  2 ++
 src/gui/shareusergroupwidget.ui  | 20 ++++++++++++--------
 3 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/gui/shareusergroupwidget.cpp b/src/gui/shareusergroupwidget.cpp
index 4416067..c7f4988 100644
--- a/src/gui/shareusergroupwidget.cpp
+++ b/src/gui/shareusergroupwidget.cpp
@@ -99,6 +99,9 @@ ShareUserGroupWidget::ShareUserGroupWidget(AccountPtr account,
 
     setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);
     _ui->errorLabel->hide();
+
+    // Setup the sharee search progress indicator
+    _ui->shareeHorizontalLayout->addWidget(&_pi_sharee);
 }
 
 ShareUserGroupWidget::~ShareUserGroupWidget()
@@ -147,6 +150,7 @@ void ShareUserGroupWidget::slotLineEditReturn()
 void ShareUserGroupWidget::searchForSharees()
 {
     _completionTimer.stop();
+    _pi_sharee.startAnimation();
     ShareeModel::ShareeSet blacklist;
 
     // Add the current user to _sharees since we can't share with ourself
@@ -158,7 +162,6 @@ void ShareUserGroupWidget::searchForSharees()
     }
     _ui->errorLabel->hide();
     _completerModel->fetch(_ui->shareeLineEdit->text(), blacklist);
-
 }
 
 void ShareUserGroupWidget::getShares()
@@ -218,6 +221,7 @@ void ShareUserGroupWidget::slotAdjustScrollWidgetSize()
 
 void ShareUserGroupWidget::slotShareesReady()
 {
+    _pi_sharee.stopAnimation();
     if (_completerModel->rowCount() == 0) {
         displayError(0, tr("No results for '%1'").arg(_completerModel->currentSearch()));
         return;
@@ -274,6 +278,7 @@ void ShareUserGroupWidget::slotCompleterHighlighted(const QModelIndex & index)
 
 void ShareUserGroupWidget::displayError(int code, const QString& message)
 {
+    _pi_sharee.stopAnimation();
     qDebug() << "Error from server" << code << message;
     _ui->errorLabel->setText(message);
     _ui->errorLabel->show();
diff --git a/src/gui/shareusergroupwidget.h b/src/gui/shareusergroupwidget.h
index 2d47fcd..c99d22f 100644
--- a/src/gui/shareusergroupwidget.h
+++ b/src/gui/shareusergroupwidget.h
@@ -129,6 +129,8 @@ private:
     bool _isFile;
     bool _disableCompleterActivated; // in order to avoid that we share the contents twice
     ShareManager *_manager;
+
+    QProgressIndicator _pi_sharee;
 };
 
 }
diff --git a/src/gui/shareusergroupwidget.ui b/src/gui/shareusergroupwidget.ui
index 6f9524b..44befbb 100644
--- a/src/gui/shareusergroupwidget.ui
+++ b/src/gui/shareusergroupwidget.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>457</width>
-    <height>188</height>
+    <height>164</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -15,11 +15,15 @@
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
-    <widget class="QLineEdit" name="shareeLineEdit">
-     <property name="placeholderText">
-      <string>Share with users or groups ...</string>
-     </property>
-    </widget>
+    <layout class="QHBoxLayout" name="shareeHorizontalLayout">
+     <item>
+      <widget class="QLineEdit" name="shareeLineEdit">
+       <property name="placeholderText">
+        <string>Share with users or groups ...</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
    <item>
     <widget class="QLabel" name="errorLabel">
@@ -50,8 +54,8 @@
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>441</width>
-        <height>98</height>
+        <width>437</width>
+        <height>94</height>
        </rect>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_3"/>

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