[PATCH] Add "Properties" to background context menu



The attached patch adds a "Properties" item to the background context
menu. IMHO getting the properties of the currently open folder is one of
the most common tasks that can't be achieved using the current spatial
design ("_File" acts on folder contents only).

-- 
Christian Neumair <chris gnome-de org>
Index: src/file-manager/fm-actions.h
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-actions.h,v
retrieving revision 1.5
diff -u -r1.5 fm-actions.h
--- src/file-manager/fm-actions.h	12 Mar 2005 11:18:32 -0000	1.5
+++ src/file-manager/fm-actions.h	2 May 2005 18:24:34 -0000
@@ -32,6 +32,7 @@
 #define FM_ACTION_NEW_FOLDER "New Folder"
 #define FM_ACTION_PROPERTIES "Properties"
 #define FM_ACTION_PROPERTIES_ACCEL "PropertiesAccel"
+#define FM_ACTION_SELF_PROPERTIES "SelfProperties"
 #define FM_ACTION_NO_TEMPLATES "No Templates"
 #define FM_ACTION_EMPTY_TRASH "Empty Trash"
 #define FM_ACTION_CUT "Cut"
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.668
diff -u -r1.668 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	11 Apr 2005 21:42:03 -0000	1.668
+++ src/file-manager/fm-directory-view.c	2 May 2005 18:24:39 -0000
@@ -1124,6 +1124,23 @@
         nautilus_file_list_free (selection);
 }
 
+static void
+action_self_properties_callback (GtkAction *action,
+				 gpointer   callback_data)
+{
+	FMDirectoryView *view;
+	GList           *files;
+
+	g_assert (FM_IS_DIRECTORY_VIEW (callback_data));
+
+	view = FM_DIRECTORY_VIEW (callback_data);
+	files = g_list_append (NULL, view->details->directory_as_file);
+
+	fm_properties_window_present (files, GTK_WIDGET (view));
+
+	nautilus_file_list_free (files);
+}
+
 static gboolean
 all_files_in_trash (GList *files)
 {
@@ -5744,6 +5761,10 @@
     "PropertiesAccel", "<control>I",                /* label, accelerator */
     NULL,                   /* tooltip */ 
     G_CALLBACK (action_properties_callback) },
+  { "SelfProperties", GTK_STOCK_PROPERTIES,                  /* name, stock id */
+    N_("_Properties"), NULL,                /* label, accelerator */
+    N_("View or modify the properties of the open folder"),                   /* tooltip */ 
+    G_CALLBACK (action_self_properties_callback) },
   { "New Folder", NULL,                  /* name, stock id */
     N_("Create _Folder"), "<control><shift>N",                /* label, accelerator */
     N_("Create a new empty folder inside this folder"),                   /* tooltip */ 
@@ -6332,6 +6353,11 @@
 					      FM_ACTION_PROPERTIES_ACCEL);
 	gtk_action_set_sensitive (action,
 				  selection_count != 0 &&
+				  fm_directory_view_supports_properties (view));
+
+	action = gtk_action_group_get_action (view->details->dir_action_group,
+					      FM_ACTION_SELF_PROPERTIES);
+	gtk_action_set_sensitive (action,
 				  fm_directory_view_supports_properties (view));
 
 	action = gtk_action_group_get_action (view->details->dir_action_group,
Index: src/file-manager/nautilus-directory-view-ui.xml
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/nautilus-directory-view-ui.xml,v
retrieving revision 1.72
diff -u -r1.72 nautilus-directory-view-ui.xml
--- src/file-manager/nautilus-directory-view-ui.xml	23 Jan 2005 19:03:56 -0000	1.72
+++ src/file-manager/nautilus-directory-view-ui.xml	2 May 2005 18:24:39 -0000
@@ -92,6 +92,11 @@
 			<menuitem name="Paste" action="Paste"/>
 		</placeholder>
 	</placeholder>
+	<separator name="Folder Items separator"/>
+	<placeholder name="Folder Items Placeholder">
+		<menuitem name="SelfProperties" action="SelfProperties"/>
+	</placeholder>
+
 </popup>
 <popup name="selection">
 	<placeholder name="Open Placeholder">


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