summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-entry.c
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-10-11 23:19:59 +0000
committerDarin Adler <darin@src.gnome.org>2000-10-11 23:19:59 +0000
commit0e48d093d60ead96b548092cdbcd7ff24e318c18 (patch)
treec9c4fa0c24f5c900accd1191d0c2ee9f2e362b2c /libnautilus-private/nautilus-entry.c
parent8f92ec744ee79209b35ccdb18dda977441dfbc48 (diff)
downloadnautilus-0e48d093d60ead96b548092cdbcd7ff24e318c18.tar.gz
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.
Diffstat (limited to 'libnautilus-private/nautilus-entry.c')
-rw-r--r--libnautilus-private/nautilus-entry.c53
1 files changed, 28 insertions, 25 deletions
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));
}
/**