summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserdefault.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-11-28 14:03:20 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-11-28 14:03:20 +0000
commit9228dcee29503f00c13f7379f0410e510c6a589b (patch)
tree918d73b9be46f89736b6438d3fade06a72e34bf3 /gtk/gtkfilechooserdefault.c
parent2aadb2dff2ef03188a27819d26671112e5d8143b (diff)
downloadgtk+-9228dcee29503f00c13f7379f0410e510c6a589b.tar.gz
Make F2 work for renaming bookmarks. (#320822, Jaap A. Haitsma, patch by
2005-11-28 Matthias Clasen <mclasen@redhat.com> * gtk/gtkfilechooserdefault.c (shortcuts_key_press_event_cb): Make F2 work for renaming bookmarks. (#320822, Jaap A. Haitsma, patch by Paolo Borelli)
Diffstat (limited to 'gtk/gtkfilechooserdefault.c')
-rw-r--r--gtk/gtkfilechooserdefault.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 2fd00ac894..d25d458977 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -2962,9 +2962,9 @@ remove_shortcut_cb (GtkMenuItem *item,
remove_selected_bookmarks (impl);
}
+/* Rename the selected bookmark */
static void
-rename_shortcut_cb (GtkMenuItem *item,
- GtkFileChooserDefault *impl)
+rename_selected_bookmark (GtkFileChooserDefault *impl)
{
GtkTreeIter iter;
GtkTreePath *path;
@@ -2986,6 +2986,13 @@ rename_shortcut_cb (GtkMenuItem *item,
}
}
+static void
+rename_shortcut_cb (GtkMenuItem *item,
+ GtkFileChooserDefault *impl)
+{
+ rename_selected_bookmark (impl);
+}
+
/* Constructs the popup menu for the file list if needed */
static void
shortcuts_build_popup_menu (GtkFileChooserDefault *impl)
@@ -6789,6 +6796,13 @@ shortcuts_key_press_event_cb (GtkWidget *widget,
return TRUE;
}
+ if ((event->keyval == GDK_F2)
+ && (event->state & modifiers) == 0)
+ {
+ rename_selected_bookmark (impl);
+ return TRUE;
+ }
+
return FALSE;
}