Show a 'Loading, please wait...' window when loading object collection
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 29 Jul 2004 15:09:33 +0000 (15:09 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 29 Jul 2004 15:09:33 +0000 (15:09 +0000)
content.

Fixed dialog titles.

src/gkofoto/glade/gkofoto.glade
src/gkofoto/objectcollection.py

index a9d471b..3d2124c 100644 (file)
@@ -2068,7 +2068,7 @@ The categories' children will not be destroyed, nor will the images associated w
 
 <widget class="GtkDialog" id="registrationProgressDialog">
   <property name="visible">True</property>
-  <property name="title" translatable="yes">dialog2</property>
+  <property name="title" translatable="yes">Registering images...</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_NONE</property>
   <property name="modal">False</property>
@@ -2347,7 +2347,7 @@ The categories' children will not be destroyed, nor will the images associated w
 
 <widget class="GtkDialog" id="handleImagesProgressDialog">
   <property name="visible">True</property>
-  <property name="title" translatable="yes">dialog2</property>
+  <property name="title" translatable="yes">Investigating images...</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_NONE</property>
   <property name="modal">False</property>
@@ -2672,4 +2672,62 @@ The categories' children will not be destroyed, nor will the images associated w
   </child>
 </widget>
 
+<widget class="GtkDialog" id="loadingProgressDialog">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Loading...</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox7">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+       <widget class="GtkHButtonBox" id="dialog-action_area7">
+         <property name="visible">True</property>
+         <property name="layout_style">GTK_BUTTONBOX_END</property>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">True</property>
+         <property name="pack_type">GTK_PACK_END</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkLabel" id="label51">
+         <property name="visible">True</property>
+         <property name="label" translatable="yes">Loading, please wait...</property>
+         <property name="use_underline">False</property>
+         <property name="use_markup">False</property>
+         <property name="justify">GTK_JUSTIFY_LEFT</property>
+         <property name="wrap">False</property>
+         <property name="selectable">False</property>
+         <property name="xalign">0.5</property>
+         <property name="yalign">0.5</property>
+         <property name="xpad">0</property>
+         <property name="ypad">0</property>
+       </widget>
+       <packing>
+         <property name="padding">5</property>
+         <property name="expand">False</property>
+         <property name="fill">False</property>
+       </packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
 </glade-interface>
index 4e01fed..2a33d36 100644 (file)
@@ -220,6 +220,13 @@ class ObjectCollection(object):
         env.exit("Object collection loading objects. (albums=" + str(self.__nrOfAlbums) + " images=" + str(self.__nrOfImages) + ")")
 
     def _insertObjectList(self, objectList, location=None):
+        widgets = gtk.glade.XML(env.gladeFile, "loadingProgressDialog")
+        loadingProgressDialog = widgets.get_widget(
+            "loadingProgressDialog")
+        loadingProgressDialog.show()
+        while gtk.events_pending():
+            gtk.main_iteration()
+
         # location = None means insert last, otherwise insert before
         # location.
         #
@@ -247,7 +254,9 @@ class ObjectCollection(object):
             self.__treeModel.set_value(iterator, self.COLUMN_ROW_EDITABLE, True)
             self.__loadThumbnail(self.__treeModel, iterator)
             location += 1
-        self. _handleNrOfObjectsUpdate()
+        self._handleNrOfObjectsUpdate()
+
+        loadingProgressDialog.destroy()
 
     def _handleNrOfObjectsUpdate(self):
         updatedDisabledFields = Set()