fix place menu items

This commit is contained in:
Matthias Clasen 2009-08-03 23:20:23 +00:00
parent dfb527bf89
commit d3587a57af
4 changed files with 226 additions and 1 deletions

View File

@ -0,0 +1,47 @@
diff -up nautilus-2.27.4/src/nautilus-spatial-window.c.menu-icons3 nautilus-2.27.4/src/nautilus-spatial-window.c
--- nautilus-2.27.4/src/nautilus-spatial-window.c.menu-icons3 2009-08-03 18:59:28.015377172 -0400
+++ nautilus-2.27.4/src/nautilus-spatial-window.c 2009-08-03 19:08:19.623627208 -0400
@@ -683,6 +683,7 @@ location_button_clicked_callback (GtkWid
name = nautilus_file_get_display_name (file);
menu_item = gtk_image_menu_item_new_with_label (name);
+ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menu_item), TRUE);
g_free (name);
if (first_item == NULL) {
@@ -941,6 +942,14 @@ static const GtkActionEntry spatial_entr
G_CALLBACK (action_search_callback) },
};
+static const char* icon_entries[] = {
+ "/MenuBar/Other Menus/Places/Home",
+ "/MenuBar/Other Menus/Places/Go to Computer",
+ "/MenuBar/Other Menus/Places/Go to Templates",
+ "/MenuBar/Other Menus/Places/Go to Trash",
+ "/MenuBar/Other Menus/Places/Go to Network"
+};
+
static void
nautilus_spatial_window_init (NautilusSpatialWindow *window)
{
@@ -951,6 +960,8 @@ nautilus_spatial_window_init (NautilusSp
GtkUIManager *ui_manager;
GtkTargetList *targets;
const char *ui;
+ int i;
+ GtkWidget *menuitem;
window->details = G_TYPE_INSTANCE_GET_PRIVATE (window,
NAUTILUS_TYPE_SPATIAL_WINDOW,
@@ -1042,6 +1053,11 @@ nautilus_spatial_window_init (NautilusSp
ui = nautilus_ui_string_get ("nautilus-spatial-window-ui.xml");
gtk_ui_manager_add_ui_from_string (ui_manager, ui, -1, NULL);
+
+ for (i = 0; i < G_N_ELEMENTS (icon_entries); i++) {
+ menuitem = gtk_ui_manager_get_widget (ui_manager, icon_entries[i]);
+ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+ }
}
static void

View File

@ -15,7 +15,7 @@
Name: nautilus Name: nautilus
Summary: File manager for GNOME Summary: File manager for GNOME
Version: 2.27.4 Version: 2.27.4
Release: 3%{?dist} Release: 4%{?dist}
License: GPLv2+ License: GPLv2+
Group: User Interface/Desktops Group: User Interface/Desktops
Source: http://download.gnome.org/sources/%{name}/2.27/%{name}-%{version}.tar.bz2 Source: http://download.gnome.org/sources/%{name}/2.27/%{name}-%{version}.tar.bz2
@ -85,6 +85,10 @@ Patch10: nautilus-gvfs-desktop-key-2.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=519743 # http://bugzilla.gnome.org/show_bug.cgi?id=519743
Patch17: nautilus-filetype-symlink-fix.patch Patch17: nautilus-filetype-symlink-fix.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=590647
Patch18: nautilus_always_open_appicon.patch
Patch19: nautilus_menu_icons_only2.patch
Patch20: nautilus-menu-icons3.patch
%description %description
Nautilus is the file manager and graphical shell for the GNOME desktop Nautilus is the file manager and graphical shell for the GNOME desktop
@ -122,6 +126,9 @@ for developing nautilus extensions.
# %patch8 -p1 -b .hide-white-screen # %patch8 -p1 -b .hide-white-screen
%patch10 -p1 -b .gvfs-desktop-key %patch10 -p1 -b .gvfs-desktop-key
%patch17 -p0 -b .symlink %patch17 -p0 -b .symlink
%patch18 -p1 -b .always-open-appicon
%patch19 -p1 -b .go-icons
%patch20 -p1 -b .spatial-icons
%build %build
@ -261,6 +268,9 @@ fi
%changelog %changelog
* Mon Aug 3 2009 Matthias Clasen <mclasen@redhat.com> - 2.27.4-4
- Show icons for bookmarks and similar in menus
* Sun Aug 2 2009 Matthias Clasen <mclasen@redhat.com> - 2.27.4-3 * Sun Aug 2 2009 Matthias Clasen <mclasen@redhat.com> - 2.27.4-3
- Drop desktop-backgrounds-basic dep that we've carried for 9 years - Drop desktop-backgrounds-basic dep that we've carried for 9 years
without ever making use of it without ever making use of it

View File

@ -0,0 +1,90 @@
--- nautilus-2.27.4.orig/src/file-manager/fm-directory-view.c 2009-07-13 21:47:03.000000000 +0200
+++ nautilus-2.27.4/src/file-manager/fm-directory-view.c 2009-08-01 17:01:19.000000000 +0200
@@ -105,12 +105,14 @@
#define FM_DIRECTORY_VIEW_MENU_PATH_SCRIPTS_PLACEHOLDER "/MenuBar/File/Open Placeholder/Scripts/Scripts Placeholder"
#define FM_DIRECTORY_VIEW_MENU_PATH_EXTENSION_ACTIONS_PLACEHOLDER "/MenuBar/Edit/Extension Actions"
#define FM_DIRECTORY_VIEW_MENU_PATH_NEW_DOCUMENTS_PLACEHOLDER "/MenuBar/File/New Items Placeholder/New Documents/New Documents Placeholder"
+#define FM_DIRECTORY_VIEW_MENU_PATH_OPEN "/MenuBar/File/Open Placeholder/Open"
#define FM_DIRECTORY_VIEW_POPUP_PATH_SELECTION "/selection"
#define FM_DIRECTORY_VIEW_POPUP_PATH_APPLICATIONS_SUBMENU_PLACEHOLDER "/selection/Open Placeholder/Open With/Applications Placeholder"
#define FM_DIRECTORY_VIEW_POPUP_PATH_APPLICATIONS_PLACEHOLDER "/selection/Open Placeholder/Applications Placeholder"
#define FM_DIRECTORY_VIEW_POPUP_PATH_SCRIPTS_PLACEHOLDER "/selection/Open Placeholder/Scripts/Scripts Placeholder"
#define FM_DIRECTORY_VIEW_POPUP_PATH_EXTENSION_ACTIONS "/selection/Extension Actions"
+#define FM_DIRECTORY_VIEW_POPUP_PATH_OPEN "/selection/Open Placeholder/Open"
#define FM_DIRECTORY_VIEW_POPUP_PATH_BACKGROUND "/background"
#define FM_DIRECTORY_VIEW_POPUP_PATH_BACKGROUND_SCRIPTS_PLACEHOLDER "/background/Before Zoom Items/New Object Items/Scripts/Scripts Placeholder"
@@ -4258,8 +4260,10 @@
char *label;
char *action_name;
char *escaped_app;
+ char *path;
GtkAction *action;
GIcon *app_icon;
+ GtkWidget *menuitem;
launch_parameters = application_launch_parameters_new
(application, files, view);
@@ -4307,6 +4311,16 @@
GTK_UI_MANAGER_MENUITEM,
FALSE);
+ path = g_strdup_printf("%s/%s", menu_placeholder, action_name);
+
+ menuitem = gtk_ui_manager_get_widget (
+ nautilus_window_info_get_ui_manager (view->details->window),
+ path);
+
+ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+
+ g_free (path);
+
gtk_ui_manager_add_ui (nautilus_window_info_get_ui_manager (view->details->window),
view->details->open_with_merge_id,
popup_placeholder,
@@ -4315,6 +4329,15 @@
GTK_UI_MANAGER_MENUITEM,
FALSE);
+ path = g_strdup_printf("%s/%s", popup_placeholder, action_name);
+
+ menuitem = gtk_ui_manager_get_widget (
+ nautilus_window_info_get_ui_manager (view->details->window),
+ path);
+
+ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+
+ g_free (path);
g_free (action_name);
g_free (label);
g_free (tip);
@@ -8339,6 +8362,7 @@
GtkAction *action;
GAppInfo *app;
GIcon *app_icon;
+ GtkWidget *menuitem;
selection = fm_directory_view_get_selection (view);
selection_count = g_list_length (selection);
@@ -8416,6 +8440,20 @@
label_with_underscore ? label_with_underscore : _("_Open"),
NULL);
+ menuitem = gtk_ui_manager_get_widget (
+ nautilus_window_info_get_ui_manager (view->details->window),
+ FM_DIRECTORY_VIEW_MENU_PATH_OPEN);
+
+ /* Only force displaying the icon if it is an application icon */
+ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), app_icon != NULL);
+
+ menuitem = gtk_ui_manager_get_widget (
+ nautilus_window_info_get_ui_manager (view->details->window),
+ FM_DIRECTORY_VIEW_POPUP_PATH_OPEN);
+
+ /* Only force displaying the icon if it is an application icon */
+ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), app_icon != NULL);
+
if (app_icon == NULL) {
app_icon = g_themed_icon_new (GTK_STOCK_OPEN);
}

