[nautilus/rendering-cleanup: 16/17] Use new gdk keysym names



commit 4ab4856726445dc9c038b9a1350ced0c2097baf9
Author: Christian Persch <chpe gnome org>
Date:   Thu Sep 16 18:26:23 2010 +0200

    Use new gdk keysym names

 src/file-manager/fm-directory-view.c    |    6 +++---
 src/file-manager/fm-list-view.c         |   17 +++++++++--------
 src/file-manager/fm-properties-window.c |    2 +-
 src/nautilus-bookmarks-window.c         |    4 ++--
 src/nautilus-location-entry.c           |   28 ++++++++++++++--------------
 src/nautilus-navigation-bar.c           |    2 +-
 src/nautilus-places-sidebar.c           |    8 ++++----
 src/nautilus-query-editor.c             |    2 +-
 src/nautilus-search-bar.c               |    6 +++---
 src/nautilus-side-pane.c                |    9 +++++----
 src/nautilus-spatial-window.c           |    4 ++--
 src/nautilus-window.c                   |    8 ++++----
 src/nautilus-zoom-control.c             |   12 ++++++------
 13 files changed, 55 insertions(+), 53 deletions(-)
---
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 914625a..d883a53 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -10782,11 +10782,11 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
 			      G_TYPE_BOOLEAN, 0);
 	
 	binding_set = gtk_binding_set_by_class (klass);
-	gtk_binding_entry_add_signal (binding_set, GDK_Delete, 0,
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, 0,
 				      "trash", 0);
-	gtk_binding_entry_add_signal (binding_set, GDK_KP_Delete, 0,
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, 0,
 				      "trash", 0);
-	gtk_binding_entry_add_signal (binding_set, GDK_KP_Delete, GDK_SHIFT_MASK,
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, GDK_SHIFT_MASK,
 				      "delete", 0);
 
 	klass->trash = real_trash;
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index 9980dab..2431b65 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -1002,13 +1002,13 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat
 	handled = FALSE;
 
 	switch (event->keyval) {
-	case GDK_F10:
+	case GDK_KEY_F10:
 		if (event->state & GDK_CONTROL_MASK) {
 			fm_directory_view_pop_up_background_context_menu (view, &button_event);
 			handled = TRUE;
 		}
 		break;
-	case GDK_Right:
+	case GDK_KEY_Right:
 		gtk_tree_view_get_cursor (tree_view, &path, NULL);
 		if (path) {
 			gtk_tree_view_expand_row (tree_view, path, FALSE);
@@ -1016,7 +1016,7 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat
 		}
 		handled = TRUE;
 		break;
-	case GDK_Left:
+	case GDK_KEY_Left:
 		gtk_tree_view_get_cursor (tree_view, &path, NULL);
 		if (path) {
 			gtk_tree_view_collapse_row (tree_view, path);
@@ -1024,7 +1024,7 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat
 		}
 		handled = TRUE;
 		break;
-	case GDK_space:
+	case GDK_KEY_space:
 		if (event->state & GDK_CONTROL_MASK) {
 			handled = FALSE;
 			break;
@@ -1040,8 +1040,9 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat
 		}
 		handled = TRUE;
 		break;
-	case GDK_Return:
-	case GDK_KP_Enter:
+	case GDK_KEY_Return:
+	case GDK_KEY_KP_Enter:
+        case GDK_KEY_ISO_Enter:
 		if ((event->state & GDK_SHIFT_MASK) != 0) {
 			activate_selected_items_alternate (FM_LIST_VIEW (view), NULL, TRUE);
 		} else {
@@ -1049,7 +1050,7 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat
 		}
 		handled = TRUE;
 		break;
-	case GDK_v:
+	case GDK_KEY_v:
 		/* Eat Control + v to not enable type ahead */
 		if ((event->state & GDK_CONTROL_MASK) != 0) {
 			handled = TRUE;
@@ -1502,7 +1503,7 @@ create_and_set_up_tree_view (FMListView *view)
 
 	/* Don't handle backspace key. It's used to open the parent folder. */
 	binding_set = gtk_binding_set_by_class (GTK_WIDGET_GET_CLASS (view->details->tree_view));
-	gtk_binding_entry_remove (binding_set, GDK_BackSpace, 0);
+	gtk_binding_entry_remove (binding_set, GDK_KEY_BackSpace, 0);
 
 	view->details->drag_dest = 
 		nautilus_tree_view_drag_dest_new (view->details->tree_view);
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index 8dd69e5..07a6936 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -5502,7 +5502,7 @@ fm_properties_window_class_init (FMPropertiesWindowClass *class)
 	GTK_DIALOG_CLASS (class)->response = real_response;
 
 	binding_set = gtk_binding_set_by_class (class);
-	gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0,
 				      "close", 0);
 }
 
diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c
index 14b797c..dfc7b78 100644
--- a/src/nautilus-bookmarks-window.c
+++ b/src/nautilus-bookmarks-window.c
@@ -723,7 +723,7 @@ on_key_pressed (GtkTreeView *view,
                 GdkEventKey *event,
                 gpointer user_data)
 {
-        if (event->keyval == GDK_Delete || event->keyval == GDK_KP_Delete) {
+        if (event->keyval == GDK_KEY_Delete || event->keyval == GDK_KEY_KP_Delete) {
                 bookmarks_delete_bookmark ();
                 return TRUE;
         }
@@ -1053,7 +1053,7 @@ handle_close_accelerator (GtkWindow *window,
 	g_assert (event != NULL);
 	g_assert (user_data == NULL);
 
-	if (event->state & GDK_CONTROL_MASK && event->keyval == GDK_w) {
+	if (event->state & GDK_CONTROL_MASK && event->keyval == GDK_KEY_w) {
 		gtk_widget_hide (GTK_WIDGET (window));
 		return TRUE;
 	}
diff --git a/src/nautilus-location-entry.c b/src/nautilus-location-entry.c
index 79270db..827a890 100644
--- a/src/nautilus-location-entry.c
+++ b/src/nautilus-location-entry.c
@@ -123,19 +123,19 @@ static gboolean
 entry_would_have_inserted_characters (const GdkEventKey *event)
 {
 	switch (event->keyval) {
-	case GDK_BackSpace:
-	case GDK_Clear:
-	case GDK_Insert:
-	case GDK_Delete:
-	case GDK_Home:
-	case GDK_End:
-	case GDK_KP_Home:
-	case GDK_KP_End:
-	case GDK_Left:
-	case GDK_Right:
-	case GDK_KP_Left:
-	case GDK_KP_Right:
-	case GDK_Return:
+	case GDK_KEY_BackSpace:
+	case GDK_KEY_Clear:
+	case GDK_KEY_Insert:
+	case GDK_KEY_Delete:
+	case GDK_KEY_Home:
+	case GDK_KEY_End:
+	case GDK_KEY_KP_Home:
+	case GDK_KEY_KP_End:
+	case GDK_KEY_Left:
+	case GDK_KEY_Right:
+	case GDK_KEY_KP_Left:
+	case GDK_KEY_KP_Right:
+	case GDK_KEY_Return:
 		return FALSE;
 	default:
 		if (event->keyval >= 0x20 && event->keyval <= 0xFF) {
@@ -218,7 +218,7 @@ editable_event_after_callback (GtkEntry *entry,
 	 * likely an auto-completion. We ignore shift / control since
 	 * they can validly be used to extend the selection.
 	 */
-	if ((keyevent->keyval == GDK_Right || keyevent->keyval == GDK_End) &&
+	if ((keyevent->keyval == GDK_KEY_Right || keyevent->keyval == GDK_KEY_End) &&
 	    !(keyevent->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) && 
 	    gtk_editable_get_selection_bounds (editable, NULL, NULL)) {
 		set_position_and_selection_to_end (editable);
diff --git a/src/nautilus-navigation-bar.c b/src/nautilus-navigation-bar.c
index 6419308..26da78c 100644
--- a/src/nautilus-navigation-bar.c
+++ b/src/nautilus-navigation-bar.c
@@ -92,7 +92,7 @@ nautilus_navigation_bar_class_init (NautilusNavigationBarClass *klass)
 	klass->cancel = NULL;
 
 	binding_set = gtk_binding_set_by_class (klass);
-	gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "cancel", 0);
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "cancel", 0);
 
 	EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, nautilus_navigation_bar, get_location);
 	EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, nautilus_navigation_bar, set_location);
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index ce3ef5e..e11ab7e 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -2413,19 +2413,19 @@ bookmarks_key_press_event_cb (GtkWidget             *widget,
 
   modifiers = gtk_accelerator_get_default_mod_mask ();
 
-  if (event->keyval == GDK_Down &&
+  if (event->keyval == GDK_KEY_Down &&
       (event->state & modifiers) == GDK_MOD1_MASK) {
       return eject_or_unmount_selection (sidebar);
   }
 
-  if ((event->keyval == GDK_Delete
-      || event->keyval == GDK_KP_Delete)
+  if ((event->keyval == GDK_KEY_Delete
+      || event->keyval == GDK_KEY_KP_Delete)
       && (event->state & modifiers) == 0) {
       remove_selected_bookmarks (sidebar);
       return TRUE;
   }
 
-  if ((event->keyval == GDK_F2)
+  if ((event->keyval == GDK_KEY_F2)
       && (event->state & modifiers) == 0) {
       rename_selected_bookmark (sidebar);
       return TRUE;
diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c
index 07f9ecc..7d351ae 100644
--- a/src/nautilus-query-editor.c
+++ b/src/nautilus-query-editor.c
@@ -200,7 +200,7 @@ nautilus_query_editor_class_init (NautilusQueryEditorClass *class)
 		              G_TYPE_NONE, 0);
 
 	binding_set = gtk_binding_set_by_class (class);
-	gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "cancel", 0);
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "cancel", 0);
 }
 
 static void
diff --git a/src/nautilus-search-bar.c b/src/nautilus-search-bar.c
index b8d5240..567444b 100644
--- a/src/nautilus-search-bar.c
+++ b/src/nautilus-search-bar.c
@@ -100,7 +100,7 @@ nautilus_search_bar_class_init (NautilusSearchBarClass *class)
 			      G_TYPE_NONE, 0);
 
 	binding_set = gtk_binding_set_by_class (class);
-	gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "cancel", 0);
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "cancel", 0);
 }
 
 static gboolean
@@ -195,7 +195,7 @@ nautilus_search_bar_borrow_entry (NautilusSearchBar *bar)
 	bar->details->entry_borrowed = TRUE;
 
 	binding_set = gtk_binding_set_by_class (G_OBJECT_GET_CLASS (bar));
-	gtk_binding_entry_remove (binding_set, GDK_Escape, 0);
+	gtk_binding_entry_remove (binding_set, GDK_KEY_Escape, 0);
 	return bar->details->entry;
 }
 
@@ -207,7 +207,7 @@ nautilus_search_bar_return_entry (NautilusSearchBar *bar)
 	bar->details->entry_borrowed = FALSE;
 	
 	binding_set = gtk_binding_set_by_class (G_OBJECT_GET_CLASS (bar));
-	gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, "cancel", 0);
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "cancel", 0);
 }
 
 GtkWidget *
