nautilus r13741 - in trunk: . libnautilus-private



Author: alexl
Date: Wed Feb 13 20:39:12 2008
New Revision: 13741
URL: http://svn.gnome.org/viewvc/nautilus?rev=13741&view=rev

Log:
2008-02-13  Alexander Larsson  <alexl redhat com>

        * libnautilus-private/nautilus-progress-info.[ch]:
        * libnautilus-private/nautilus-file-operations.c:
	Add paused status to progress infos and use it
	to avoid poping up the progress dialog while dialogs
	are up. (#512406)
	Patch from Cosimo Cecchi



Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-file-operations.c
   trunk/libnautilus-private/nautilus-progress-info.c
   trunk/libnautilus-private/nautilus-progress-info.h

Modified: trunk/libnautilus-private/nautilus-file-operations.c
==============================================================================
--- trunk/libnautilus-private/nautilus-file-operations.c	(original)
+++ trunk/libnautilus-private/nautilus-file-operations.c	Wed Feb 13 20:39:12 2008
@@ -950,11 +950,12 @@
 	g_ptr_array_add (ptr_array, NULL);
 	data->button_titles = (const char **)g_ptr_array_free (ptr_array, FALSE);
 
+	nautilus_progress_info_pause (job->progress);
 	g_io_scheduler_job_send_to_mainloop (job->io_job,
 					     do_run_simple_dialog,
 					     data,
 					     NULL);
-
+	nautilus_progress_info_resume (job->progress);
 	res = data->result;
 
 	g_free (data->button_titles);

Modified: trunk/libnautilus-private/nautilus-progress-info.c
==============================================================================
--- trunk/libnautilus-private/nautilus-progress-info.c	(original)
+++ trunk/libnautilus-private/nautilus-progress-info.c	Wed Feb 13 20:39:12 2008
@@ -59,6 +59,7 @@
 	gboolean activity_mode;
 	gboolean started;
 	gboolean finished;
+	gboolean paused;
 	
 	GSource *idle_source;
 	gboolean source_is_now;
@@ -423,6 +424,9 @@
 static gboolean
 new_op_started_timeout (NautilusProgressInfo *info)
 {
+	if (nautilus_progress_info_get_is_paused (info)) {
+		return TRUE;
+	}
 	if (!nautilus_progress_info_get_is_finished (info)) {
 		handle_new_progress_info (info);
 	}
@@ -567,6 +571,20 @@
 	return res;
 }
 
+gboolean
+nautilus_progress_info_get_is_paused (NautilusProgressInfo *info)
+{
+	gboolean res;
+	
+	G_LOCK (progress_info);
+	
+	res = info->paused;
+	
+	G_UNLOCK (progress_info);
+	
+	return res;
+}
+
 static gboolean
 idle_callback (gpointer data)
 {
@@ -667,6 +685,30 @@
 }
 
 void
+nautilus_progress_info_pause (NautilusProgressInfo *info)
+{
+	G_LOCK (progress_info);
+
+	if (!info->paused) {
+		info->paused = TRUE;
+	}
+
+	G_UNLOCK (progress_info);
+}
+
+void
+nautilus_progress_info_resume (NautilusProgressInfo *info)
+{
+	G_LOCK (progress_info);
+
+	if (info->paused) {
+		info->paused = FALSE;
+	}
+
+	G_UNLOCK (progress_info);
+}
+
+void
 nautilus_progress_info_start (NautilusProgressInfo *info)
 {
 	G_LOCK (progress_info);

Modified: trunk/libnautilus-private/nautilus-progress-info.h
==============================================================================
--- trunk/libnautilus-private/nautilus-progress-info.h	(original)
+++ trunk/libnautilus-private/nautilus-progress-info.h	Wed Feb 13 20:39:12 2008
@@ -61,9 +61,12 @@
 void          nautilus_progress_info_cancel          (NautilusProgressInfo *info);
 gboolean      nautilus_progress_info_get_is_started  (NautilusProgressInfo *info);
 gboolean      nautilus_progress_info_get_is_finished (NautilusProgressInfo *info);
+gboolean      nautilus_progress_info_get_is_paused   (NautilusProgressInfo *info);
 
 void          nautilus_progress_info_start           (NautilusProgressInfo *info);
 void          nautilus_progress_info_finish          (NautilusProgressInfo *info);
+void          nautilus_progress_info_pause           (NautilusProgressInfo *info);
+void          nautilus_progress_info_resume          (NautilusProgressInfo *info);
 void          nautilus_progress_info_set_status      (NautilusProgressInfo *info,
 						      const char           *status);
 void          nautilus_progress_info_take_status     (NautilusProgressInfo *info,



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