Re: permission change dialog wait cursor



patch is attached. Maybe I should get a brain.

Anyone know if it is possible to make evo use a given mail account for
certain target email addresses ? I apologize to the list maintainer who
gets my emails from another account...

On Thu, 2003-09-11 at 14:36, Mathieu Lacage wrote:
> hi all,
> 
> The attached patch adds a wait cursor to the permission change dialog:
> this is very useful if the permission change is done on a big set of
> files.
> 
> Please, note that file permission change has a timing-related bug
which
> is fixed in the gnome-vfs patch I sent to gnome-hackers earlier. (ie:
I
> can send it here if needed). This means that if you try really hard to
> play with file permissions, it will randomly not display the correct
> permission state.
> 
> This patch is against CVS HEAD. It can be applied to the 2.4 release.
> 
> May I commit ?
> 
> Mathieu
-- 
Mathieu Lacage <mathieu gnu org>
? patch
? stamp-h1
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.5925
diff -u -r1.5925 ChangeLog
--- ChangeLog	4 Jan 1997 03:26:39 -0000	1.5925
+++ ChangeLog	4 Jan 1997 05:21:51 -0000
@@ -1,3 +1,9 @@
+2003-09-11 Mathieu Lacage <mathieu gnome org>
+
+	* src/file-manager/fm-properties-window.c: add a wait cursor during
+	permission change. This is most useful when changing the permission
+	a big group of files.
+
 2003-09-11  Bastien Nocera  <hadess hadess net>
 
 	* libnautilus-private/nautilus-volume-monitor.c:
Index: src/file-manager/fm-properties-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-properties-window.c,v
retrieving revision 1.177
diff -u -r1.177 fm-properties-window.c
--- src/file-manager/fm-properties-window.c	2 Aug 2003 20:19:58 -0000	1.177
+++ src/file-manager/fm-properties-window.c	4 Jan 1997 05:21:54 -0000
@@ -123,6 +123,8 @@
 
 	guint total_count;
 	GnomeVFSFileSize total_size;
+
+	guint long_operation_underway;
 };
 
 enum {
@@ -2436,7 +2438,14 @@
 static void
 permission_change_callback (NautilusFile *file, GnomeVFSResult result, gpointer callback_data)
 {
-	g_assert (callback_data == NULL);
+	g_assert (callback_data != NULL);
+
+	FMPropertiesWindow *window = (FMPropertiesWindow *)callback_data;
+	if (window->details->long_operation_underway == 1) {
+		/* finished !! */
+		gdk_window_set_cursor (GTK_WIDGET (window)->window, NULL);
+	}
+	window->details->long_operation_underway--;
 	
 	/* Report the error if it's an error. */
 	fm_report_error_setting_permissions (file, result, NULL);
@@ -2514,6 +2523,14 @@
 					   G_CALLBACK (permission_button_toggled),
 					   window);
 
+	if (window->details->long_operation_underway == 0) {
+		/* start long operation */
+		GdkCursor * cursor = gdk_cursor_new (GDK_WATCH);
+		gdk_window_set_cursor (GTK_WIDGET (window)->window, cursor);
+	}
+	window->details->long_operation_underway += g_list_length (files_on);
+	window->details->long_operation_underway += g_list_length (files_off);
+
 	for (l = files_on; l != NULL; l = l->next) {
 		NautilusFile *file;
 		
@@ -2527,7 +2544,7 @@
 			nautilus_file_set_permissions
 				(file, permissions,
 				 permission_change_callback,
-				 NULL);
+				 window);
 		}
 		
 	}
@@ -2546,7 +2563,7 @@
 			nautilus_file_set_permissions
 				(file, permissions,
 				 permission_change_callback,
-				 NULL);
+				 window);
 		}
 	}	
 


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