[gnome-documents] selections: Load spinner while creating first collection



commit 331b810ac1e54741257056687408069dea7e9c71
Author: Alessandro Bono <shadow openaliasbox org>
Date:   Mon Aug 31 00:54:06 2015 +0200

    selections: Load spinner while creating first collection
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754338

 data/ui/organize-collection-dialog.ui |    9 +++++++++
 src/selections.js                     |    9 ++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/data/ui/organize-collection-dialog.ui b/data/ui/organize-collection-dialog.ui
index 3999e35..ab1ad31 100644
--- a/data/ui/organize-collection-dialog.ui
+++ b/data/ui/organize-collection-dialog.ui
@@ -88,6 +88,15 @@
           </object>
         </child>
         <child>
+          <object class="GtkSpinner" id="viewSpinner">
+            <property name="visible">True</property>
+            <property name="halign">center</property>
+            <property name="valign">center</property>
+            <property name="width_request">32</property>
+            <property name="height_request">32</property>
+          </object>
+        </child>
+        <child>
           <object class="GtkGrid" id="viewCollections">
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
diff --git a/src/selections.js b/src/selections.js
index ff2abe8..22c1856 100644
--- a/src/selections.js
+++ b/src/selections.js
@@ -598,6 +598,7 @@ const OrganizeCollectionDialog = new Lang.Class({
                         'viewEmpty',
                         'addEntryEmpty',
                         'addButtonEmpty',
+                        'viewSpinner',
                         'viewCollections',
                         'addGridCollections',
                         'addEntryCollections',
@@ -680,8 +681,12 @@ const OrganizeCollectionDialog = new Lang.Class({
                 let job = new SetCollectionForSelectionJob(createdUrn, true);
                 job.run(null);
             }));
-        if (!this._collectionList.isEmpty())
+        if (this._collectionList.isEmpty()) {
+            this._viewSpinner.start();
+            this._content.set_visible_child(this._viewSpinner);
+        } else {
             this._scrolledWindowCollections.get_vadjustment().set_value(0);
+        }
     },
 
     _onTextChanged: function(entry) {
@@ -749,10 +754,12 @@ const OrganizeCollectionDialog = new Lang.Class({
 
     _onCollectionListChanged: function() {
         if (this._collectionList.isEmpty()) {
+            this._viewSpinner.stop();
             this._content.set_visible_child(this._viewEmpty);
             this._addEntryEmpty.grab_focus();
             this._addButtonEmpty.grab_default();
         } else {
+            this._viewSpinner.stop();
             this._content.set_visible_child(this._viewCollections);
             this._addEntryCollections.grab_focus();
             this._addButtonCollections.grab_default();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]