From 74f48722118673194e1a750e0b34bb2e6d3b01e2 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 6 Jan 2005 20:27:58 +0000 Subject: [PATCH] Add an "Open _Location" item. Fixes #148839. 2005-01-06 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (file_list_build_popup_menu): Add an "Open _Location" item. Fixes #148839. --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtkfilechooserdefault.c | 16 ++++++++++++++++ 5 files changed, 36 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8207a69a62..56cb842d7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-01-06 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (file_list_build_popup_menu): Add an + "Open _Location" item. Fixes #148839. + 2005-01-06 Matthias Clasen * README.in: Fix a typo. (#163128, kentaro fukuchi) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8207a69a62..56cb842d7d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-01-06 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (file_list_build_popup_menu): Add an + "Open _Location" item. Fixes #148839. + 2005-01-06 Matthias Clasen * README.in: Fix a typo. (#163128, kentaro fukuchi) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8207a69a62..56cb842d7d 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2005-01-06 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (file_list_build_popup_menu): Add an + "Open _Location" item. Fixes #148839. + 2005-01-06 Matthias Clasen * README.in: Fix a typo. (#163128, kentaro fukuchi) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8207a69a62..56cb842d7d 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2005-01-06 Federico Mena Quintero + + * gtk/gtkfilechooserdefault.c (file_list_build_popup_menu): Add an + "Open _Location" item. Fixes #148839. + 2005-01-06 Matthias Clasen * README.in: Fix a typo. (#163128, kentaro fukuchi) diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index e4955e779f..c161455426 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -2962,6 +2962,14 @@ add_to_shortcuts_cb (GtkMenuItem *item, bookmarks_add_selected_folder (impl); } +/* Callback used when the "Open Location" menu item is activated */ +static void +open_location_cb (GtkMenuItem *item, + GtkFileChooserDefault *impl) +{ + location_popup_handler (impl, ""); +} + /* Callback used when the "Show Hidden Files" menu item is toggled */ static void show_hidden_toggled_cb (GtkCheckMenuItem *item, @@ -2996,6 +3004,14 @@ file_list_build_popup_menu (GtkFileChooserDefault *impl) gtk_widget_show (item); gtk_menu_shell_append (GTK_MENU_SHELL (impl->browse_files_popup_menu), item); + item = gtk_image_menu_item_new_with_mnemonic (_("Open _Location")); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), + gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU)); + g_signal_connect (item, "activate", + G_CALLBACK (open_location_cb), impl); + gtk_widget_show (item); + gtk_menu_shell_append (GTK_MENU_SHELL (impl->browse_files_popup_menu), item); + item = gtk_separator_menu_item_new (); gtk_widget_show (item); gtk_menu_shell_append (GTK_MENU_SHELL (impl->browse_files_popup_menu), item);