[Nautilus-list] Patch for bug #8133 "Empty Trash description not consistent"



May I commit?

Regards,

	Benedikt
? nautilus-confirm-trash.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.4673
diff -u -r1.4673 ChangeLog
--- ChangeLog	2001/07/05 11:47:34	1.4673
+++ ChangeLog	2001/07/05 13:49:14
@@ -1,5 +1,14 @@
 2001-07-05  Benedikt Roth  <Benedikt Roth gmx net>
 
+	* src/nautilus-sidebar.c: (nautilus_sidebar_initialize),
+	(nautilus_sidebar_destroy), (nautilus_sidebar_theme_changed),
+	(nautilus_sidebar_confirm_trash_changed):
+	Fix bug #8133 where changing of the
+	NAUTILUS_PREFERENCES_CONFIRM_TRASH value led to inconsistent menu
+	descriptions by adding a eel_preferences callback.
+
+2001-07-05  Benedikt Roth  <Benedikt Roth gmx net>
+
 	* src/file-manager/fm-directory-view.c:
 	(fm_directory_view_display_selection_info):
 	Made the statusbar messages when selecting several folders clearer
Index: src/nautilus-sidebar.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-sidebar.c,v
retrieving revision 1.183
diff -u -r1.183 nautilus-sidebar.c
--- src/nautilus-sidebar.c	2001/05/16 06:27:55	1.183
+++ src/nautilus-sidebar.c	2001/07/05 13:49:18
@@ -94,35 +94,36 @@
 /* button assignments */
 #define CONTEXTUAL_MENU_BUTTON 3
 
-static void     nautilus_sidebar_initialize_class    (GtkObjectClass   *object_klass);
-static void     nautilus_sidebar_initialize          (GtkObject        *object);
-static void     nautilus_sidebar_deactivate_panel    (NautilusSidebar  *sidebar);
-static gboolean nautilus_sidebar_press_event         (GtkWidget        *widget,
-						      GdkEventButton   *event);
-static gboolean nautilus_sidebar_release_event       (GtkWidget        *widget,
-						      GdkEventButton   *event);
-static gboolean nautilus_sidebar_leave_event         (GtkWidget        *widget,
-						      GdkEventCrossing *event);
-static gboolean nautilus_sidebar_motion_event        (GtkWidget        *widget,
-						      GdkEventMotion   *event);
-static void     nautilus_sidebar_destroy             (GtkObject        *object);
-static void     nautilus_sidebar_drag_data_received  (GtkWidget        *widget,
-						      GdkDragContext   *context,
-						      int               x,
-						      int               y,
-						      GtkSelectionData *selection_data,
-						      guint             info,
-						      guint             time);
-static void     nautilus_sidebar_read_theme          (NautilusSidebar  *sidebar);
-static void     nautilus_sidebar_size_allocate       (GtkWidget        *widget,
-						      GtkAllocation    *allocation);
-static void     nautilus_sidebar_realize             (GtkWidget        *widget);
-static void     nautilus_sidebar_theme_changed       (gpointer          user_data);
-static void     nautilus_sidebar_update_appearance   (NautilusSidebar  *sidebar);
-static void     nautilus_sidebar_update_buttons      (NautilusSidebar  *sidebar);
-static void     add_command_buttons                  (NautilusSidebar  *sidebar,
-						      GList            *application_list);
-static void     background_metadata_changed_callback (NautilusSidebar  *sidebar);
+static void     nautilus_sidebar_initialize_class      (GtkObjectClass   *object_klass);
+static void     nautilus_sidebar_initialize            (GtkObject        *object);
+static void     nautilus_sidebar_deactivate_panel      (NautilusSidebar  *sidebar);
+static gboolean nautilus_sidebar_press_event           (GtkWidget        *widget,
+							GdkEventButton   *event);
+static gboolean nautilus_sidebar_release_event         (GtkWidget        *widget,
+						        GdkEventButton   *event);
+static gboolean nautilus_sidebar_leave_event           (GtkWidget        *widget,
+							GdkEventCrossing *event);
+static gboolean nautilus_sidebar_motion_event          (GtkWidget        *widget,
+							GdkEventMotion   *event);
+static void     nautilus_sidebar_destroy               (GtkObject        *object);
+static void     nautilus_sidebar_drag_data_received    (GtkWidget        *widget,
+							GdkDragContext   *context,
+							int               x,
+							int               y,
+							GtkSelectionData *selection_data,
+							guint             info,
+							guint             time);
+static void     nautilus_sidebar_read_theme            (NautilusSidebar  *sidebar);
+static void     nautilus_sidebar_size_allocate         (GtkWidget        *widget,
+							GtkAllocation    *allocation);
+static void     nautilus_sidebar_realize               (GtkWidget        *widget);
+static void     nautilus_sidebar_theme_changed         (gpointer          user_data);
+static void     nautilus_sidebar_confirm_trash_changed (gpointer          user_data);
+static void     nautilus_sidebar_update_appearance     (NautilusSidebar  *sidebar);
+static void     nautilus_sidebar_update_buttons        (NautilusSidebar  *sidebar);
+static void     add_command_buttons                    (NautilusSidebar  *sidebar,
+							GList            *application_list);
+static void     background_metadata_changed_callback   (NautilusSidebar  *sidebar);
 
 #define DEFAULT_TAB_COLOR "rgb:9999/9999/9999"
 
@@ -284,8 +285,11 @@
 	make_button_box (sidebar);
 
 	/* add a callback for when the theme changes */
-	eel_preferences_add_callback (NAUTILUS_PREFERENCES_THEME, nautilus_sidebar_theme_changed, sidebar);	
+	eel_preferences_add_callback (NAUTILUS_PREFERENCES_THEME, nautilus_sidebar_theme_changed, sidebar);
 
+	/* add a callback for when the preference whether to confirm trashing/deleting file changes */
+	eel_preferences_add_callback (NAUTILUS_PREFERENCES_CONFIRM_TRASH, nautilus_sidebar_confirm_trash_changed, sidebar);
+
 	/* prepare ourselves to receive dropped objects */
 	gtk_drag_dest_set (GTK_WIDGET (sidebar),
 			   GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, 
@@ -319,6 +323,10 @@
 					      nautilus_sidebar_theme_changed,
 					      sidebar);
 
+	eel_preferences_remove_callback (NAUTILUS_PREFERENCES_CONFIRM_TRASH,
+					      nautilus_sidebar_confirm_trash_changed,
+					      sidebar);
+
 
 	EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
 }
@@ -614,6 +622,17 @@
 	nautilus_sidebar_read_theme (sidebar);
 	nautilus_sidebar_update_appearance (sidebar);
 	gtk_widget_queue_draw (GTK_WIDGET (sidebar)) ;	
+}
+
+/* handler for handling confirming trash preferences changes */
+
+static void
+nautilus_sidebar_confirm_trash_changed (gpointer user_data)
+{
+	NautilusSidebar *sidebar;
+	
+	sidebar = NAUTILUS_SIDEBAR (user_data);
+	nautilus_sidebar_update_buttons (sidebar);
 }
 
 /* hit testing */


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