Author: post
Date: 2010-12-30 18:11:54 +0100 (Thu, 30 Dec 2010)
New Revision: 3750

Modified:
   trunk/src/rs-actions.c
   trunk/src/rs-store.c
   trunk/src/rs-store.h
Log:
Add progress dialog and make sure all async operations are finished when 
quitting.

Modified: trunk/src/rs-actions.c
===================================================================
--- trunk/src/rs-actions.c      2010-12-30 17:09:22 UTC (rev 3749)
+++ trunk/src/rs-actions.c      2010-12-30 17:11:54 UTC (rev 3750)
@@ -390,6 +390,24 @@
        if (rs->photo)
                rs_photo_close(rs->photo);
        rs_conf_set_integer(CONF_LAST_PRIORITY_PAGE, 
rs_store_get_current_page(rs->store));
+       rs_io_idle_cancel_class(METADATA_CLASS);
+       rs_io_idle_cancel_class(PRELOAD_CLASS);
+       rs_io_idle_cancel_class(PRELOAD_CLASS);
+       
+       RS_PROGRESS *progress;
+       gint total_items = rs_io_get_jobs_left();
+       if (total_items)
+       {
+               progress = gui_progress_new(_("Waiting for jobs to finish"), 
total_items);
+               gint items = total_items;
+               while (items > 0)
+               {
+                       g_usleep(100*1000);
+                       items = rs_io_get_jobs_left();
+                       gui_progress_set_current(progress, total_items-items);
+                       GUI_CATCHUP();
+               }
+       }
        gtk_main_quit();
 }
 

Modified: trunk/src/rs-store.c
===================================================================
--- trunk/src/rs-store.c        2010-12-30 17:09:22 UTC (rev 3749)
+++ trunk/src/rs-store.c        2010-12-30 17:11:54 UTC (rev 3750)
@@ -109,11 +109,6 @@
        gint open_selected;  /* Contains status message ID, if enabled, 0 
otherwise */
 };
 
-/* Classes to user for io-system */ 
-#define PRELOAD_CLASS (82764283)
-#define METADATA_CLASS (542344)
-#define RESTORE_TAGS_CLASS (4845658)
-
 /* Define the boiler plate stuff using the predefined macro */
 G_DEFINE_TYPE (RSStore, rs_store, GTK_TYPE_HBOX);
 

Modified: trunk/src/rs-store.h
===================================================================
--- trunk/src/rs-store.h        2010-12-30 17:09:22 UTC (rev 3749)
+++ trunk/src/rs-store.h        2010-12-30 17:11:54 UTC (rev 3750)
@@ -54,6 +54,11 @@
 #define RS_IS_STORE_CLASS(obj)    (G_TYPE_CHECK_CLASS_TYPE ((obj), 
RS_STORE_TYPE_WIDGET))
 #define RS_STORE_GET_CLASS        (G_TYPE_INSTANCE_GET_CLASS ((obj), 
RS_STORE_TYPE_WIDGET, RSStoreClass))
 
+/* Classes to user for io-system */ 
+#define PRELOAD_CLASS (82764283)
+#define METADATA_CLASS (542344)
+#define RESTORE_TAGS_CLASS (4845658)
+
 /**
  * Load thumbnails from a directory into the store
  * @param store A RSStore


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to