diff --git a/src/nautilus-side-pane.c b/src/nautilus-side-pane.c
index d8e0f6a..1b2e137 100644
--- a/src/nautilus-side-pane.c
+++ b/src/nautilus-side-pane.c
@@ -267,10 +267,11 @@ select_button_key_press_callback (GtkWidget *widget,
 	
 	side_pane = NAUTILUS_SIDE_PANE (user_data);
 
-	if (event->keyval == GDK_space || 
-	    event->keyval == GDK_KP_Space ||
-	    event->keyval == GDK_Return ||
-	    event->keyval == GDK_KP_Enter) {
+	if (event->keyval == GDK_KEY_space ||
+	    event->keyval == GDK_KEY_KP_Space ||
+	    event->keyval == GDK_KEY_Return ||
+	    event->keyval == GDK_KEY_KP_Enter ||
+            event->keyval == GDK_KEY_ISO_Enter) {
 		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
 		gtk_menu_popup (GTK_MENU (side_pane->details->menu),
 				NULL, NULL, menu_position_under, widget, 
diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c
index c6dd9c6..4fa5415 100644
--- a/src/nautilus-spatial-window.c
+++ b/src/nautilus-spatial-window.c
@@ -1086,10 +1086,10 @@ nautilus_spatial_window_class_init (NautilusSpatialWindowClass *klass)
 	G_OBJECT_CLASS (klass)->finalize = nautilus_spatial_window_finalize;
 
 	binding_set = gtk_binding_set_by_class (klass);
-	gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, GDK_SHIFT_MASK,
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_SHIFT_MASK,
 				      "go_up", 1,
 				      G_TYPE_BOOLEAN, TRUE);
-	gtk_binding_entry_add_signal (binding_set, GDK_Up, GDK_SHIFT_MASK | GDK_MOD1_MASK,
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_Up, GDK_SHIFT_MASK | GDK_MOD1_MASK,
 				      "go_up", 1,
 				      G_TYPE_BOOLEAN, TRUE);
 
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 3763630..de9e151 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1085,7 +1085,7 @@ add_view_as_menu_item (NautilusWindow *window,
 		g_snprintf (accel_path, sizeof (accel_path), "<Nautilus-Window>/%s", action_name);
 
 		accel_keyval = gdk_keyval_from_name (accel);
-		g_assert (accel_keyval != GDK_VoidSymbol);
+		g_assert (accel_keyval != GDK_KEY_VoidSymbol);
 
 		gtk_accel_map_add_entry (accel_path, accel_keyval, GDK_CONTROL_MASK);
 		gtk_action_set_accel_path (GTK_ACTION (action), accel_path);
@@ -2048,12 +2048,12 @@ nautilus_window_class_init (NautilusWindowClass *class)
 			      G_TYPE_NONE, 0);
 
 	binding_set = gtk_binding_set_by_class (class);
-	gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, 0,
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, 0,
 				      "go_up", 1,
 				      G_TYPE_BOOLEAN, FALSE);
-	gtk_binding_entry_add_signal (binding_set, GDK_F5, 0,
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_F5, 0,
 				      "reload", 0);
-	gtk_binding_entry_add_signal (binding_set, GDK_slash, 0,
+	gtk_binding_entry_add_signal (binding_set, GDK_KEY_slash, 0,
 				      "prompt-for-location", 1,
 				      G_TYPE_STRING, "/");
 
diff --git a/src/nautilus-zoom-control.c b/src/nautilus-zoom-control.c
index 2907cd7..c2f3e25 100644
--- a/src/nautilus-zoom-control.c
+++ b/src/nautilus-zoom-control.c
@@ -689,32 +689,32 @@ nautilus_zoom_control_class_init (NautilusZoomControlClass *class)
 	binding_set = gtk_binding_set_by_class (class);	
 
 	gtk_binding_entry_add_signal (binding_set, 
-				      GDK_KP_Subtract, 0, 
+				      GDK_KEY_KP_Subtract, 0,
 				      "change_value",
 				      1, GTK_TYPE_SCROLL_TYPE, 
 				      GTK_SCROLL_STEP_DOWN);
 	gtk_binding_entry_add_signal (binding_set, 
-				      GDK_minus, 0,
+				      GDK_KEY_minus, 0,
 				      "change_value",
 				      1, GTK_TYPE_SCROLL_TYPE, 
 				      GTK_SCROLL_STEP_DOWN);
 
 	gtk_binding_entry_add_signal (binding_set, 
-				      GDK_KP_Equal, 0, 
+				      GDK_KEY_KP_Equal, 0,
 				      "zoom_to_default",
 				      0);
 	gtk_binding_entry_add_signal (binding_set, 
-				      GDK_KP_Equal, 0, 
+				      GDK_KEY_KP_Equal, 0,
 				      "zoom_to_default",
 				      0);
 
 	gtk_binding_entry_add_signal (binding_set, 
-				      GDK_KP_Add, 0, 
+				      GDK_KEY_KP_Add, 0,
 				      "change_value",
 				      1, GTK_TYPE_SCROLL_TYPE,
 				      GTK_SCROLL_STEP_UP);
 	gtk_binding_entry_add_signal (binding_set, 
-				      GDK_plus, 0, 
+				      GDK_KEY_plus, 0,
 				      "change_value",
 				      1, GTK_TYPE_SCROLL_TYPE,
 				      GTK_SCROLL_STEP_UP);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]