diff options
author | Javier Jardón <jjardon@gnome.org> | 2009-12-04 02:15:00 +0100 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2009-12-04 02:50:57 +0100 |
commit | 325bd9299aaf05f18138c7e5f490a9bf9e1ce00a (patch) | |
tree | 7c654f496c72f673ccb1758d716d48a96c7df3f3 /gtk | |
parent | 46f5ee1d0c0f4601853ed57e99b1b513f1baa445 (diff) | |
download | gtk+-325bd9299aaf05f18138c7e5f490a9bf9e1ce00a.tar.gz |
Use GtkCellEditable::editing-canceled
GtkCellEditable::editing-canceled property was added in 2.19 cycle,
so we should make the code that currently uses entry->editing_canceled
directly go through the property
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=599213
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkcellrenderercombo.c | 6 | ||||
-rw-r--r-- | gtk/gtkcellrendererspin.c | 4 | ||||
-rw-r--r-- | gtk/gtkcellrenderertext.c | 14 | ||||
-rw-r--r-- | gtk/gtkcombobox.c | 21 | ||||
-rw-r--r-- | gtk/gtkcombobox.h | 2 |
5 files changed, 26 insertions, 21 deletions
diff --git a/gtk/gtkcellrenderercombo.c b/gtk/gtkcellrenderercombo.c index 1ad0b228bf..ba5fabb63d 100644 --- a/gtk/gtkcellrenderercombo.c +++ b/gtk/gtkcellrenderercombo.c @@ -331,8 +331,10 @@ gtk_cell_renderer_combo_editing_done (GtkCellEditable *combo, g_signal_handler_disconnect (combo, cell->focus_out_id); cell->focus_out_id = 0; } - - canceled = _gtk_combo_box_editing_canceled (GTK_COMBO_BOX (combo)); + + g_object_get (combo, + "editing-canceled", &canceled, + NULL); gtk_cell_renderer_stop_editing (GTK_CELL_RENDERER (data), canceled); if (canceled) { diff --git a/gtk/gtkcellrendererspin.c b/gtk/gtkcellrendererspin.c index ebd08e275c..2a3961bf20 100644 --- a/gtk/gtkcellrendererspin.c +++ b/gtk/gtkcellrendererspin.c @@ -230,7 +230,9 @@ gtk_cell_renderer_spin_focus_out_event (GtkWidget *widget, const gchar *new_text; gboolean canceled; - canceled = GTK_ENTRY (widget)->editing_canceled; + g_object_get (widget, + "editing-canceled", &canceled, + NULL); g_signal_handlers_disconnect_by_func (widget, gtk_cell_renderer_spin_focus_out_event, diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c index 3e47c91080..bbdd21b917 100644 --- a/gtk/gtkcellrenderertext.c +++ b/gtk/gtkcellrenderertext.c @@ -1701,6 +1701,7 @@ gtk_cell_renderer_text_editing_done (GtkCellEditable *entry, { const gchar *path; const gchar *new_text; + gboolean canceled; GtkCellRendererTextPrivate *priv; priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (data); @@ -1725,9 +1726,12 @@ gtk_cell_renderer_text_editing_done (GtkCellEditable *entry, priv->entry_menu_popdown_timeout = 0; } - gtk_cell_renderer_stop_editing (GTK_CELL_RENDERER (data), - GTK_ENTRY (entry)->editing_canceled); - if (GTK_ENTRY (entry)->editing_canceled) + g_object_get (entry, + "editing-canceled", &canceled, + NULL); + gtk_cell_renderer_stop_editing (GTK_CELL_RENDERER (data), canceled); + + if (canceled) return; path = g_object_get_data (G_OBJECT (entry), GTK_CELL_RENDERER_TEXT_PATH); @@ -1801,7 +1805,9 @@ gtk_cell_renderer_text_focus_out_event (GtkWidget *entry, if (priv->in_entry_menu) return FALSE; - GTK_ENTRY (entry)->editing_canceled = TRUE; + g_object_set (entry, + "editing-canceled", TRUE, + NULL); gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (entry)); gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (entry)); diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index ebe90d9fa2..666cb7fb00 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -3198,7 +3198,9 @@ gtk_combo_box_menu_item_activate (GtkWidget *item, gtk_tree_path_free (path); - combo_box->priv->editing_canceled = FALSE; + g_object_set (combo_box, + "editing-canceled", FALSE, + NULL); } static void @@ -5510,8 +5512,9 @@ gtk_cell_editable_key_press (GtkWidget *widget, if (event->keyval == GDK_Escape) { - combo_box->priv->editing_canceled = TRUE; - + g_object_set (combo_box, + "editing-canceled", TRUE, + NULL); gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box)); gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (combo_box)); @@ -5566,7 +5569,9 @@ popup_idle (gpointer data) combo_box, 0); /* we unset this if a menu item is activated */ - combo_box->priv->editing_canceled = TRUE; + g_object_set (combo_box, + "editing-canceled", TRUE, + NULL); gtk_combo_box_popup (combo_box); combo_box->priv->popup_idle_id = 0; @@ -5727,14 +5732,6 @@ gtk_combo_box_set_title (GtkComboBox *combo_box, } } -gboolean -_gtk_combo_box_editing_canceled (GtkComboBox *combo_box) -{ - g_return_val_if_fail (GTK_IS_COMBO_BOX (combo_box), TRUE); - - return combo_box->priv->editing_canceled; -} - /** * gtk_combo_box_get_popup_accessible: * @combo_box: a #GtkComboBox diff --git a/gtk/gtkcombobox.h b/gtk/gtkcombobox.h index 1da1562b19..963e4b415b 100644 --- a/gtk/gtkcombobox.h +++ b/gtk/gtkcombobox.h @@ -136,8 +136,6 @@ void gtk_combo_box_popup (GtkComboBox *combo_box); void gtk_combo_box_popdown (GtkComboBox *combo_box); AtkObject* gtk_combo_box_get_popup_accessible (GtkComboBox *combo_box); -/* private */ -gboolean _gtk_combo_box_editing_canceled (GtkComboBox *combo_box); G_END_DECLS |