Re: PATCH: use timeouts for progress dialogs



On Thu, 2002-08-01 at 02:30, Frank Worsley wrote:
> Anyway, a new patch is attached. Removing the realize handler makes it a
> bit simpler.
> 
> - Frank

@@ -400,7 +436,10 @@ nautilus_file_operations_progress_new_fi
        char *progress_count;
 
        g_return_if_fail (NAUTILUS_IS_FILE_OPERATIONS_PROGRESS
(progress));
-       g_return_if_fail (GTK_WIDGET_REALIZED (progress));
+
+       if (!GTK_WIDGET_REALIZED (progress)) {
+               return;
+       }

Should this be here? 

+void
+nautilus_file_operations_progress_resume_timeout
(NautilusFileOperationsProgress *progress)
+{
+       if (progress->details->delayed_show_timeout_id != 0) {
+               return;
+       }
+       
+       if (progress->details->remaining_time <= 0) {
+               return;
+       }
+       
+       progress->details->delayed_show_timeout_id =
+               g_timeout_add (progress->details->remaining_time,
+                              delayed_show_callback,
+                              progress);
+                              
+       progress->details->remaining_time = 0;                 
 }

Somewhere in here you should probably update start_time, in case a pause
happens twice before the timeout happens (it's not likely, but you
should probably take care of it anyway).

-- 
Dave Camp <dave ximian com>




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