View File

@ -0,0 +1,78 @@
Common subdirectories: nautilus-2.27.4.orig/src/file-manager and nautilus-2.27.4/src/file-manager
diff -u nautilus-2.27.4.orig/src/nautilus-navigation-window-menus.c nautilus-2.27.4/src/nautilus-navigation-window-menus.c
--- nautilus-2.27.4.orig/src/nautilus-navigation-window-menus.c 2009-06-24 16:00:12.000000000 +0200
+++ nautilus-2.27.4/src/nautilus-navigation-window-menus.c 2009-08-03 23:58:55.000000000 +0200
@@ -339,6 +339,15 @@
gtk_label_set_max_width_chars (label, MENU_ITEM_MAX_WIDTH_CHARS);
}
+static const char* icon_entries[] = {
+ "/MenuBar/Other Menus/Go/Home",
+ "/MenuBar/Other Menus/Go/Computer",
+ "/MenuBar/Other Menus/Go/Go to Templates",
+ "/MenuBar/Other Menus/Go/Go to Trash",
+ "/MenuBar/Other Menus/Go/Go to Network",
+ "/MenuBar/Other Menus/Go/Go to Location"
+};
+
/**
* refresh_go_menu:
*
@@ -350,7 +359,10 @@
{
GtkUIManager *ui_manager;
GList *node;
+ GtkWidget *menuitem;
int index;
+ const char *ui;
+ int i;
g_assert (NAUTILUS_IS_NAVIGATION_WINDOW (window));
@@ -371,6 +383,15 @@
window->details->go_menu_action_group,
-1);
g_object_unref (window->details->go_menu_action_group);
+
+ for (i = 0; i < G_N_ELEMENTS (icon_entries); i++) {
+ menuitem = gtk_ui_manager_get_widget (
+ ui_manager,
+ icon_entries[i]);
+
+ gtk_image_menu_item_set_always_show_image (
+ GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+ }
/* Add in a new set of history items. */
for (node = nautilus_get_history_list (), index = 0;
diff -u nautilus-2.27.4.orig/src/nautilus-window-menus.c nautilus-2.27.4/src/nautilus-window-menus.c
--- nautilus-2.27.4.orig/src/nautilus-window-menus.c 2009-06-24 16:00:12.000000000 +0200
+++ nautilus-2.27.4/src/nautilus-window-menus.c 2009-08-03 23:54:04.000000000 +0200
@@ -162,8 +162,10 @@
BookmarkHolder *bookmark_holder;
char action_name[128];
char *name;
+ char *path;
GdkPixbuf *pixbuf;
GtkAction *action;
+ GtkWidget *menuitem;
g_assert (NAUTILUS_IS_WINDOW (window));
g_assert (NAUTILUS_IS_BOOKMARK (bookmark));
@@ -203,7 +205,16 @@
GTK_UI_MANAGER_MENUITEM,
FALSE);
+ path = g_strdup_printf("%s/%s", parent_path, action_name);
+
+ menuitem = gtk_ui_manager_get_widget (
+ window->details->ui_manager,
+ path);
+
+ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+
g_object_unref (pixbuf);
+ g_free (path);
g_free (name);
}