From 0e48d093d60ead96b548092cdbcd7ff24e318c18 Mon Sep 17 00:00:00 2001 From: Darin Adler Date: Wed, 11 Oct 2000 23:19:59 +0000 Subject: Remove the Undo command. * src/nautilus-shell-ui.xml: Remove the Undo command. * libnautilus-extensions/nautilus-entry.c: (nautilus_entry_key_press): Clean up code structure in here a bit. I expected to find code to handle Control-Z here, but I didn't find it. --- libnautilus-private/nautilus-entry.c | 53 +++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) (limited to 'libnautilus-private/nautilus-entry.c') diff --git a/libnautilus-private/nautilus-entry.c b/libnautilus-private/nautilus-entry.c index e968d8db5..d53d66596 100644 --- a/libnautilus-private/nautilus-entry.c +++ b/libnautilus-private/nautilus-entry.c @@ -126,41 +126,44 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event) GtkEditable *editable; int position; - g_assert (NAUTILUS_IS_ENTRY (widget)); - + entry = NAUTILUS_ENTRY (widget); editable = GTK_EDITABLE (widget); if (!editable->editable) { return FALSE; } - entry = NAUTILUS_ENTRY(widget); - - /* the location bar entry wants TAB to work kind of like it does - in the shell for command completion, so if we get a tab and - there's a selection, we should position the insertion point - at the end of the selection */ - - if (entry->special_tab_handling && (event->keyval == GDK_Tab) - && editable->has_selection) { - position = strlen (gtk_entry_get_text (GTK_ENTRY (editable))); - gtk_entry_select_region (GTK_ENTRY (editable), position, position); - return TRUE; - } - - /* Fix bug in GtkEntry where keypad Enter key inserts a - * character rather than activating like the other Enter key. - */ switch (event->keyval) { - case GDK_KP_Enter: - gtk_widget_activate (widget); + case GDK_Tab: + /* The location bar entry wants TAB to work kind of + * like it does in the shell for command completion, + * so if we get a tab and there's a selection, we + * should position the insertion point at the end of + * the selection. + */ + if (entry->special_tab_handling + && editable->has_selection) { + position = strlen (gtk_entry_get_text (GTK_ENTRY (editable))); + gtk_entry_select_region (GTK_ENTRY (editable), position, position); return TRUE; - - default: - break; + } + break; + + case GDK_KP_Enter: + /* Fix bug in GtkEntry where keypad Enter key inserts + * a character rather than activating like the other + * Enter key. + */ + gtk_widget_activate (widget); + return TRUE; + + default: + break; } - return NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, key_press_event, (widget, event)); + return NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, + key_press_event, + (widget, event)); } /** -- cgit v1.2.1