diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-03-05 12:38:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-03-05 20:36:23 +0800 |
commit | 2836a54dd6d61e35d1446f9a23a628064516a309 (patch) | |
tree | b9cb2ab39212de803e935ed28957ee77e73c2d96 /widgets/table | |
parent | baa7f20333a5bbb7c8cbb3cf2ce86b57aba79ef2 (diff) | |
download | gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.gz gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.zst gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.zip |
Work around recent GTK+ deprecations.
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-cell-combo.c | 8 | ||||
-rw-r--r-- | widgets/table/e-cell-date-edit.c | 16 | ||||
-rw-r--r-- | widgets/table/e-cell-text.c | 4 | ||||
-rw-r--r-- | widgets/table/e-table-item.c | 12 | ||||
-rw-r--r-- | widgets/table/e-table.c | 4 | ||||
-rw-r--r-- | widgets/table/e-tree.c | 4 | ||||
-rw-r--r-- | widgets/table/gal-a11y-e-table.c | 8 |
7 files changed, 56 insertions, 0 deletions
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index fe9b90717f..31e6c29b99 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -494,7 +494,11 @@ e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc) GtkTreeIter iter; GtkTreeModel *model; +#if GTK_CHECK_VERSION(2,19,7) + if (!gtk_widget_get_realized (ecc->popup_window) || !gtk_tree_selection_get_selected (selection, &model, &iter)) +#else if (!GTK_WIDGET_REALIZED (ecc->popup_window) || !gtk_tree_selection_get_selected (selection, &model, &iter)) +#endif return; e_cell_combo_update_cell (ecc); @@ -597,7 +601,11 @@ e_cell_combo_key_press (GtkWidget *popup_window, && event->keyval != GDK_3270_Enter) return FALSE; +#if GTK_CHECK_VERSION(2,19,7) + if (event->keyval == GDK_Escape && (!ecc->popup_window||!gtk_widget_get_visible (ecc->popup_window))) +#else if (event->keyval == GDK_Escape && (!ecc->popup_window||!GTK_WIDGET_VISIBLE (ecc->popup_window))) +#endif return FALSE; gtk_grab_remove (ecc->popup_window); diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c index 1d27b292d0..692614ff14 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/widgets/table/e-cell-date-edit.c @@ -383,16 +383,32 @@ e_cell_date_edit_get_property (GObject *object, switch (property_id) { case PROP_SHOW_TIME: +#if GTK_CHECK_VERSION(2,19,7) + g_value_set_boolean (value, gtk_widget_get_visible (ecde->time_entry)); +#else g_value_set_boolean (value, GTK_WIDGET_VISIBLE (ecde->time_entry)); +#endif return; case PROP_SHOW_NOW_BUTTON: +#if GTK_CHECK_VERSION(2,19,7) + g_value_set_boolean (value, gtk_widget_get_visible (ecde->now_button)); +#else g_value_set_boolean (value, GTK_WIDGET_VISIBLE (ecde->now_button)); +#endif return; case PROP_SHOW_TODAY_BUTTON: +#if GTK_CHECK_VERSION(2,19,7) + g_value_set_boolean (value, gtk_widget_get_visible (ecde->today_button)); +#else g_value_set_boolean (value, GTK_WIDGET_VISIBLE (ecde->today_button)); +#endif return; case PROP_ALLOW_NO_DATE_SET: +#if GTK_CHECK_VERSION(2,19,7) + g_value_set_boolean (value, gtk_widget_get_visible (ecde->none_button)); +#else g_value_set_boolean (value, GTK_WIDGET_VISIBLE (ecde->none_button)); +#endif return; case PROP_USE_24_HOUR_FORMAT: g_value_set_boolean (value, ecde->use_24_hour_format); diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 57dd88e17d..f9d3441d6f 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -735,7 +735,11 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, selected = flags & E_CELL_SELECTED; if (selected) { +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (canvas)) +#else if (GTK_WIDGET_HAS_FOCUS (canvas)) +#endif foreground = &canvas->style->fg [GTK_STATE_SELECTED]; else foreground = &canvas->style->fg [GTK_STATE_ACTIVE]; diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 06e847f40e..22a0848d7f 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -251,7 +251,11 @@ eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean sel gboolean allocated = FALSE; if (selected) { +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (canvas)) +#else if (GTK_WIDGET_HAS_FOCUS(canvas)) +#endif background = &canvas->style->bg [GTK_STATE_SELECTED]; else background = &canvas->style->bg [GTK_STATE_ACTIVE]; @@ -299,7 +303,11 @@ eti_get_cell_foreground_color (ETableItem *eti, gint row, gint col, gboolean sel *allocated = FALSE; if (selected) { +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (canvas)) +#else if (GTK_WIDGET_HAS_FOCUS (canvas)) +#endif foreground = &canvas->style->fg [GTK_STATE_SELECTED]; else foreground = &canvas->style->fg [GTK_STATE_ACTIVE]; @@ -1925,7 +1933,11 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid gdk_color_free (background); flags = col_selected ? E_CELL_SELECTED : 0; +#if GTK_CHECK_VERSION(2,19,7) + flags |= gtk_widget_has_focus (canvas) ? E_CELL_FOCUSED : 0; +#else flags |= GTK_WIDGET_HAS_FOCUS(canvas) ? E_CELL_FOCUSED : 0; +#endif flags |= cursor ? E_CELL_CURSOR : 0; switch (ecol->justification) { diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index fcf56da531..8110732e2c 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -1052,7 +1052,11 @@ et_eti_leave_edit (ETable *et) { GnomeCanvas *canvas = et->table_canvas; +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (GTK_WIDGET (canvas))) { +#else if (GTK_WIDGET_HAS_FOCUS(canvas)) { +#endif GnomeCanvasItem *item = GNOME_CANVAS(canvas)->focused_item; if (E_IS_TABLE_ITEM(item)) { diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index af1d15a1c4..ac1fcdd2d7 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -1053,7 +1053,11 @@ et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETree *e_tree) case GDK_2BUTTON_PRESS: case GDK_BUTTON_RELEASE: if (event->button.button != 4 && event->button.button != 5) { +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (GTK_WIDGET (root->canvas))) { +#else if (GTK_WIDGET_HAS_FOCUS(root->canvas)) { +#endif GnomeCanvasItem *item = GNOME_CANVAS(root->canvas)->focused_item; if (E_IS_TABLE_ITEM(item)) { diff --git a/widgets/table/gal-a11y-e-table.c b/widgets/table/gal-a11y-e-table.c index bf75227af4..37e5b892d2 100644 --- a/widgets/table/gal-a11y-e-table.c +++ b/widgets/table/gal-a11y-e-table.c @@ -90,7 +90,11 @@ init_child_item (GalA11yETable *a11y) return FALSE; table = E_TABLE (GTK_ACCESSIBLE (a11y)->widget); +#if GTK_CHECK_VERSION(2,19,7) + if (table && gtk_widget_get_mapped (GTK_WIDGET (table)) && table->group && E_IS_TABLE_GROUP_CONTAINER(table->group)) { +#else if (table && GTK_WIDGET_MAPPED (GTK_WIDGET (table)) && table->group && E_IS_TABLE_GROUP_CONTAINER(table->group)) { +#endif ETableGroupContainer *etgc = (ETableGroupContainer *)table->group; GList *list; @@ -284,7 +288,11 @@ gal_a11y_e_table_new (GObject *widget) GTK_ACCESSIBLE (a11y)->widget = GTK_WIDGET (widget); /* we need to init all the children for multiple table items */ +#if GTK_CHECK_VERSION(2,19,7) + if (table && gtk_widget_get_mapped (GTK_WIDGET (table)) && table->group && E_IS_TABLE_GROUP_CONTAINER (table->group)) { +#else if (table && GTK_WIDGET_MAPPED (GTK_WIDGET (table)) && table->group && E_IS_TABLE_GROUP_CONTAINER (table->group)) { +#endif /* Ref it here so that it is still valid in the idle function */ /* It will be unrefed in the idle function */ g_object_ref (a11y); |