From 1e663aa13266cad55e5019c03e768a38955166eb Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 13 Oct 2010 23:40:16 -0400 Subject: Replace EBinding with GBinding. GObject now does property bindings itself. Requires GLib >= 2.26. --- addressbook/gui/widgets/e-addressbook-view.c | 1 - calendar/gui/dialogs/cal-prefs-dialog.c | 131 +++-- calendar/gui/dialogs/comp-editor-util.c | 1 - calendar/gui/dialogs/comp-editor.c | 6 +- calendar/gui/dialogs/event-editor.c | 11 +- calendar/gui/dialogs/recurrence-page.c | 1 - calendar/gui/dialogs/schedule-page.c | 1 - calendar/gui/dialogs/task-editor.c | 6 +- calendar/gui/e-cal-list-view.c | 19 +- calendar/gui/e-cal-model-tasks.c | 1 - calendar/gui/e-day-view.c | 1 - calendar/gui/e-meeting-time-sel.c | 31 +- calendar/gui/e-memo-table.c | 19 +- calendar/gui/e-task-table.c | 19 +- calendar/gui/e-week-view.c | 1 - calendar/gui/gnome-cal.c | 1 - composer/e-composer-header-table.c | 21 +- composer/e-composer-private.c | 12 +- composer/e-composer-private.h | 1 - configure.ac | 2 +- doc/reference/shell/eshell-docs.sgml | 1 - doc/reference/shell/eshell-sections.txt | 23 +- doc/reference/shell/tmpl/e-util.sgml | 24 + doc/reference/shell/tmpl/eshell-unused.sgml | 137 +++++ e-util/Makefile.am | 2 - e-util/e-binding.c | 557 --------------------- e-util/e-binding.h | 117 ----- e-util/e-config.c | 6 +- e-util/e-util.c | 61 +++ e-util/e-util.h | 12 + mail/e-mail-attachment-bar.c | 49 +- mail/e-mail-backend.c | 6 +- mail/e-mail-label-action.c | 13 +- mail/e-mail-paned-view.c | 11 +- mail/e-mail-reader.c | 7 +- mail/e-mail-tag-editor.c | 22 +- mail/em-folder-properties.c | 8 +- mail/em-subscription-editor.c | 7 +- mail/em-utils.c | 11 +- modules/addressbook/autocompletion-config.c | 7 +- modules/addressbook/e-book-shell-content.c | 11 +- modules/addressbook/e-book-shell-view-actions.c | 10 +- modules/addressbook/e-book-shell-view-private.h | 1 - modules/calendar/e-cal-config-calendar-item.c | 11 +- modules/calendar/e-cal-config-date-edit.c | 11 +- modules/calendar/e-cal-config-meeting-store.c | 11 +- .../calendar/e-cal-config-meeting-time-selector.c | 16 +- modules/calendar/e-cal-config-model.c | 26 +- modules/calendar/e-cal-config-view.c | 61 ++- modules/calendar/e-cal-shell-content.c | 6 +- modules/calendar/e-cal-shell-settings.c | 252 ++++++---- modules/calendar/e-cal-shell-sidebar.c | 11 +- modules/calendar/e-cal-shell-view-private.c | 11 +- modules/calendar/e-cal-shell-view-private.h | 1 - modules/calendar/e-memo-shell-content.c | 11 +- modules/calendar/e-memo-shell-view-actions.c | 10 +- modules/calendar/e-memo-shell-view-private.c | 5 +- modules/calendar/e-memo-shell-view-private.h | 1 - modules/calendar/e-task-shell-content.c | 11 +- modules/calendar/e-task-shell-view-actions.c | 10 +- modules/calendar/e-task-shell-view-private.c | 11 +- modules/calendar/e-task-shell-view-private.h | 1 - modules/mail/e-mail-config-format-html.c | 27 +- modules/mail/e-mail-config-web-view.c | 21 +- modules/mail/e-mail-shell-backend.c | 1 - modules/mail/e-mail-shell-content.c | 1 - modules/mail/e-mail-shell-sidebar.c | 12 +- modules/mail/e-mail-shell-view-actions.c | 63 ++- modules/mail/e-mail-shell-view-private.c | 12 +- modules/mail/e-mail-shell-view-private.h | 1 - modules/mail/em-composer-prefs.c | 199 ++++---- modules/mail/em-mailer-prefs.c | 146 ++++-- modules/mailto-handler/evolution-mailto-handler.c | 8 +- plugins/mail-notification/mail-notification.c | 11 +- shell/e-shell-content.c | 1 - shell/e-shell-searchbar.c | 56 ++- shell/e-shell-sidebar.c | 16 +- shell/e-shell-utils.c | 16 +- shell/e-shell-view.c | 6 +- shell/e-shell-window-actions.c | 54 +- shell/e-shell-window-private.c | 44 +- shell/e-shell-window-private.h | 1 - shell/e-shell-window.c | 38 +- widgets/misc/e-account-manager.c | 7 +- widgets/misc/e-attachment-button.c | 38 +- widgets/misc/e-attachment-paned.c | 55 +- widgets/misc/e-attachment-view.c | 7 +- widgets/misc/e-dateedit.c | 6 +- widgets/misc/e-popup-action.c | 1 - widgets/misc/e-search-bar.c | 23 +- widgets/misc/e-signature-manager.c | 12 +- widgets/misc/e-signature-script-dialog.c | 1 - widgets/misc/e-web-view.c | 19 +- 93 files changed, 1332 insertions(+), 1437 deletions(-) delete mode 100644 e-util/e-binding.c delete mode 100644 e-util/e-binding.h diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 5d54f28686..fac9723923 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -36,7 +36,6 @@ #include "addressbook/printing/e-contact-print.h" #include "ea-addressbook.h" -#include "e-util/e-binding.h" #include "e-util/e-print.h" #include "e-util/e-selection.h" #include "e-util/e-util.h" diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c index bf59e37fb9..266d699143 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.c +++ b/calendar/gui/dialogs/cal-prefs-dialog.c @@ -32,7 +32,6 @@ #include "cal-prefs-dialog.h" #include #include "e-util/e-util.h" -#include "e-util/e-binding.h" #include "e-util/e-datetime-format.h" #include "e-util/e-dialog-widgets.h" #include "e-util/e-util-private.h" @@ -637,95 +636,127 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs, e_config_add_items ((EConfig *) ec, l, NULL, NULL, eccp_free, prefs); widget = e_builder_get_widget (prefs->builder, "use-system-tz-check"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-use-system-timezone", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); g_signal_connect ( shell_settings, "notify::cal-use-system-timezone", G_CALLBACK (update_system_tz_widgets), prefs); g_object_notify (G_OBJECT (shell_settings), "cal-use-system-timezone"); widget = e_builder_get_widget (prefs->builder, "timezone"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-timezone", - widget, "timezone"); - e_mutual_binding_new_with_negation ( + widget, "timezone", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); + g_object_bind_property ( shell_settings, "cal-use-system-timezone", - widget, "sensitive"); + widget, "sensitive", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE | + G_BINDING_INVERT_BOOLEAN); /* General tab */ prefs->day_second_zone = e_builder_get_widget (prefs->builder, "day_second_zone"); widget = e_builder_get_widget (prefs->builder, "sun_button"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-working-days-sunday", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "mon_button"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-working-days-monday", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "tue_button"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-working-days-tuesday", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "wed_button"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-working-days-wednesday", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "thu_button"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-working-days-thursday", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "fri_button"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-working-days-friday", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "sat_button"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-working-days-saturday", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "week_start_day"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-week-start-day", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "start_of_day"); prefs->start_of_day = widget; /* XXX delete this */ if (locale_supports_12_hour_format) - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-use-24-hour-format", - widget, "use-24-hour-format"); + widget, "use-24-hour-format", + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "end_of_day"); prefs->end_of_day = widget; /* XXX delete this */ if (locale_supports_12_hour_format) - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-use-24-hour-format", - widget, "use-24-hour-format"); + widget, "use-24-hour-format", + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "use_12_hour"); gtk_widget_set_sensitive (widget, locale_supports_12_hour_format); - e_mutual_binding_new_with_negation ( + g_object_bind_property ( shell_settings, "cal-use-24-hour-format", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE | + G_BINDING_INVERT_BOOLEAN); widget = e_builder_get_widget (prefs->builder, "use_24_hour"); gtk_widget_set_sensitive (widget, locale_supports_12_hour_format); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-use-24-hour-format", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "confirm_delete"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-confirm-delete", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); prefs->default_reminder = e_builder_get_widget (prefs->builder, "default_reminder"); prefs->default_reminder_interval = e_builder_get_widget (prefs->builder, "default_reminder_interval"); @@ -738,34 +769,44 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs, prefs->time_divisions = e_builder_get_widget (prefs->builder, "time_divisions"); widget = e_builder_get_widget (prefs->builder, "show_end_times"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-show-event-end-times", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "compress_weekend"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-compress-weekend", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "show_week_numbers"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-show-week-numbers", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); prefs->month_scroll_by_week = e_builder_get_widget (prefs->builder, "month_scroll_by_week"); widget = e_builder_get_widget (prefs->builder, "tasks_due_today_color"); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "cal-tasks-color-due-today", widget, "color", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, e_binding_transform_string_to_color, e_binding_transform_color_to_string, - (GDestroyNotify) NULL, NULL); + NULL, (GDestroyNotify) NULL); widget = e_builder_get_widget (prefs->builder, "tasks_overdue_color"); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "cal-tasks-color-overdue", widget, "color", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, e_binding_transform_string_to_color, e_binding_transform_color_to_string, (GDestroyNotify) NULL, NULL); @@ -780,9 +821,11 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs, /* Free/Busy tab */ widget = e_builder_get_widget (prefs->builder, "template_url"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-free-busy-template", - widget, "text"); + widget, "text", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* date/time format */ table = e_builder_get_widget (prefs->builder, "datetime_format_table"); diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index 6a95b2d425..69ec171917 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -32,7 +32,6 @@ #include #include #include -#include "e-util/e-binding.h" #include "widgets/misc/e-dateedit.h" #include "../calendar-config.h" #include "../itip-utils.h" diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 63196abea4..eb908d1e33 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -1842,9 +1841,10 @@ comp_editor_init (CompEditor *editor) action_group = comp_editor_get_action_group (editor, "individual"); action_group_2 = e_attachment_view_get_action_group (view, "editable"); - e_binding_new ( + g_object_bind_property ( action_group, "sensitive", - action_group_2, "sensitive"); + action_group_2, "sensitive", + G_BINDING_SYNC_CREATE); /* Listen for attachment store changes. */ diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index c101edcb2b..ad3c963ca6 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -33,7 +33,6 @@ #include #include -#include #include #include #include @@ -355,7 +354,10 @@ event_editor_constructor (GType type, comp_editor_append_page (editor, page, _("Free/Busy"), TRUE); schedule_page_update_free_busy (priv->sched_page); - e_binding_new (action_group, "visible", comp_editor_page_get_widget (page), "visible"); + g_object_bind_property ( + action_group, "visible", + comp_editor_page_get_widget (page), "visible", + G_BINDING_SYNC_CREATE); /* Alarm page */ alarm_page = event_page_get_alarm_page (priv->event_page); @@ -431,9 +433,10 @@ event_editor_constructed (GObject *object) priv = EVENT_EDITOR_GET_PRIVATE (object); - e_binding_new ( + g_object_bind_property ( object, "client", - priv->model, "client"); + priv->model, "client", + G_BINDING_SYNC_CREATE); } static void diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 555ca073c8..bf6092d340 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -44,7 +44,6 @@ #include "recurrence-page.h" #include "e-util/e-util.h" -#include "e-util/e-binding.h" #include "e-util/e-dialog-widgets.h" #include "e-util/e-util-private.h" diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index b98987618c..efc6795834 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 476fb060d4..d4e1c13161 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -32,7 +32,6 @@ #include #include -#include "e-util/e-binding.h" #include "e-util/e-plugin-ui.h" #include "e-util/e-util-private.h" @@ -210,9 +209,10 @@ task_editor_constructed (GObject *object) priv = TASK_EDITOR_GET_PRIVATE (object); - e_binding_new ( + g_object_bind_property ( object, "client", - priv->model, "client"); + priv->model, "client", + G_BINDING_SYNC_CREATE); } static void diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c index 70770aff53..d2baa3573d 100644 --- a/calendar/gui/e-cal-list-view.c +++ b/calendar/gui/e-cal-list-view.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include
#include
@@ -192,21 +191,27 @@ setup_e_table (ECalListView *cal_list_view) "bg_color_column", E_CAL_MODEL_FIELD_COLOR, NULL); - e_mutual_binding_new ( + g_object_bind_property ( model, "timezone", - cell, "timezone"); + cell, "timezone", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( model, "use-24-hour-format", - cell, "use-24-hour-format"); + cell, "use-24-hour-format", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); popup_cell = e_cell_date_edit_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); g_object_unref (cell); - e_mutual_binding_new ( + g_object_bind_property ( model, "use-24-hour-format", - popup_cell, "use-24-hour-format"); + popup_cell, "use-24-hour-format", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); e_table_extras_add_cell (extras, "dateedit", popup_cell); cal_list_view->dates_cell = E_CELL_DATE_EDIT (popup_cell); diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c index c69e7452b9..30e57f9a81 100644 --- a/calendar/gui/e-cal-model-tasks.c +++ b/calendar/gui/e-cal-model-tasks.c @@ -32,7 +32,6 @@ #include #include -#include "e-util/e-binding.h" #include "calendar-config.h" #include "e-cal-model-tasks.h" #include "e-cell-date-edit-text.h" diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index bb4c9e76b7..aa081ca3d1 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index e0fb5ad419..5041565a84 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -39,7 +39,6 @@ #include "misc/e-canvas-utils.h" #include "misc/e-dateedit.h" -#include "e-util/e-binding.h" #include "e-util/e-extensible.h" #include "e-util/e-util.h" @@ -761,17 +760,20 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em } e_date_edit_set_show_time (E_DATE_EDIT (mts->start_date_edit), TRUE); - e_binding_new ( + g_object_bind_property ( mts, "show-week-numbers", - mts->start_date_edit, "show-week-numbers"); + mts->start_date_edit, "show-week-numbers", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( mts, "use-24-hour-format", - mts->start_date_edit, "use-24-hour-format"); + mts->start_date_edit, "use-24-hour-format", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( mts, "week-start-day", - mts->start_date_edit, "week-start-day"); + mts->start_date_edit, "week-start-day", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), mts->start_date_edit, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); @@ -798,17 +800,20 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em } e_date_edit_set_show_time (E_DATE_EDIT (mts->end_date_edit), TRUE); - e_binding_new ( + g_object_bind_property ( mts, "show-week-numbers", - mts->end_date_edit, "show-week-numbers"); + mts->end_date_edit, "show-week-numbers", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( mts, "use-24-hour-format", - mts->end_date_edit, "use-24-hour-format"); + mts->end_date_edit, "use-24-hour-format", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( mts, "week-start-day", - mts->end_date_edit, "week-start-day"); + mts->end_date_edit, "week-start-day", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), mts->end_date_edit, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index f2df4d6697..b634f92e24 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include
#include
@@ -355,21 +354,27 @@ memo_table_constructed (GObject *object) cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT); g_object_set (cell, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, NULL); - e_mutual_binding_new ( + g_object_bind_property ( model, "timezone", - cell, "timezone"); + cell, "timezone", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( model, "use-24-hour-format", - cell, "use-24-hour-format"); + cell, "use-24-hour-format", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); popup_cell = e_cell_date_edit_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); g_object_unref (cell); - e_mutual_binding_new ( + g_object_bind_property ( model, "use-24-hour-format", - popup_cell, "use-24-hour-format"); + popup_cell, "use-24-hour-format", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); e_table_extras_add_cell (extras, "dateedit", popup_cell); memo_table->dates_cell = E_CELL_DATE_EDIT (popup_cell); diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c index 6441d4f450..04187348f9 100644 --- a/calendar/gui/e-task-table.c +++ b/calendar/gui/e-task-table.c @@ -41,7 +41,6 @@ #include
#include
#include
-#include #include #include #include @@ -444,21 +443,27 @@ task_table_constructed (GObject *object) "bg_color_column", E_CAL_MODEL_FIELD_COLOR, NULL); - e_mutual_binding_new ( + g_object_bind_property ( model, "timezone", - cell, "timezone"); + cell, "timezone", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( model, "use-24-hour-format", - cell, "use-24-hour-format"); + cell, "use-24-hour-format", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); popup_cell = e_cell_date_edit_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); g_object_unref (cell); - e_mutual_binding_new ( + g_object_bind_property ( model, "use-24-hour-format", - popup_cell, "use-24-hour-format"); + popup_cell, "use-24-hour-format", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); e_table_extras_add_cell (extras, "dateedit", popup_cell); task_table->dates_cell = E_CELL_DATE_EDIT (popup_cell); diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 7e5ca496f7..86d5774e46 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 75eac32f0b..e089866f38 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -44,7 +44,6 @@ #include #include #include -#include "e-util/e-binding.h" #include "e-util/e-util.h" #include "e-util/e-alert-dialog.h" #include "e-util/e-util-private.h" diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index d94201d129..1e78111da4 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -572,13 +571,15 @@ composer_header_table_constructor (GType type, priv->headers[ii]->input_widget, "right-attach", 2, NULL); - e_binding_new ( + g_object_bind_property ( priv->headers[ii]->input_widget, "visible", - priv->signature_label, "visible"); + priv->signature_label, "visible", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( priv->headers[ii]->input_widget, "visible", - priv->signature_combo_box, "visible"); + priv->signature_combo_box, "visible", + G_BINDING_SYNC_CREATE); /* Now add the signature stuff. */ if (!small_screen_mode) { @@ -1052,12 +1053,14 @@ e_composer_header_table_init (EComposerHeaderTable *table) * make the title_widget and input_widget members private. */ for (ii = 0; ii < E_COMPOSER_NUM_HEADERS; ii++) { header = table->priv->headers[ii]; - e_binding_new ( + g_object_bind_property ( header, "visible", - header->title_widget, "visible"); - e_binding_new ( + header->title_widget, "visible", + G_BINDING_SYNC_CREATE); + g_object_bind_property ( header, "visible", - header->input_widget, "visible"); + header->input_widget, "visible", + G_BINDING_SYNC_CREATE); } } diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c index d96832d887..99e83ae138 100644 --- a/composer/e-composer-private.c +++ b/composer/e-composer-private.c @@ -391,13 +391,17 @@ e_composer_private_constructed (EMsgComposer *composer) continue; } - e_mutual_binding_new ( + g_object_bind_property ( header, "sensitive", - action, "sensitive"); + action, "sensitive", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( header, "visible", - action, "active"); + action, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); } /* Install a handler for inline images. */ diff --git a/composer/e-composer-private.h b/composer/e-composer-private.h index 1e9130b196..b4818d4c57 100644 --- a/composer/e-composer-private.h +++ b/composer/e-composer-private.h @@ -37,7 +37,6 @@ #include "e-composer-activity.h" #include "e-composer-header-table.h" #include "e-util/e-alert-sink.h" -#include "e-util/e-binding.h" #include "e-util/e-charset.h" #include "e-util/e-extensible.h" #include "e-util/e-marshal.h" diff --git a/configure.ac b/configure.ac index a75e00444f..0cf6e8d103 100644 --- a/configure.ac +++ b/configure.ac @@ -35,7 +35,7 @@ dnl Automake 1.11 - Silent Build Rules m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) dnl Required Packages -m4_define([glib_minimum_version], [2.25.12]) +m4_define([glib_minimum_version], [2.26.0]) m4_define([eds_minimum_version], [evo_version]) m4_define([gtkhtml_minimum_version], [3.31.90]) m4_define([gnome_icon_theme_minimum_version], [2.30.2.1]) diff --git a/doc/reference/shell/eshell-docs.sgml b/doc/reference/shell/eshell-docs.sgml index 6101932139..eff7d8d278 100644 --- a/doc/reference/shell/eshell-docs.sgml +++ b/doc/reference/shell/eshell-docs.sgml @@ -30,7 +30,6 @@ - diff --git a/doc/reference/shell/eshell-sections.txt b/doc/reference/shell/eshell-sections.txt index 2f25154d7f..016493a7f4 100644 --- a/doc/reference/shell/eshell-sections.txt +++ b/doc/reference/shell/eshell-sections.txt @@ -799,27 +799,6 @@ e_attachment_view_get_type EAttachmentViewPrivate -
-e-binding -GObject Property Bindings -EBinding -EMutualBinding -EBindingTransform -e_binding_new -e_binding_new_full -e_binding_new_with_negation -e_binding_unbind -e_mutual_binding_new -e_mutual_binding_new_full -e_mutual_binding_new_with_negation -e_mutual_binding_unbind -e_binding_transform_color_to_string -e_binding_transform_string_to_color - -EBindingBase -EBindingLink -
-
e-bit-array Bit Arrays (Legacy) @@ -1204,6 +1183,8 @@ e_file_lock_destroy e_file_lock_exists e_util_guess_mime_type e_util_get_category_filter_options +e_binding_transform_color_to_string +e_binding_transform_string_to_color e_charset_add_radio_actions e_file_replace_contents_async e_file_replace_contents_finish diff --git a/doc/reference/shell/tmpl/e-util.sgml b/doc/reference/shell/tmpl/e-util.sgml index b07000df3f..01810abbc2 100644 --- a/doc/reference/shell/tmpl/e-util.sgml +++ b/doc/reference/shell/tmpl/e-util.sgml @@ -335,6 +335,30 @@ Miscellaneous Utilities @Returns: + + + + + +@binding: +@source_value: +@target_value: +@user_data: +@Returns: + + + + + + + +@binding: +@source_value: +@target_value: +@user_data: +@Returns: + + diff --git a/doc/reference/shell/tmpl/eshell-unused.sgml b/doc/reference/shell/tmpl/eshell-unused.sgml index 1488652840..3c0d257832 100644 --- a/doc/reference/shell/tmpl/eshell-unused.sgml +++ b/doc/reference/shell/tmpl/eshell-unused.sgml @@ -1,3 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +GObject Property Bindings + + @@ -82,6 +110,28 @@ e-shell-window.sgml.sgml e-shell-window.sgml + + + + + + + + + + + +@src_value: +@dst_value: +@user_data: +@Returns: + + + + + + + @@ -162,6 +212,49 @@ e-shell-window.sgml @activity: @allow_cancel: + + + + + +@src_object: +@src_property: +@dst_object: +@dst_property: +@Returns: + + + + + + +@src_object: +@src_property: +@dst_object: +@dst_property: +@transform: +@destroy_notify: +@user_data: +@Returns: + + + + + + +@src_object: +@src_property: +@dst_object: +@dst_property: +@Returns: + + + + + + +@binding: + @@ -170,6 +263,50 @@ e-shell-window.sgml @void: @Returns: + + + + + +@object1: +@property1: +@object2: +@property2: +@Returns: + + + + + + +@object1: +@property1: +@object2: +@property2: +@transform: +@reverse_transform: +@destroy_notify: +@user_data: +@Returns: + + + + + + +@object1: +@property1: +@object2: +@property2: +@Returns: + + + + + + +@binding: + diff --git a/e-util/Makefile.am b/e-util/Makefile.am index 4b08698896..619f88c27a 100644 --- a/e-util/Makefile.am +++ b/e-util/Makefile.am @@ -15,7 +15,6 @@ eutilinclude_HEADERS = \ e-alert-activity.h \ e-alert-dialog.h \ e-alert-sink.h \ - e-binding.h \ e-bit-array.h \ e-categories-config.h \ e-charset.h \ @@ -95,7 +94,6 @@ libeutil_la_SOURCES = \ e-alert-activity.c \ e-alert-dialog.c \ e-alert-sink.c \ - e-binding.c \ e-bit-array.c \ e-categories-config.c \ e-charset.c \ diff --git a/e-util/e-binding.c b/e-util/e-binding.c deleted file mode 100644 index 4b0f563a43..0000000000 --- a/e-util/e-binding.c +++ /dev/null @@ -1,557 +0,0 @@ -/* - * e-binding.c - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "e-binding.h" - -static gpointer -e_binding_warn (GObject *object, - const gchar *property_name) -{ - g_warning ( - "%s instances have no '%s' property to bind to", - G_OBJECT_TYPE_NAME (object), property_name); - - return NULL; -} - -static gboolean -e_binding_transform_negate (const GValue *src_value, - GValue *dst_value) -{ - if (!g_value_transform (src_value, dst_value)) - return FALSE; - - g_value_set_boolean (dst_value, !g_value_get_boolean (dst_value)); - - return TRUE; -} - -static void -e_bind_properties_transfer (GObject *src_object, - GParamSpec *src_pspec, - GObject *dst_object, - GParamSpec *dst_pspec, - EBindingTransform transform, - gpointer user_data) -{ - const gchar *src_name; - const gchar *dst_name; - gboolean result; - GValue src_value = { 0, }; - GValue dst_value = { 0, }; - - src_name = g_param_spec_get_name (src_pspec); - dst_name = g_param_spec_get_name (dst_pspec); - - g_value_init (&src_value, G_PARAM_SPEC_VALUE_TYPE (src_pspec)); - g_object_get_property (src_object, src_name, &src_value); - - g_value_init (&dst_value, G_PARAM_SPEC_VALUE_TYPE (dst_pspec)); - result = (*transform) (&src_value, &dst_value, user_data); - - g_value_unset (&src_value); - - g_return_if_fail (result); - - g_param_value_validate (dst_pspec, &dst_value); - g_object_set_property (dst_object, dst_name, &dst_value); - g_value_unset (&dst_value); -} - -static void -e_bind_properties_notify (GObject *src_object, - GParamSpec *src_pspec, - gpointer data) -{ - EBindingLink *link = data; - - /* Block the destination handler for mutual bindings, - * so we don't recurse here. */ - if (link->dst_handler != 0) - g_signal_handler_block (link->dst_object, link->dst_handler); - - e_bind_properties_transfer ( - src_object, src_pspec, - link->dst_object, link->dst_pspec, - link->transform, link->user_data); - - /* Unblock destination handler. */ - if (link->dst_handler != 0) - g_signal_handler_unblock (link->dst_object, link->dst_handler); -} - -static void -e_binding_on_dst_object_destroy (gpointer data, - GObject *object) -{ - EBinding *binding = data; - - binding->link.dst_object = NULL; - - /* Calls e_binding_on_disconnect() */ - g_signal_handler_disconnect ( - binding->src_object, binding->link.handler); -} - -static void -e_binding_on_disconnect (gpointer data, - GClosure *closure) -{ - EBindingLink *link = data; - EBinding *binding; - - binding = (EBinding *) - (((gchar *) link) - G_STRUCT_OFFSET (EBinding, link)); - - if (binding->base.destroy != NULL) - binding->base.destroy (link->user_data); - - if (link->dst_object != NULL) - g_object_weak_unref ( - link->dst_object, - e_binding_on_dst_object_destroy, binding); - - g_slice_free (EBinding, binding); -} - -/* Recursively calls e_mutual_binding_on_disconnect_object2() */ -static void -e_mutual_binding_on_disconnect_object1 (gpointer data, - GClosure *closure) -{ - EMutualBinding *binding; - EBindingLink *link = data; - GObject *object2; - - binding = (EMutualBinding *) - (((gchar *) link) - G_STRUCT_OFFSET (EMutualBinding, direct)); - binding->reverse.dst_object = NULL; - - object2 = binding->direct.dst_object; - if (object2 != NULL) { - if (binding->base.destroy != NULL) - binding->base.destroy (binding->direct.user_data); - binding->direct.dst_object = NULL; - g_signal_handler_disconnect (object2, binding->reverse.handler); - g_slice_free (EMutualBinding, binding); - } -} - -/* Recursively calls e_mutual_binding_on_disconnect_object1() */ -static void -e_mutual_binding_on_disconnect_object2 (gpointer data, - GClosure *closure) -{ - EMutualBinding *binding; - EBindingLink *link = data; - GObject *object1; - - binding = (EMutualBinding *) - (((gchar *) link) - G_STRUCT_OFFSET (EMutualBinding, reverse)); - binding->direct.dst_object = NULL; - - object1 = binding->reverse.dst_object; - if (object1 != NULL) { - binding->reverse.dst_object = NULL; - g_signal_handler_disconnect (object1, binding->direct.handler); - } -} - -static void -e_binding_link_init (EBindingLink *link, - GObject *src_object, - const gchar *src_property, - GObject *dst_object, - GParamSpec *dst_pspec, - EBindingTransform transform, - GClosureNotify destroy_notify, - gpointer user_data) -{ - gchar *signal_name; - - link->dst_object = dst_object; - link->dst_pspec = dst_pspec; - link->dst_handler = 0; - link->transform = transform; - link->user_data = user_data; - - signal_name = g_strconcat ("notify::", src_property, NULL); - link->handler = g_signal_connect_data ( - src_object, signal_name, - G_CALLBACK (e_bind_properties_notify), - link, destroy_notify, 0); - g_free (signal_name); -} - -/** - * e_binding_new: - * @src_object: The source #GObject. - * @src_property: The name of the property to bind from. - * @dst_object: The destination #GObject. - * @dst_property: The name of the property to bind to. - * - * One-way binds @src_property in @src_object to @dst_property - * in @dst_object. - * - * Before binding the value of @dst_property is set to the - * value of @src_property. - * - * Returns: The descriptor of the binding. It is automatically - * removed if one of the objects is finalized. - **/ -EBinding * -e_binding_new (gpointer src_object, - const gchar *src_property, - gpointer dst_object, - const gchar *dst_property) -{ - return e_binding_new_full ( - src_object, src_property, - dst_object, dst_property, - NULL, NULL, NULL); -} - -/** - * e_binding_new_full: - * @src_object: The source #GObject. - * @src_property: The name of the property to bind from. - * @dst_object: The destination #GObject. - * @dst_property: The name of the property to bind to. - * @transform: Transformation function or %NULL. - * @destroy_notify: Callback function that is called on - * disconnection with @user_data or %NULL. - * @user_data: User data associated with the binding. - * - * One-way binds @src_property in @src_object to @dst_property - * in @dst_object. - * - * Before binding the value of @dst_property is set to the - * value of @src_property. - * - * Returns: The descriptor of the binding. It is automatically - * removed if one of the objects is finalized. - **/ -EBinding * -e_binding_new_full (gpointer src_object, - const gchar *src_property, - gpointer dst_object, - const gchar *dst_property, - EBindingTransform transform, - GDestroyNotify destroy_notify, - gpointer user_data) -{ - EBinding *binding; - GParamSpec *src_pspec; - GParamSpec *dst_pspec; - - g_return_val_if_fail (G_IS_OBJECT (src_object), NULL); - g_return_val_if_fail (G_IS_OBJECT (dst_object), NULL); - - src_pspec = g_object_class_find_property ( - G_OBJECT_GET_CLASS (src_object), src_property); - dst_pspec = g_object_class_find_property ( - G_OBJECT_GET_CLASS (dst_object), dst_property); - - if (src_pspec == NULL) - return e_binding_warn (src_object, src_property); - if (dst_pspec == NULL) - return e_binding_warn (dst_object, dst_property); - - if (transform == NULL) - transform = (EBindingTransform) g_value_transform; - - e_bind_properties_transfer ( - src_object, src_pspec, - dst_object, dst_pspec, - transform, user_data); - - binding = g_slice_new (EBinding); - binding->src_object = src_object; - binding->base.destroy = destroy_notify; - - e_binding_link_init ( - &binding->link, src_object, src_property, dst_object, - dst_pspec, transform, e_binding_on_disconnect, user_data); - - g_object_weak_ref ( - dst_object, e_binding_on_dst_object_destroy, binding); - - return binding; -} - -/** - * e_binding_new_with_negation: - * @src_object: The source #GObject. - * @src_property: The name of the property to bind from. - * @dst_object: The destination #GObject. - * @dst_property: The name of the property to bind to. - * - * Convenience function for binding with boolean negation of value. - * - * Returns: The descriptor of the binding. It is automatically - * removed if one of the objects is finalized. - **/ -EBinding * -e_binding_new_with_negation (gpointer src_object, - const gchar *src_property, - gpointer dst_object, - const gchar *dst_property) -{ - EBindingTransform transform; - - transform = (EBindingTransform) e_binding_transform_negate; - - return e_binding_new_full ( - src_object, src_property, - dst_object, dst_property, - transform, NULL, NULL); -} - -/** - * e_binding_unbind: - * @binding: An #EBinding to unbind. - * - * Disconnects the binding between two properties. Should be - * rarely used by applications. - * - * This functions also calls the @destroy_notify function that - * was specified when @binding was created. - **/ -void -e_binding_unbind (EBinding *binding) -{ - g_signal_handler_disconnect ( - binding->src_object, binding->link.handler); -} - -/** - * e_mutual_binding_new: - * @object1 : The first #GObject. - * @property1: The first property to bind. - * @object2 : The second #GObject. - * @property2: The second property to bind. - * - * Mutually binds values of two properties. - * - * Before binding the value of @property2 is set to the value - * of @property1. - * - * Returns: The descriptor of the binding. It is automatically - * removed if one of the objects is finalized. - **/ -EMutualBinding * -e_mutual_binding_new (gpointer object1, - const gchar *property1, - gpointer object2, - const gchar *property2) -{ - return e_mutual_binding_new_full ( - object1, property1, - object2, property2, - NULL, NULL, NULL, NULL); -} - -/** - * e_mutual_binding_new_full: - * @object1: The first #GObject. - * @property1: The first property to bind. - * @object2: The second #GObject. - * @property2: The second property to bind. - * @transform: Transformation function or %NULL. - * @reverse_transform: The inverse transformation function or %NULL. - * @destroy_notify: Callback function called on disconnection with - * @user_data as argument or %NULL. - * @user_data: User data associated with the binding. - * - * Mutually binds values of two properties. - * - * Before binding the value of @property2 is set to the value of - * @property1. - * - * Both @transform and @reverse_transform should simultaneously be - * %NULL or non-%NULL. If they are non-%NULL, they should be reverse - * in each other. - * - * Returns: The descriptor of the binding. It is automatically - * removed if one of the objects is finalized. - **/ -EMutualBinding * -e_mutual_binding_new_full (gpointer object1, - const gchar *property1, - gpointer object2, - const gchar *property2, - EBindingTransform transform, - EBindingTransform reverse_transform, - GDestroyNotify destroy_notify, - gpointer user_data) -{ - EMutualBinding *binding; - GParamSpec *pspec1; - GParamSpec *pspec2; - - g_return_val_if_fail (G_IS_OBJECT (object1), NULL); - g_return_val_if_fail (G_IS_OBJECT (object2), NULL); - - pspec1 = g_object_class_find_property ( - G_OBJECT_GET_CLASS (object1), property1); - pspec2 = g_object_class_find_property ( - G_OBJECT_GET_CLASS (object2), property2); - - if (pspec1 == NULL) - return e_binding_warn (object1, property1); - if (pspec2 == NULL) - return e_binding_warn (object2, property2); - - if (transform == NULL) - transform = (EBindingTransform) g_value_transform; - - if (reverse_transform == NULL) - reverse_transform = (EBindingTransform) g_value_transform; - - e_bind_properties_transfer ( - object1, pspec1, object2, - pspec2, transform, user_data); - - binding = g_slice_new (EMutualBinding); - binding->base.destroy = destroy_notify; - - e_binding_link_init ( - &binding->direct, - object1, property1, object2, pspec2, transform, - e_mutual_binding_on_disconnect_object1, user_data); - - e_binding_link_init ( - &binding->reverse, - object2, property2, object1, pspec1, reverse_transform, - e_mutual_binding_on_disconnect_object2, user_data); - - /* Tell each link about the reverse link for mutual bindings, - * to make sure that we do not ever recurse in notify (yeah, - * the GObject notify dispatching is really weird!). */ - binding->direct.dst_handler = binding->reverse.handler; - binding->reverse.dst_handler = binding->direct.handler; - - return binding; -} - -/** - * e_mutual_binding_new_with_negation: - * @object1: The first #GObject. - * @property1: The first property to bind. - * @object2: The second #GObject. - * @property2: The second property to bind. - * - * Convenience function for binding with boolean negation of value. - * - * Returns: The descriptor of the binding. It is automatically removed - * if one of the objects if finalized. - **/ -EMutualBinding* -e_mutual_binding_new_with_negation (gpointer object1, - const gchar *property1, - gpointer object2, - const gchar *property2) -{ - EBindingTransform transform; - - transform = (EBindingTransform) e_binding_transform_negate; - - return e_mutual_binding_new_full ( - object1, property1, - object2, property2, - transform, transform, - NULL, NULL); -} - -/** - * e_mutual_binding_unbind: - * @binding: An #EMutualBinding to unbind. - * - * Disconnects the binding between two properties. Should be - * rarely used by applications. - * - * This functions also calls the @destroy_notify function that - * was specified when @binding was created. - **/ -void -e_mutual_binding_unbind (EMutualBinding *binding) -{ - g_signal_handler_disconnect ( - binding->reverse.dst_object, binding->direct.handler); -} - -/** - * e_binding_transform_color_to_string: - * @src_value: a #GValue of type #GDK_TYPE_COLOR - * @dst_value: a #GValue of type #G_TYPE_STRING - * @user_data: not used - * - * Transforms a #GdkColor value to a color string specification. - * - * Returns: %TRUE always - **/ -gboolean -e_binding_transform_color_to_string (const GValue *src_value, - GValue *dst_value, - gpointer user_data) -{ - const GdkColor *color; - gchar *string; - - color = g_value_get_boxed (src_value); - string = gdk_color_to_string (color); - g_value_set_string (dst_value, string); - g_free (string); - - return TRUE; -} - -/** - * e_binding_transform_string_to_color: - * @src_value: a #GValue of type #G_TYPE_STRING - * @dst_value: a #GValue of type #GDK_TYPE_COLOR - * @user_data: not used - * - * Transforms a color string specification to a #GdkColor. - * - * Returns: %TRUE if color string specification was valid - **/ -gboolean -e_binding_transform_string_to_color (const GValue *src_value, - GValue *dst_value, - gpointer user_data) -{ - GdkColor color; - const gchar *string; - gboolean success = FALSE; - - string = g_value_get_string (src_value); - if (gdk_color_parse (string, &color)) { - g_value_set_boxed (dst_value, &color); - success = TRUE; - } - - return success; -} diff --git a/e-util/e-binding.h b/e-util/e-binding.h deleted file mode 100644 index 180edc9f49..0000000000 --- a/e-util/e-binding.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * e-binding.h - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -/* This is a direct rip-off of Xfce's excellent ExoBinding API, - * which binds two GObject properties together. ExoBinding was - * written by Benedikt Meurer . */ - -#ifndef E_BINDING_H -#define E_BINDING_H - -#include - -G_BEGIN_DECLS - -typedef struct _EBinding EBinding; -typedef struct _EBindingBase EBindingBase; -typedef struct _EBindingLink EBindingLink; -typedef struct _EMutualBinding EMutualBinding; - -typedef gboolean (*EBindingTransform) (const GValue *src_value, - GValue *dst_value, - gpointer user_data); - -struct _EBindingBase { - GDestroyNotify destroy; -}; - -struct _EBindingLink { - GObject *dst_object; - GParamSpec *dst_pspec; - gulong dst_handler; /* only set for mutual bindings */ - gulong handler; - EBindingTransform transform; - gpointer user_data; -}; - -struct _EBinding { - /*< private >*/ - GObject *src_object; - EBindingBase base; - EBindingLink link; -}; - -struct _EMutualBinding { - /*< private >*/ - EBindingBase base; - EBindingLink direct; - EBindingLink reverse; -}; - -EBinding * e_binding_new (gpointer src_object, - const gchar *src_property, - gpointer dst_object, - const gchar *dst_property); -EBinding * e_binding_new_full (gpointer src_object, - const gchar *src_property, - gpointer dst_object, - const gchar *dst_property, - EBindingTransform transform, - GDestroyNotify destroy_notify, - gpointer user_data); -EBinding * e_binding_new_with_negation (gpointer src_object, - const gchar *src_property, - gpointer dst_object, - const gchar *dst_property); -void e_binding_unbind (EBinding *binding); - -EMutualBinding *e_mutual_binding_new (gpointer object1, - const gchar *property1, - gpointer object2, - const gchar *property2); -EMutualBinding *e_mutual_binding_new_full (gpointer object1, - const gchar *property1, - gpointer object2, - const gchar *property2, - EBindingTransform transform, - EBindingTransform reverse_transform, - GDestroyNotify destroy_notify, - gpointer user_data); -EMutualBinding *e_mutual_binding_new_with_negation - (gpointer object1, - const gchar *property1, - gpointer object2, - const gchar *property2); -void e_mutual_binding_unbind (EMutualBinding *binding); - -/* Useful transformation functions */ -gboolean e_binding_transform_color_to_string - (const GValue *src_value, - GValue *dst_value, - gpointer user_data); -gboolean e_binding_transform_string_to_color - (const GValue *src_value, - GValue *dst_value, - gpointer user_data); - -G_END_DECLS - -#endif /* E_BINDING_H */ diff --git a/e-util/e-config.c b/e-util/e-config.c index dd51f8efc7..6646fa17d9 100644 --- a/e-util/e-config.c +++ b/e-util/e-config.c @@ -31,7 +31,6 @@ #include #include "e-config.h" -#include "e-binding.h" #include @@ -1704,7 +1703,10 @@ ech_config_section_factory (EConfig *config, /* This is why we have a custom factory for sections. * When the plugin is disabled the frame is invisible. */ plugin = group->hook->hook.plugin; - e_binding_new (plugin, "enabled", widget, "visible"); + g_object_bind_property ( + plugin, "enabled", + widget, "visible", + G_BINDING_SYNC_CREATE); parent = widget; diff --git a/e-util/e-util.c b/e-util/e-util.c index 68662bd3d4..22f792c3a7 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -1494,3 +1494,64 @@ e_util_set_source_combo_box_list (GtkWidget *source_combo_box, g_object_unref (gconf_client); } +/** + * e_binding_transform_color_to_string: + * @binding: a #GBinding + * @source_value: a #GValue of type #GDK_TYPE_COLOR + * @target_value: a #GValue of type #G_TYPE_STRING + * @user_data: not used + * + * Transforms a #GdkColor value to a color string specification. + * + * Returns: %TRUE always + **/ +gboolean +e_binding_transform_color_to_string (GBinding *binding, + const GValue *source_value, + GValue *target_value, + gpointer user_data) +{ + const GdkColor *color; + gchar *string; + + g_return_val_if_fail (G_IS_BINDING (binding), FALSE); + + color = g_value_get_boxed (source_value); + string = gdk_color_to_string (color); + g_value_set_string (target_value, string); + g_free (string); + + return TRUE; +} + +/** + * e_binding_transform_string_to_color: + * @binding: a #GBinding + * @source_value: a #GValue of type #G_TYPE_STRING + * @target_value: a #GValue of type #GDK_TYPE_COLOR + * @user_data: not used + * + * Transforms a color string specification to a #GdkColor. + * + * Returns: %TRUE if color string specification was valid + **/ +gboolean +e_binding_transform_string_to_color (GBinding *binding, + const GValue *source_value, + GValue *target_value, + gpointer user_data) +{ + GdkColor color; + const gchar *string; + gboolean success = FALSE; + + g_return_val_if_fail (G_IS_BINDING (binding), FALSE); + + string = g_value_get_string (source_value); + if (gdk_color_parse (string, &color)) { + g_value_set_boxed (target_value, &color); + success = TRUE; + } + + return success; +} diff --git a/e-util/e-util.h b/e-util/e-util.h index 71fc12f431..9aa24f3d87 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -142,6 +142,18 @@ void e_util_set_source_combo_box_list (GtkWidget *source_combo_box, const gchar *source_gconf_path); +/* Useful GBinding transformation functions */ +gboolean e_binding_transform_color_to_string + (GBinding *binding, + const GValue *source_value, + GValue *target_value, + gpointer user_data); +gboolean e_binding_transform_string_to_color + (GBinding *binding, + const GValue *source_value, + GValue *target_value, + gpointer user_data); + G_END_DECLS #endif /* E_UTIL_H */ diff --git a/mail/e-mail-attachment-bar.c b/mail/e-mail-attachment-bar.c index c5ce9cf7bf..0de674149b 100644 --- a/mail/e-mail-attachment-bar.c +++ b/mail/e-mail-attachment-bar.c @@ -23,7 +23,6 @@ #include -#include "e-util/e-binding.h" #include "e-util/gconf-bridge.h" #include "e-attachment-store.h" @@ -266,37 +265,53 @@ mail_attachment_bar_constructed (GObject *object) /* Set up property-to-property bindings. */ - e_mutual_binding_new ( + g_object_bind_property ( object, "active-view", - priv->combo_box, "active"); + priv->combo_box, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "dragging", - priv->icon_view, "dragging"); + priv->icon_view, "dragging", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "dragging", - priv->tree_view, "dragging"); + priv->tree_view, "dragging", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "editable", - priv->icon_view, "editable"); + priv->icon_view, "editable", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "editable", - priv->tree_view, "editable"); + priv->tree_view, "editable", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "expanded", - priv->expander, "expanded"); + priv->expander, "expanded", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "expanded", - priv->combo_box, "visible"); + priv->combo_box, "visible", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "expanded", - priv->vbox, "visible"); + priv->vbox, "visible", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* Set up property-to-GConf bindings. */ diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c index c9c668d101..dd34737272 100644 --- a/mail/e-mail-backend.c +++ b/mail/e-mail-backend.c @@ -29,7 +29,6 @@ #include "e-util/e-account-utils.h" #include "e-util/e-alert-dialog.h" -#include "e-util/e-binding.h" #include "misc/e-account-combo-box.h" @@ -465,7 +464,10 @@ mail_backend_constructed (GObject *object) priv->session = e_mail_session_new (); - e_binding_new (shell, "online", priv->session, "online"); + g_object_bind_property ( + shell, "online", + priv->session, "online", + G_BINDING_SYNC_CREATE); /* FIXME This is an evil hack that needs to die. * Give EAccountComboBox a CamelSession property. */ diff --git a/mail/e-mail-label-action.c b/mail/e-mail-label-action.c index 315ee10e26..b7487fc047 100644 --- a/mail/e-mail-label-action.c +++ b/mail/e-mail-label-action.c @@ -21,8 +21,6 @@ #include "e-mail-label-action.h" -#include "e-util/e-binding.h" - #define E_MAIL_LABEL_ACTION_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_MAIL_LABEL_ACTION, EMailLabelActionPrivate)) @@ -62,22 +60,21 @@ mail_label_action_menu_item_realize_cb (GtkWidget *menu_item) container = widget; - /*stock_id = gtk_action_get_stock_id (action); - widget = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);*/ widget = gtk_action_create_icon (action, GTK_ICON_SIZE_MENU); gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - /* XXX GtkImage calls it "stock", not "stock-id". */ - /*e_mutual_binding_new (action, "stock-id", widget, "stock");*/ - widget = gtk_label_new (NULL); gtk_label_set_use_underline (GTK_LABEL (widget), TRUE); gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); gtk_widget_show (widget); - e_mutual_binding_new (action, "label", widget, "label"); + g_object_bind_property ( + action, "label", + widget, "label", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); } static GtkWidget * diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index 9782a8de6a..236c7cb782 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -31,7 +31,6 @@ #include #include "e-util/e-util-private.h" -#include "e-util/e-binding.h" #include "e-util/gconf-bridge.h" #include "widgets/menus/gal-view-etable.h" #include "widgets/menus/gal-view-instance.h" @@ -568,7 +567,10 @@ mail_paned_view_constructed (GObject *object) priv->paned = g_object_ref (widget); gtk_widget_show (widget); - e_binding_new (object, "orientation", widget, "orientation"); + g_object_bind_property ( + object, "orientation", + widget, "orientation", + G_BINDING_SYNC_CREATE); container = priv->paned; @@ -598,7 +600,10 @@ mail_paned_view_constructed (GObject *object) gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, FALSE); gtk_widget_show (widget); - e_binding_new (object, "preview-visible", widget, "visible"); + g_object_bind_property ( + object, "preview-visible", + widget, "visible", + G_BINDING_SYNC_CREATE); search_bar = e_preview_pane_get_search_bar (E_PREVIEW_PANE (widget)); priv->search_bar = g_object_ref (search_bar); diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 184cc757df..83dc3f569a 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -29,7 +29,6 @@ #endif #include "e-util/e-account-utils.h" -#include "e-util/e-binding.h" #include "e-util/e-charset.h" #include "e-util/e-util.h" #include "e-util/e-alert-dialog.h" @@ -3317,9 +3316,11 @@ e_mail_reader_init (EMailReader *reader, action_name = "mail-caret-mode"; action = e_mail_reader_get_action (reader, action_name); - e_mutual_binding_new ( + g_object_bind_property ( action, "active", - web_view, "caret-mode"); + web_view, "caret-mode", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); connect_signals: diff --git a/mail/e-mail-tag-editor.c b/mail/e-mail-tag-editor.c index 004cba7049..ab7fdd22c4 100644 --- a/mail/e-mail-tag-editor.c +++ b/mail/e-mail-tag-editor.c @@ -31,7 +31,6 @@ #include #include "e-util/e-util.h" -#include "e-util/e-binding.h" #include "widgets/misc/e-dateedit.h" #define E_MAIL_TAG_EDITOR_GET_PRIVATE(obj) \ @@ -309,7 +308,10 @@ mail_tag_editor_init (EMailTagEditor *editor) gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 6); widget = e_builder_get_widget (builder, "pixmap"); - e_binding_new (window, "icon-name", widget, "icon-name"); + g_object_bind_property ( + window, "icon-name", + widget, "icon-name", + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (builder, "message_list"); editor->priv->message_list = GTK_TREE_VIEW (widget); @@ -335,15 +337,21 @@ mail_tag_editor_init (EMailTagEditor *editor) widget = e_builder_get_widget (builder, "target_date"); editor->priv->target_date = E_DATE_EDIT (widget); - e_binding_new ( + g_object_bind_property ( editor, "use-24-hour-format", - widget, "use-24-hour-format"); - e_binding_new ( + widget, "use-24-hour-format", + G_BINDING_SYNC_CREATE); + g_object_bind_property ( editor, "week-start-day", - widget, "week-start-day"); + widget, "week-start-day", + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (builder, "completed"); - e_mutual_binding_new (editor, "completed", widget, "active"); + g_object_bind_property ( + editor, "completed", + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (builder, "clear"); g_signal_connect_swapped ( diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c index c0e9ad9537..525a7ffefa 100644 --- a/mail/em-folder-properties.c +++ b/mail/em-folder-properties.c @@ -31,8 +31,6 @@ #include -#include - #include "em-folder-properties.h" #include "em-config.h" @@ -172,10 +170,12 @@ emfp_get_folder_item (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidg switch (properties[ii]->value_type) { case G_TYPE_BOOLEAN: widget = gtk_check_button_new_with_label (blurb); - e_mutual_binding_new ( + g_object_bind_property ( prop_data->object, properties[ii]->name, - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); gtk_widget_show (widget); gtk_table_attach ( GTK_TABLE (table), widget, diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c index 321d245477..6a4112db42 100644 --- a/mail/em-subscription-editor.c +++ b/mail/em-subscription-editor.c @@ -27,7 +27,6 @@ #include "mail-mt.h" #include -#include #include #include #include @@ -1222,9 +1221,11 @@ em_subscription_editor_init (EMSubscriptionEditor *editor) editor->priv->notebook = widget; gtk_widget_show (widget); - e_mutual_binding_new ( + g_object_bind_property ( editor->priv->combo_box, "active", - editor->priv->notebook, "page"); + editor->priv->notebook, "page", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = gtk_vbutton_box_new (); gtk_box_set_spacing (GTK_BOX (widget), 6); diff --git a/mail/em-utils.c b/mail/em-utils.c index ab85007787..9f1f82ec50 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -61,7 +61,6 @@ #include #include "e-util/e-util.h" #include "e-util/e-util-private.h" -#include "e-util/e-binding.h" #include "e-util/e-mktemp.h" #include "e-util/e-account-utils.h" #include "e-util/e-dialog-utils.h" @@ -394,12 +393,14 @@ em_utils_flag_for_followup (EMailReader *reader, shell_settings = e_shell_get_shell_settings (shell); /* These settings come from the calendar module. */ - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-use-24-hour-format", - editor, "use-24-hour-format"); - e_binding_new ( + editor, "use-24-hour-format", + G_BINDING_SYNC_CREATE); + g_object_bind_property ( shell_settings, "cal-week-start-day", - editor, "week-start-day"); + editor, "week-start-day", + G_BINDING_SYNC_CREATE); for (i = 0; i < uids->len; i++) { CamelMessageInfo *info; diff --git a/modules/addressbook/autocompletion-config.c b/modules/addressbook/autocompletion-config.c index c7ee192962..05b2b980d3 100644 --- a/modules/addressbook/autocompletion-config.c +++ b/modules/addressbook/autocompletion-config.c @@ -30,7 +30,6 @@ #include #include -#include "e-util/e-binding.h" #include "e-util/e-datetime-format.h" static void @@ -166,9 +165,11 @@ autocompletion_config_new (EPreferencesWindow *window) widget = gtk_check_button_new_with_mnemonic ( _("Always _show address of the autocompleted contact")); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "book-completion-show-address", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); gtk_box_pack_start (GTK_BOX (itembox), widget, FALSE, FALSE, 0); gtk_widget_show (widget); diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c index 13b9b4bd49..1d510fb3b7 100644 --- a/modules/addressbook/e-book-shell-content.c +++ b/modules/addressbook/e-book-shell-content.c @@ -23,7 +23,6 @@ #include -#include "e-util/e-binding.h" #include "e-util/e-selection.h" #include "e-util/gconf-bridge.h" #include "shell/e-shell-utils.h" @@ -245,7 +244,10 @@ book_shell_content_constructed (GObject *object) priv->paned = g_object_ref (widget); gtk_widget_show (widget); - e_binding_new (object, "orientation", widget, "orientation"); + g_object_bind_property ( + object, "orientation", + widget, "orientation", + G_BINDING_SYNC_CREATE); container = widget; @@ -277,7 +279,10 @@ book_shell_content_constructed (GObject *object) priv->preview_pane = g_object_ref (widget); gtk_widget_show (widget); - e_binding_new (object, "preview-visible", widget, "visible"); + g_object_bind_property ( + object, "preview-visible", + widget, "visible", + G_BINDING_SYNC_CREATE); /* Restore pane positions from the last session once * the shell view is fully initialized and visible. */ diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 9008002c33..9c13e599a7 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -1073,13 +1073,15 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) ACTION (GAL_SAVE_CUSTOM_VIEW), "activate", G_CALLBACK (action_gal_save_custom_view_cb), book_shell_view); - e_binding_new ( + g_object_bind_property ( ACTION (CONTACT_PREVIEW), "active", - ACTION (CONTACT_VIEW_CLASSIC), "sensitive"); + ACTION (CONTACT_VIEW_CLASSIC), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (CONTACT_PREVIEW), "active", - ACTION (CONTACT_VIEW_VERTICAL), "sensitive"); + ACTION (CONTACT_VIEW_VERTICAL), "sensitive", + G_BINDING_SYNC_CREATE); e_web_view_set_open_proxy (web_view, ACTION (CONTACT_OPEN)); e_web_view_set_print_proxy (web_view, ACTION (CONTACT_PRINT)); diff --git a/modules/addressbook/e-book-shell-view-private.h b/modules/addressbook/e-book-shell-view-private.h index 28ccae1359..b0b9592210 100644 --- a/modules/addressbook/e-book-shell-view-private.h +++ b/modules/addressbook/e-book-shell-view-private.h @@ -34,7 +34,6 @@ #include #include "e-util/e-util.h" -#include "e-util/e-binding.h" #include "e-util/e-file-utils.h" #include "e-util/gconf-bridge.h" #include "shell/e-shell-content.h" diff --git a/modules/calendar/e-cal-config-calendar-item.c b/modules/calendar/e-cal-config-calendar-item.c index 5c585f94ca..45d1797714 100644 --- a/modules/calendar/e-cal-config-calendar-item.c +++ b/modules/calendar/e-cal-config-calendar-item.c @@ -19,7 +19,6 @@ #include "e-cal-config-calendar-item.h" #include -#include #include #include @@ -37,13 +36,15 @@ cal_config_calendar_item_constructed (GObject *object) shell = e_shell_get_default (); shell_settings = e_shell_get_shell_settings (shell); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-show-week-numbers", - extensible, "show-week-numbers"); + extensible, "show-week-numbers", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-week-start-day", - extensible, "week-start-day"); + extensible, "week-start-day", + G_BINDING_SYNC_CREATE); } static void diff --git a/modules/calendar/e-cal-config-date-edit.c b/modules/calendar/e-cal-config-date-edit.c index 667e749dff..594dee7f94 100644 --- a/modules/calendar/e-cal-config-date-edit.c +++ b/modules/calendar/e-cal-config-date-edit.c @@ -19,7 +19,6 @@ #include "e-cal-config-date-edit.h" #include -#include #include #include @@ -37,13 +36,15 @@ cal_config_date_edit_constructed (GObject *object) shell = e_shell_get_default (); shell_settings = e_shell_get_shell_settings (shell); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-show-week-numbers", - extensible, "show-week-numbers"); + extensible, "show-week-numbers", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-week-start-day", - extensible, "week-start-day"); + extensible, "week-start-day", + G_BINDING_SYNC_CREATE); } static void diff --git a/modules/calendar/e-cal-config-meeting-store.c b/modules/calendar/e-cal-config-meeting-store.c index 7169ac4029..72f103bbec 100644 --- a/modules/calendar/e-cal-config-meeting-store.c +++ b/modules/calendar/e-cal-config-meeting-store.c @@ -19,7 +19,6 @@ #include "e-cal-config-meeting-store.h" #include -#include #include #include @@ -37,13 +36,15 @@ cal_config_meeting_store_constructed (GObject *object) shell = e_shell_get_default (); shell_settings = e_shell_get_shell_settings (shell); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-free-busy-template", - extensible, "free-busy-template"); + extensible, "free-busy-template", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-timezone", - extensible, "timezone"); + extensible, "timezone", + G_BINDING_SYNC_CREATE); } static void diff --git a/modules/calendar/e-cal-config-meeting-time-selector.c b/modules/calendar/e-cal-config-meeting-time-selector.c index 1c45d3b9ef..c4ae93e0ae 100644 --- a/modules/calendar/e-cal-config-meeting-time-selector.c +++ b/modules/calendar/e-cal-config-meeting-time-selector.c @@ -19,7 +19,6 @@ #include "e-cal-config-meeting-time-selector.h" #include -#include #include #include @@ -37,17 +36,20 @@ cal_config_meeting_time_selector_constructed (GObject *object) shell = e_shell_get_default (); shell_settings = e_shell_get_shell_settings (shell); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-show-week-numbers", - extensible, "show-week-numbers"); + extensible, "show-week-numbers", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-use-24-hour-format", - extensible, "use-24-hour-format"); + extensible, "use-24-hour-format", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-week-start-day", - extensible, "week-start-day"); + extensible, "week-start-day", + G_BINDING_SYNC_CREATE); } static void diff --git a/modules/calendar/e-cal-config-model.c b/modules/calendar/e-cal-config-model.c index d176d509e9..62ff9b57b6 100644 --- a/modules/calendar/e-cal-config-model.c +++ b/modules/calendar/e-cal-config-model.c @@ -19,7 +19,6 @@ #include "e-cal-config-model.h" #include -#include #include #include #include @@ -40,29 +39,34 @@ cal_config_model_constructed (GObject *object) /*** ECalModel ***/ - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-timezone", - extensible, "timezone"); + extensible, "timezone", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-use-24-hour-format", - extensible, "use-24-hour-format"); + extensible, "use-24-hour-format", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-week-start-day", - extensible, "week-start-day"); + extensible, "week-start-day", + G_BINDING_SYNC_CREATE); /*** ECalModelTasks ***/ if (E_IS_CAL_MODEL_TASKS (extensible)) { - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-tasks-color-due-today", - extensible, "color-due-today"); + extensible, "color-due-today", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-tasks-color-overdue", - extensible, "color-overdue"); + extensible, "color-overdue", + G_BINDING_SYNC_CREATE); } } diff --git a/modules/calendar/e-cal-config-view.c b/modules/calendar/e-cal-config-view.c index e543bf6c56..c1630223eb 100644 --- a/modules/calendar/e-cal-config-view.c +++ b/modules/calendar/e-cal-config-view.c @@ -19,7 +19,6 @@ #include "e-cal-config-view.h" #include -#include #include #include #include @@ -42,58 +41,70 @@ cal_config_view_constructed (GObject *object) if (E_IS_DAY_VIEW (extensible)) { - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-show-week-numbers", - E_DAY_VIEW (extensible)->week_number_label, "visible"); + E_DAY_VIEW (extensible)->week_number_label, "visible", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-marcus-bains-show-line", - extensible, "marcus-bains-show-line"); + extensible, "marcus-bains-show-line", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-marcus-bains-day-view-color", - extensible, "marcus-bains-day-view-color"); + extensible, "marcus-bains-day-view-color", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-marcus-bains-time-bar-color", - extensible, "marcus-bains-time-bar-color"); + extensible, "marcus-bains-time-bar-color", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-time-divisions", - extensible, "mins-per-row"); + extensible, "mins-per-row", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-work-day-end-hour", - extensible, "work-day-end-hour"); + extensible, "work-day-end-hour", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-work-day-end-minute", - extensible, "work-day-end-minute"); + extensible, "work-day-end-minute", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-work-day-start-hour", - extensible, "work-day-start-hour"); + extensible, "work-day-start-hour", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-work-day-start-minute", - extensible, "work-day-start-minute"); + extensible, "work-day-start-minute", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-working-days-bitset", - extensible, "working-days"); + extensible, "working-days", + G_BINDING_SYNC_CREATE); } /*** EWeekView ***/ if (E_IS_WEEK_VIEW (extensible)) { - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-compress-weekend", - extensible, "compress-weekend"); + extensible, "compress-weekend", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-show-event-end-times", - extensible, "show-event-end-times"); + extensible, "show-event-end-times", + G_BINDING_SYNC_CREATE); } } diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index 737c387a6f..e7a082bc05 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -24,7 +24,6 @@ #include #include -#include "e-util/e-binding.h" #include "e-util/gconf-bridge.h" #include "widgets/menus/gal-view-etable.h" #include "widgets/misc/e-paned.h" @@ -413,9 +412,10 @@ cal_shell_content_constructed (GObject *object) gtk_widget_show (GTK_WIDGET (calendar_view)); } - e_binding_new ( + g_object_bind_property ( priv->calendar, "view", - priv->notebook, "page"); + priv->notebook, "page", + G_BINDING_SYNC_CREATE); container = priv->vpaned; diff --git a/modules/calendar/e-cal-shell-settings.c b/modules/calendar/e-cal-shell-settings.c index 4613f280bb..0ab35ebfee 100644 --- a/modules/calendar/e-cal-shell-settings.c +++ b/modules/calendar/e-cal-shell-settings.c @@ -24,11 +24,10 @@ #include #include -#include "e-util/e-binding.h" - static gboolean -transform_string_to_icaltimezone (const GValue *src_value, - GValue *dst_value, +transform_string_to_icaltimezone (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { EShellSettings *shell_settings; @@ -44,7 +43,7 @@ transform_string_to_icaltimezone (const GValue *src_value, if (use_system_timezone) timezone = e_cal_util_get_system_timezone (); else - location = g_value_get_string (src_value); + location = g_value_get_string (source_value); if (location != NULL && *location != '\0') timezone = icaltimezone_get_builtin_timezone (location); @@ -52,20 +51,21 @@ transform_string_to_icaltimezone (const GValue *src_value, if (timezone == NULL) timezone = icaltimezone_get_utc_timezone (); - g_value_set_pointer (dst_value, timezone); + g_value_set_pointer (target_value, timezone); return TRUE; } static gboolean -transform_icaltimezone_to_string (const GValue *src_value, - GValue *dst_value, +transform_icaltimezone_to_string (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { const gchar *location = NULL; icaltimezone *timezone; - timezone = g_value_get_pointer (src_value); + timezone = g_value_get_pointer (source_value); if (timezone != NULL) location = icaltimezone_get_location (timezone); @@ -73,14 +73,15 @@ transform_icaltimezone_to_string (const GValue *src_value, if (location == NULL) location = "UTC"; - g_value_set_string (dst_value, location); + g_value_set_string (target_value, location); return TRUE; } static gboolean -transform_weekdays_gconf_to_evolution (const GValue *src_value, - GValue *dst_value, +transform_weekdays_gconf_to_evolution (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { GDateWeekday weekday; @@ -94,7 +95,7 @@ transform_weekdays_gconf_to_evolution (const GValue *src_value, /* This is purposefully verbose for better readability. */ /* GConf numbering */ - switch (g_value_get_int (src_value)) { + switch (g_value_get_int (source_value)) { case 0: weekday = G_DATE_SUNDAY; break; @@ -123,25 +124,25 @@ transform_weekdays_gconf_to_evolution (const GValue *src_value, /* Evolution numbering */ switch (weekday) { case G_DATE_MONDAY: - g_value_set_int (dst_value, 0); + g_value_set_int (target_value, 0); break; case G_DATE_TUESDAY: - g_value_set_int (dst_value, 1); + g_value_set_int (target_value, 1); break; case G_DATE_WEDNESDAY: - g_value_set_int (dst_value, 2); + g_value_set_int (target_value, 2); break; case G_DATE_THURSDAY: - g_value_set_int (dst_value, 3); + g_value_set_int (target_value, 3); break; case G_DATE_FRIDAY: - g_value_set_int (dst_value, 4); + g_value_set_int (target_value, 4); break; case G_DATE_SATURDAY: - g_value_set_int (dst_value, 5); + g_value_set_int (target_value, 5); break; case G_DATE_SUNDAY: - g_value_set_int (dst_value, 6); + g_value_set_int (target_value, 6); break; default: return FALSE; @@ -151,8 +152,9 @@ transform_weekdays_gconf_to_evolution (const GValue *src_value, } static gboolean -transform_weekdays_evolution_to_gconf (const GValue *src_value, - GValue *dst_value, +transform_weekdays_evolution_to_gconf (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { GDateWeekday weekday; @@ -166,7 +168,7 @@ transform_weekdays_evolution_to_gconf (const GValue *src_value, /* This is purposefully verbose for better readability. */ /* GConf numbering */ - switch (g_value_get_int (src_value)) { + switch (g_value_get_int (source_value)) { case 0: weekday = G_DATE_MONDAY; break; @@ -195,25 +197,25 @@ transform_weekdays_evolution_to_gconf (const GValue *src_value, /* Evolution numbering */ switch (weekday) { case G_DATE_MONDAY: - g_value_set_int (dst_value, 1); + g_value_set_int (target_value, 1); break; case G_DATE_TUESDAY: - g_value_set_int (dst_value, 2); + g_value_set_int (target_value, 2); break; case G_DATE_WEDNESDAY: - g_value_set_int (dst_value, 3); + g_value_set_int (target_value, 3); break; case G_DATE_THURSDAY: - g_value_set_int (dst_value, 4); + g_value_set_int (target_value, 4); break; case G_DATE_FRIDAY: - g_value_set_int (dst_value, 5); + g_value_set_int (target_value, 5); break; case G_DATE_SATURDAY: - g_value_set_int (dst_value, 6); + g_value_set_int (target_value, 6); break; case G_DATE_SUNDAY: - g_value_set_int (dst_value, 0); + g_value_set_int (target_value, 0); break; default: return FALSE; @@ -234,23 +236,25 @@ enum { }; static gboolean -transform_working_days_bitset_to_sunday (const GValue *src_value, - GValue *dst_value, +transform_working_days_bitset_to_sunday (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { gint bitset; gboolean working_day; - bitset = g_value_get_int (src_value); + bitset = g_value_get_int (source_value); working_day = ((bitset & WORKING_DAY_SUNDAY) != 0); - g_value_set_boolean (dst_value, working_day); + g_value_set_boolean (target_value, working_day); return TRUE; } static gboolean -transform_working_days_sunday_to_bitset (const GValue *src_value, - GValue *dst_value, +transform_working_days_sunday_to_bitset (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { EShellSettings *shell_settings; @@ -261,30 +265,32 @@ transform_working_days_sunday_to_bitset (const GValue *src_value, bitset = e_shell_settings_get_int ( shell_settings, "cal-working-days-bitset"); - bit = g_value_get_boolean (src_value) ? WORKING_DAY_SUNDAY : 0; - g_value_set_int (dst_value, (bitset & ~WORKING_DAY_SUNDAY) | bit); + bit = g_value_get_boolean (source_value) ? WORKING_DAY_SUNDAY : 0; + g_value_set_int (target_value, (bitset & ~WORKING_DAY_SUNDAY) | bit); return TRUE; } static gboolean -transform_working_days_bitset_to_monday (const GValue *src_value, - GValue *dst_value, +transform_working_days_bitset_to_monday (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { gint bitset; gboolean working_day; - bitset = g_value_get_int (src_value); + bitset = g_value_get_int (source_value); working_day = ((bitset & WORKING_DAY_MONDAY) != 0); - g_value_set_boolean (dst_value, working_day); + g_value_set_boolean (target_value, working_day); return TRUE; } static gboolean -transform_working_days_monday_to_bitset (const GValue *src_value, - GValue *dst_value, +transform_working_days_monday_to_bitset (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { EShellSettings *shell_settings; @@ -295,30 +301,32 @@ transform_working_days_monday_to_bitset (const GValue *src_value, bitset = e_shell_settings_get_int ( shell_settings, "cal-working-days-bitset"); - bit = g_value_get_boolean (src_value) ? WORKING_DAY_MONDAY : 0; - g_value_set_int (dst_value, (bitset & ~WORKING_DAY_MONDAY) | bit); + bit = g_value_get_boolean (source_value) ? WORKING_DAY_MONDAY : 0; + g_value_set_int (target_value, (bitset & ~WORKING_DAY_MONDAY) | bit); return TRUE; } static gboolean -transform_working_days_bitset_to_tuesday (const GValue *src_value, - GValue *dst_value, +transform_working_days_bitset_to_tuesday (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { gint bitset; gboolean working_day; - bitset = g_value_get_int (src_value); + bitset = g_value_get_int (source_value); working_day = ((bitset & WORKING_DAY_TUESDAY) != 0); - g_value_set_boolean (dst_value, working_day); + g_value_set_boolean (target_value, working_day); return TRUE; } static gboolean -transform_working_days_tuesday_to_bitset (const GValue *src_value, - GValue *dst_value, +transform_working_days_tuesday_to_bitset (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { EShellSettings *shell_settings; @@ -329,30 +337,32 @@ transform_working_days_tuesday_to_bitset (const GValue *src_value, bitset = e_shell_settings_get_int ( shell_settings, "cal-working-days-bitset"); - bit = g_value_get_boolean (src_value) ? WORKING_DAY_TUESDAY : 0; - g_value_set_int (dst_value, (bitset & ~WORKING_DAY_TUESDAY) | bit); + bit = g_value_get_boolean (source_value) ? WORKING_DAY_TUESDAY : 0; + g_value_set_int (target_value, (bitset & ~WORKING_DAY_TUESDAY) | bit); return TRUE; } static gboolean -transform_working_days_bitset_to_wednesday (const GValue *src_value, - GValue *dst_value, +transform_working_days_bitset_to_wednesday (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { gint bitset; gboolean working_day; - bitset = g_value_get_int (src_value); + bitset = g_value_get_int (source_value); working_day = ((bitset & WORKING_DAY_WEDNESDAY) != 0); - g_value_set_boolean (dst_value, working_day); + g_value_set_boolean (target_value, working_day); return TRUE; } static gboolean -transform_working_days_wednesday_to_bitset (const GValue *src_value, - GValue *dst_value, +transform_working_days_wednesday_to_bitset (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { EShellSettings *shell_settings; @@ -363,30 +373,32 @@ transform_working_days_wednesday_to_bitset (const GValue *src_value, bitset = e_shell_settings_get_int ( shell_settings, "cal-working-days-bitset"); - bit = g_value_get_boolean (src_value) ? WORKING_DAY_WEDNESDAY : 0; - g_value_set_int (dst_value, (bitset & ~WORKING_DAY_WEDNESDAY) | bit); + bit = g_value_get_boolean (source_value) ? WORKING_DAY_WEDNESDAY : 0; + g_value_set_int (target_value, (bitset & ~WORKING_DAY_WEDNESDAY) | bit); return TRUE; } static gboolean -transform_working_days_bitset_to_thursday (const GValue *src_value, - GValue *dst_value, +transform_working_days_bitset_to_thursday (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { gint bitset; gboolean working_day; - bitset = g_value_get_int (src_value); + bitset = g_value_get_int (source_value); working_day = ((bitset & WORKING_DAY_THURSDAY) != 0); - g_value_set_boolean (dst_value, working_day); + g_value_set_boolean (target_value, working_day); return TRUE; } static gboolean -transform_working_days_thursday_to_bitset (const GValue *src_value, - GValue *dst_value, +transform_working_days_thursday_to_bitset (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { EShellSettings *shell_settings; @@ -397,30 +409,32 @@ transform_working_days_thursday_to_bitset (const GValue *src_value, bitset = e_shell_settings_get_int ( shell_settings, "cal-working-days-bitset"); - bit = g_value_get_boolean (src_value) ? WORKING_DAY_THURSDAY : 0; - g_value_set_int (dst_value, (bitset & ~WORKING_DAY_THURSDAY) | bit); + bit = g_value_get_boolean (source_value) ? WORKING_DAY_THURSDAY : 0; + g_value_set_int (target_value, (bitset & ~WORKING_DAY_THURSDAY) | bit); return TRUE; } static gboolean -transform_working_days_bitset_to_friday (const GValue *src_value, - GValue *dst_value, +transform_working_days_bitset_to_friday (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { gint bitset; gboolean working_day; - bitset = g_value_get_int (src_value); + bitset = g_value_get_int (source_value); working_day = ((bitset & WORKING_DAY_FRIDAY) != 0); - g_value_set_boolean (dst_value, working_day); + g_value_set_boolean (target_value, working_day); return TRUE; } static gboolean -transform_working_days_friday_to_bitset (const GValue *src_value, - GValue *dst_value, +transform_working_days_friday_to_bitset (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { EShellSettings *shell_settings; @@ -431,30 +445,32 @@ transform_working_days_friday_to_bitset (const GValue *src_value, bitset = e_shell_settings_get_int ( shell_settings, "cal-working-days-bitset"); - bit = g_value_get_boolean (src_value) ? WORKING_DAY_FRIDAY : 0; - g_value_set_int (dst_value, (bitset & ~WORKING_DAY_FRIDAY) | bit); + bit = g_value_get_boolean (source_value) ? WORKING_DAY_FRIDAY : 0; + g_value_set_int (target_value, (bitset & ~WORKING_DAY_FRIDAY) | bit); return TRUE; } static gboolean -transform_working_days_bitset_to_saturday (const GValue *src_value, - GValue *dst_value, +transform_working_days_bitset_to_saturday (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { gint bitset; gboolean working_day; - bitset = g_value_get_int (src_value); + bitset = g_value_get_int (source_value); working_day = ((bitset & WORKING_DAY_SATURDAY) != 0); - g_value_set_boolean (dst_value, working_day); + g_value_set_boolean (target_value, working_day); return TRUE; } static gboolean -transform_working_days_saturday_to_bitset (const GValue *src_value, - GValue *dst_value, +transform_working_days_saturday_to_bitset (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { EShellSettings *shell_settings; @@ -465,8 +481,8 @@ transform_working_days_saturday_to_bitset (const GValue *src_value, bitset = e_shell_settings_get_int ( shell_settings, "cal-working-days-bitset"); - bit = g_value_get_boolean (src_value) ? WORKING_DAY_SATURDAY : 0; - g_value_set_int (dst_value, (bitset & ~WORKING_DAY_SATURDAY) | bit); + bit = g_value_get_boolean (source_value) ? WORKING_DAY_SATURDAY : 0; + g_value_set_int (target_value, (bitset & ~WORKING_DAY_SATURDAY) | bit); return TRUE; } @@ -602,13 +618,15 @@ e_cal_shell_backend_init_settings (EShell *shell) NULL, G_PARAM_READWRITE)); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "cal-timezone-string", shell_settings, "cal-timezone", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, transform_string_to_icaltimezone, transform_icaltimezone_to_string, - (GDestroyNotify) g_object_unref, - g_object_ref (shell_settings)); + g_object_ref (shell_settings), + (GDestroyNotify) g_object_unref); e_shell_settings_install_property ( g_param_spec_int ( @@ -620,12 +638,14 @@ e_cal_shell_backend_init_settings (EShell *shell) 0, G_PARAM_READWRITE)); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "cal-week-start-day-gconf", shell_settings, "cal-week-start-day", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, transform_weekdays_gconf_to_evolution, transform_weekdays_evolution_to_gconf, - (GDestroyNotify) NULL, NULL); + NULL, (GDestroyNotify) NULL); /* XXX These are my favorite. Storing a bit array in GConf * instead of separate boolean keys. Brilliant move. */ @@ -638,12 +658,15 @@ e_cal_shell_backend_init_settings (EShell *shell) FALSE, G_PARAM_READWRITE)); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "cal-working-days-bitset", shell_settings, "cal-working-days-sunday", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, transform_working_days_bitset_to_sunday, transform_working_days_sunday_to_bitset, - (GDestroyNotify) NULL, shell_settings); + g_object_ref (shell_settings), + (GDestroyNotify) g_object_unref); e_shell_settings_install_property ( g_param_spec_boolean ( @@ -653,12 +676,15 @@ e_cal_shell_backend_init_settings (EShell *shell) TRUE, G_PARAM_READWRITE)); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "cal-working-days-bitset", shell_settings, "cal-working-days-monday", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, transform_working_days_bitset_to_monday, transform_working_days_monday_to_bitset, - (GDestroyNotify) NULL, shell_settings); + g_object_ref (shell_settings), + (GDestroyNotify) g_object_unref); e_shell_settings_install_property ( g_param_spec_boolean ( @@ -668,12 +694,15 @@ e_cal_shell_backend_init_settings (EShell *shell) TRUE, G_PARAM_READWRITE)); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "cal-working-days-bitset", shell_settings, "cal-working-days-tuesday", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, transform_working_days_bitset_to_tuesday, transform_working_days_tuesday_to_bitset, - (GDestroyNotify) NULL, shell_settings); + g_object_ref (shell_settings), + (GDestroyNotify) g_object_unref); e_shell_settings_install_property ( g_param_spec_boolean ( @@ -683,12 +712,15 @@ e_cal_shell_backend_init_settings (EShell *shell) TRUE, G_PARAM_READWRITE)); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "cal-working-days-bitset", shell_settings, "cal-working-days-wednesday", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, transform_working_days_bitset_to_wednesday, transform_working_days_wednesday_to_bitset, - (GDestroyNotify) NULL, shell_settings); + g_object_ref (shell_settings), + (GDestroyNotify) g_object_unref); e_shell_settings_install_property ( g_param_spec_boolean ( @@ -698,12 +730,15 @@ e_cal_shell_backend_init_settings (EShell *shell) TRUE, G_PARAM_READWRITE)); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "cal-working-days-bitset", shell_settings, "cal-working-days-thursday", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, transform_working_days_bitset_to_thursday, transform_working_days_thursday_to_bitset, - (GDestroyNotify) NULL, shell_settings); + g_object_ref (shell_settings), + (GDestroyNotify) g_object_unref); e_shell_settings_install_property ( g_param_spec_boolean ( @@ -713,12 +748,15 @@ e_cal_shell_backend_init_settings (EShell *shell) TRUE, G_PARAM_READWRITE)); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "cal-working-days-bitset", shell_settings, "cal-working-days-friday", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, transform_working_days_bitset_to_friday, transform_working_days_friday_to_bitset, - (GDestroyNotify) NULL, shell_settings); + g_object_ref (shell_settings), + (GDestroyNotify) g_object_unref); e_shell_settings_install_property ( g_param_spec_boolean ( @@ -728,11 +766,13 @@ e_cal_shell_backend_init_settings (EShell *shell) FALSE, G_PARAM_READWRITE)); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "cal-working-days-bitset", shell_settings, "cal-working-days-saturday", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, transform_working_days_bitset_to_saturday, transform_working_days_saturday_to_bitset, - (GDestroyNotify) g_object_unref, - g_object_ref (shell_settings)); + g_object_ref (shell_settings), + (GDestroyNotify) g_object_unref); } diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index 61f2f639c9..965cc9fa60 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -25,7 +25,6 @@ #include #include "e-util/e-alert-dialog.h" -#include "e-util/e-binding.h" #include "e-util/gconf-bridge.h" #include "widgets/misc/e-paned.h" @@ -703,13 +702,15 @@ cal_shell_sidebar_constructed (GObject *object) priv->date_navigator = g_object_ref (widget); gtk_widget_show (widget); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-show-week-numbers", - calitem, "show-week-numbers"); + calitem, "show-week-numbers", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "cal-week-start-day", - calitem, "week-start-day"); + calitem, "week-start-day", + G_BINDING_SYNC_CREATE); /* Restore widget state from the last session once * the shell view is fully initialized and visible. */ diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index c5a9f22f03..29c7d1e528 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -669,14 +669,17 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) e_cal_shell_view_update_timezone (cal_shell_view); /* Keep the ECalModel in sync with the sidebar. */ - e_binding_new ( + g_object_bind_property ( shell_sidebar, "default-client", - model, "default-client"); + model, "default-client", + G_BINDING_SYNC_CREATE); /* Keep the toolbar view buttons in sync with the calendar. */ - e_mutual_binding_new ( + g_object_bind_property ( calendar, "view", - ACTION (CALENDAR_VIEW_DAY), "current-value"); + ACTION (CALENDAR_VIEW_DAY), "current-value", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* Force the main calendar to update its default source. */ g_signal_emit_by_name (selector, "primary-selection-changed"); diff --git a/modules/calendar/e-cal-shell-view-private.h b/modules/calendar/e-cal-shell-view-private.h index 71a191f332..d6f37ba7bf 100644 --- a/modules/calendar/e-cal-shell-view-private.h +++ b/modules/calendar/e-cal-shell-view-private.h @@ -32,7 +32,6 @@ #include #include -#include "e-util/e-binding.h" #include "e-util/e-selection.h" #include "e-util/e-dialog-utils.h" #include "e-util/e-file-utils.h" diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index cc17964f48..476460761c 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -23,7 +23,6 @@ #include -#include "e-util/e-binding.h" #include "e-util/e-selection.h" #include "e-util/gconf-bridge.h" #include "shell/e-shell-utils.h" @@ -457,7 +456,10 @@ memo_shell_content_constructed (GObject *object) priv->paned = g_object_ref (widget); gtk_widget_show (widget); - e_binding_new (object, "orientation", widget, "orientation"); + g_object_bind_property ( + object, "orientation", + widget, "orientation", + G_BINDING_SYNC_CREATE); container = priv->paned; @@ -495,7 +497,10 @@ memo_shell_content_constructed (GObject *object) priv->preview_pane = g_object_ref (widget); gtk_widget_show (widget); - e_binding_new (object, "preview-visible", widget, "visible"); + g_object_bind_property ( + object, "preview-visible", + widget, "visible", + G_BINDING_SYNC_CREATE); /* Configure the memo table. */ diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index 2ed1f9c4ce..a30d0f1b1f 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -920,13 +920,15 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) ACTION (GAL_SAVE_CUSTOM_VIEW), "activate", G_CALLBACK (action_gal_save_custom_view_cb), memo_shell_view); - e_binding_new ( + g_object_bind_property ( ACTION (MEMO_PREVIEW), "active", - ACTION (MEMO_VIEW_CLASSIC), "sensitive"); + ACTION (MEMO_VIEW_CLASSIC), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (MEMO_PREVIEW), "active", - ACTION (MEMO_VIEW_VERTICAL), "sensitive"); + ACTION (MEMO_VIEW_VERTICAL), "sensitive", + G_BINDING_SYNC_CREATE); e_web_view_set_open_proxy (web_view, ACTION (MEMO_OPEN)); e_web_view_set_print_proxy (web_view, ACTION (MEMO_PRINT)); diff --git a/modules/calendar/e-memo-shell-view-private.c b/modules/calendar/e-memo-shell-view-private.c index a33296daf5..8c83619564 100644 --- a/modules/calendar/e-memo-shell-view-private.c +++ b/modules/calendar/e-memo-shell-view-private.c @@ -274,9 +274,10 @@ e_memo_shell_view_private_constructed (EMemoShellView *memo_shell_view) memo_shell_view); /* Keep the ECalModel in sync with the sidebar. */ - e_binding_new ( + g_object_bind_property ( shell_sidebar, "default-client", - model, "default-client"); + model, "default-client", + G_BINDING_SYNC_CREATE); e_memo_shell_view_actions_init (memo_shell_view); e_memo_shell_view_update_sidebar (memo_shell_view); diff --git a/modules/calendar/e-memo-shell-view-private.h b/modules/calendar/e-memo-shell-view-private.h index 06db399036..0b8867a5b3 100644 --- a/modules/calendar/e-memo-shell-view-private.h +++ b/modules/calendar/e-memo-shell-view-private.h @@ -29,7 +29,6 @@ #include #include -#include "e-util/e-binding.h" #include "e-util/e-dialog-utils.h" #include "e-util/e-file-utils.h" #include "e-util/e-util.h" diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index 6b3f23eeb0..f0af66fa93 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -23,7 +23,6 @@ #include -#include "e-util/e-binding.h" #include "e-util/e-selection.h" #include "e-util/gconf-bridge.h" #include "shell/e-shell-utils.h" @@ -452,7 +451,10 @@ task_shell_content_constructed (GObject *object) priv->paned = g_object_ref (widget); gtk_widget_show (widget); - e_binding_new (object, "orientation", widget, "orientation"); + g_object_bind_property ( + object, "orientation", + widget, "orientation", + G_BINDING_SYNC_CREATE); container = priv->paned; @@ -490,7 +492,10 @@ task_shell_content_constructed (GObject *object) priv->preview_pane = g_object_ref (widget); gtk_widget_show (widget); - e_binding_new (object, "preview-visible", widget, "visible"); + g_object_bind_property ( + object, "preview-visible", + widget, "visible", + G_BINDING_SYNC_CREATE); /* Configure the task table. */ diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index 66cf26a696..b792c829bc 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -1119,13 +1119,15 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) ACTION (GAL_SAVE_CUSTOM_VIEW), "activate", G_CALLBACK (action_gal_save_custom_view_cb), task_shell_view); - e_binding_new ( + g_object_bind_property ( ACTION (TASK_PREVIEW), "active", - ACTION (TASK_VIEW_CLASSIC), "sensitive"); + ACTION (TASK_VIEW_CLASSIC), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (TASK_PREVIEW), "active", - ACTION (TASK_VIEW_VERTICAL), "sensitive"); + ACTION (TASK_VIEW_VERTICAL), "sensitive", + G_BINDING_SYNC_CREATE); e_web_view_set_open_proxy (web_view, ACTION (TASK_OPEN)); e_web_view_set_print_proxy (web_view, ACTION (TASK_PRINT)); diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c index 5e1b352ecd..f0e8cbff2f 100644 --- a/modules/calendar/e-task-shell-view-private.c +++ b/modules/calendar/e-task-shell-view-private.c @@ -326,14 +326,17 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view) task_shell_view); /* Listen for configuration changes. */ - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "cal-confirm-purge", - task_shell_view, "confirm-purge"); + task_shell_view, "confirm-purge", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* Keep the ECalModel in sync with the sidebar. */ - e_binding_new ( + g_object_bind_property ( shell_sidebar, "default-client", - model, "default-client"); + model, "default-client", + G_BINDING_SYNC_CREATE); /* Hide Completed Tasks (enable/units/value) */ g_signal_connect_object ( diff --git a/modules/calendar/e-task-shell-view-private.h b/modules/calendar/e-task-shell-view-private.h index 5b0231e108..b95c0d5e5b 100644 --- a/modules/calendar/e-task-shell-view-private.h +++ b/modules/calendar/e-task-shell-view-private.h @@ -30,7 +30,6 @@ #include #include -#include "e-util/e-binding.h" #include "e-util/e-dialog-utils.h" #include "e-util/e-file-utils.h" #include "e-util/e-util.h" diff --git a/modules/mail/e-mail-config-format-html.c b/modules/mail/e-mail-config-format-html.c index a92a943976..26071c0614 100644 --- a/modules/mail/e-mail-config-format-html.c +++ b/modules/mail/e-mail-config-format-html.c @@ -19,7 +19,7 @@ #include "e-mail-config-format-html.h" #include -#include +#include #include #include @@ -37,27 +37,32 @@ mail_config_format_html_constructed (GObject *object) shell = e_shell_get_default (); shell_settings = e_shell_get_shell_settings (shell); - e_binding_new_full ( + g_object_bind_property_full ( shell_settings, "mail-citation-color", extensible, "citation-color", + G_BINDING_SYNC_CREATE, e_binding_transform_string_to_color, - NULL, NULL); + NULL, NULL, (GDestroyNotify) NULL); - e_binding_new ( + g_object_bind_property ( shell_settings, "mail-image-loading-policy", - extensible, "image-loading-policy"); + extensible, "image-loading-policy", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "mail-only-local-photos", - extensible, "only-local-photos"); + extensible, "only-local-photos", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "mail-show-sender-photo", - extensible, "show-sender-photo"); + extensible, "show-sender-photo", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "mail-show-real-date", - extensible, "show-real-date"); + extensible, "show-real-date", + G_BINDING_SYNC_CREATE); } static void diff --git a/modules/mail/e-mail-config-web-view.c b/modules/mail/e-mail-config-web-view.c index 5cfb648154..3157ff07f9 100644 --- a/modules/mail/e-mail-config-web-view.c +++ b/modules/mail/e-mail-config-web-view.c @@ -19,7 +19,6 @@ #include "e-mail-config-web-view.h" #include -#include #include #include @@ -32,21 +31,25 @@ mail_config_web_view_realize (GtkWidget *widget) shell = e_shell_get_default (); shell_settings = e_shell_get_shell_settings (shell); - e_binding_new ( + g_object_bind_property ( shell_settings, "mail-show-animated-images", - widget, "animate"); + widget, "animate", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "composer-inline-spelling", - widget, "inline-spelling"); + widget, "inline-spelling", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "composer-magic-links", - widget, "magic-links"); + widget, "magic-links", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "composer-magic-smileys", - widget, "magic-smileys"); + widget, "magic-smileys", + G_BINDING_SYNC_CREATE); } static void diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c index 02b073a82b..36e4cbdfb3 100644 --- a/modules/mail/e-mail-shell-backend.c +++ b/modules/mail/e-mail-shell-backend.c @@ -23,7 +23,6 @@ #include -#include "e-util/e-binding.h" #include "e-util/e-import.h" #include "e-util/e-util.h" #include "shell/e-shell.h" diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c index fd1db02fa8..31f60834e5 100644 --- a/modules/mail/e-mail-shell-content.c +++ b/modules/mail/e-mail-shell-content.c @@ -25,7 +25,6 @@ #include #include "e-util/e-util-private.h" -#include "e-util/e-binding.h" #include "e-util/gconf-bridge.h" #include "widgets/menus/gal-view-etable.h" #include "widgets/menus/gal-view-instance.h" diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c index bc1cbcdda2..f938b3fae1 100644 --- a/modules/mail/e-mail-shell-sidebar.c +++ b/modules/mail/e-mail-shell-sidebar.c @@ -21,8 +21,6 @@ #include "e-mail-shell-sidebar.h" -#include "e-util/e-binding.h" - #include "mail/e-mail-backend.h" #include "mail/e-mail-sidebar.h" #include "mail/em-folder-utils.h" @@ -165,13 +163,15 @@ mail_shell_sidebar_constructed (GObject *object) mail_shell_sidebar->priv->folder_tree = g_object_ref (widget); gtk_widget_show (widget); - e_binding_new ( + g_object_bind_property ( shell_view, "state-key-file", - widget, "key-file"); + widget, "key-file", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "mail-side-bar-search", - widget, "enable-search"); + widget, "enable-search", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped ( widget, "key-file-changed", diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c index 920aa0680e..b62e7c1a00 100644 --- a/modules/mail/e-mail-shell-view-actions.c +++ b/modules/mail/e-mail-shell-view-actions.c @@ -1536,56 +1536,71 @@ e_mail_shell_view_actions_init (EMailShellView *mail_shell_view) /* Fine tuning. */ - e_binding_new ( + g_object_bind_property ( ACTION (MAIL_THREADS_GROUP_BY), "active", - ACTION (MAIL_FOLDER_SELECT_THREAD), "sensitive"); + ACTION (MAIL_FOLDER_SELECT_THREAD), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (MAIL_THREADS_GROUP_BY), "active", - ACTION (MAIL_FOLDER_SELECT_SUBTHREAD), "sensitive"); + ACTION (MAIL_FOLDER_SELECT_SUBTHREAD), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (MAIL_THREADS_GROUP_BY), "active", - ACTION (MAIL_THREADS_COLLAPSE_ALL), "sensitive"); + ACTION (MAIL_THREADS_COLLAPSE_ALL), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (MAIL_THREADS_GROUP_BY), "active", - ACTION (MAIL_THREADS_EXPAND_ALL), "sensitive"); + ACTION (MAIL_THREADS_EXPAND_ALL), "sensitive", + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( ACTION (MAIL_PREVIEW), "active", - mail_view, "preview-visible"); + mail_view, "preview-visible", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( ACTION (MAIL_THREADS_GROUP_BY), "active", - mail_shell_content, "group-by-threads"); + mail_shell_content, "group-by-threads", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (MAIL_PREVIEW), "active", - ACTION (MAIL_VIEW_CLASSIC), "sensitive"); + ACTION (MAIL_VIEW_CLASSIC), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (MAIL_PREVIEW), "active", - ACTION (MAIL_VIEW_VERTICAL), "sensitive"); + ACTION (MAIL_VIEW_VERTICAL), "sensitive", + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( ACTION (MAIL_SHOW_DELETED), "active", - mail_view, "show-deleted"); + mail_view, "show-deleted", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_backend, "busy", - ACTION (MAIL_STOP), "sensitive"); + ACTION (MAIL_STOP), "sensitive", + G_BINDING_SYNC_CREATE); /* Keep the sensitivity of "Create Search Folder from Search" * in sync with "Save Search" so that its only selectable when * showing search results. */ - e_binding_new ( + g_object_bind_property ( ACTION (SEARCH_SAVE), "sensitive", - ACTION (MAIL_CREATE_SEARCH_FOLDER), "sensitive"); + ACTION (MAIL_CREATE_SEARCH_FOLDER), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell, "online", - ACTION (MAIL_DOWNLOAD), "sensitive"); + ACTION (MAIL_DOWNLOAD), "sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect ( ACTION (GAL_SAVE_CUSTOM_VIEW), "activate", diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index e8febf59ca..12ff06567d 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -563,9 +563,11 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) /* The folder tree and scope combo box are both insensitive * when searching beyond the currently selected folder. */ - e_mutual_binding_new ( + g_object_bind_property ( folder_tree, "sensitive", - combo_box, "sensitive"); + combo_box, "sensitive", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); web_view = em_format_html_get_web_view (formatter); @@ -670,9 +672,11 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) e_mail_shell_view_update_search_filter (mail_shell_view); /* This binding must come after e_mail_reader_init(). */ - e_mutual_binding_new ( + g_object_bind_property ( shell_content, "group-by-threads", - mail_view, "group-by-threads"); + mail_view, "group-by-threads", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* Populate built-in rules for search entry popup menu. * Keep the assertions, please. If the conditions aren't diff --git a/modules/mail/e-mail-shell-view-private.h b/modules/mail/e-mail-shell-view-private.h index dbd2d217d5..bb56a9e27e 100644 --- a/modules/mail/e-mail-shell-view-private.h +++ b/modules/mail/e-mail-shell-view-private.h @@ -29,7 +29,6 @@ #include /* for camel_search_word */ #include "e-util/e-util.h" -#include "e-util/e-binding.h" #include "e-util/gconf-bridge.h" #include "e-util/e-account-utils.h" #include "e-util/e-ui-manager.h" diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c index 21db864103..196e215643 100644 --- a/modules/mail/em-composer-prefs.c +++ b/modules/mail/em-composer-prefs.c @@ -30,7 +30,6 @@ #include #include -#include "e-util/e-binding.h" #include "e-util/e-signature-utils.h" #include "e-util/gconf-bridge.h" @@ -61,42 +60,9 @@ G_DEFINE_TYPE ( GTK_TYPE_VBOX) static gboolean -transform_color_to_string (const GValue *src_value, - GValue *dst_value, - gpointer user_data) -{ - const GdkColor *color; - gchar *string; - - color = g_value_get_boxed (src_value); - string = gdk_color_to_string (color); - g_value_set_string (dst_value, string); - g_free (string); - - return TRUE; -} - -static gboolean -transform_string_to_color (const GValue *src_value, - GValue *dst_value, - gpointer user_data) -{ - GdkColor color; - const gchar *string; - gboolean success = FALSE; - - string = g_value_get_string (src_value); - if (gdk_color_parse (string, &color)) { - g_value_set_boxed (dst_value, &color); - success = TRUE; - } - - return success; -} - -static gboolean -transform_old_to_new_reply_style (const GValue *src_value, - GValue *dst_value, +transform_old_to_new_reply_style (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { gboolean success = TRUE; @@ -104,21 +70,21 @@ transform_old_to_new_reply_style (const GValue *src_value, /* XXX This is the kind of legacy crap we wind up * with when we don't migrate things properly. */ - switch (g_value_get_int (src_value)) { + switch (g_value_get_int (source_value)) { case 0: /* Quoted: 0 -> 2 */ - g_value_set_int (dst_value, 2); + g_value_set_int (target_value, 2); break; case 1: /* Do Not Quote: 1 -> 3 */ - g_value_set_int (dst_value, 3); + g_value_set_int (target_value, 3); break; case 2: /* Attach: 2 -> 0 */ - g_value_set_int (dst_value, 0); + g_value_set_int (target_value, 0); break; case 3: /* Outlook: 3 -> 1 */ - g_value_set_int (dst_value, 1); + g_value_set_int (target_value, 1); break; default: @@ -130,8 +96,9 @@ transform_old_to_new_reply_style (const GValue *src_value, } static gboolean -transform_new_to_old_reply_style (const GValue *src_value, - GValue *dst_value, +transform_new_to_old_reply_style (GBinding *binding, + const GValue *source_value, + GValue *target_value, gpointer user_data) { gboolean success = TRUE; @@ -139,21 +106,21 @@ transform_new_to_old_reply_style (const GValue *src_value, /* XXX This is the kind of legacy crap we wind up * with when we don't migrate things properly. */ - switch (g_value_get_int (src_value)) { + switch (g_value_get_int (source_value)) { case 0: /* Attach: 0 -> 2 */ - g_value_set_int (dst_value, 2); + g_value_set_int (target_value, 2); break; case 1: /* Outlook: 1 -> 3 */ - g_value_set_int (dst_value, 3); + g_value_set_int (target_value, 3); break; case 2: /* Quoted: 2 -> 0 */ - g_value_set_int (dst_value, 0); + g_value_set_int (target_value, 0); break; case 3: /* Do Not Quote: 3 -> 1 */ - g_value_set_int (dst_value, 1); + g_value_set_int (target_value, 1); break; default: @@ -405,82 +372,112 @@ em_composer_prefs_construct (EMComposerPrefs *prefs, if (e_shell_get_express_mode (shell)) gtk_widget_hide (widget); else - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-format-html", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkPromptEmptySubject"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-prompt-empty-subject", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkPromptBccOnly"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-prompt-only-bcc", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkPromptPrivateListReply"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-prompt-private-list-reply", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkPromptReplyManyRecips"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-prompt-reply-many-recips", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkPromptListReplyTo"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-prompt-list-reply-to", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkAutoSmileys"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-magic-smileys", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkRequestReceipt"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-request-receipt", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkReplyStartBottom"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-reply-start-bottom", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkOutlookFilenames"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-outlook-filenames", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkIgnoreListReplyTo"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-ignore-list-reply-to", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkGroupReplyToList"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-group-reply-to-list", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkTopSignature"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-top-signature", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkEnableSpellChecking"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-inline-spelling", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_charset_combo_box_new (); container = e_builder_get_widget (prefs->builder, "hboxComposerCharset"); gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "composer-charset", - widget, "charset"); + widget, "charset", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* Spell Checking */ widget = e_builder_get_widget (prefs->builder, "listSpellCheckLanguage"); @@ -512,28 +509,34 @@ em_composer_prefs_construct (EMComposerPrefs *prefs, GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_BUTTON); widget = e_builder_get_widget (prefs->builder, "colorButtonSpellCheckColor"); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "composer-spell-color", widget, "color", - transform_string_to_color, - transform_color_to_string, - NULL, NULL); + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, + e_binding_transform_string_to_color, + e_binding_transform_color_to_string, + NULL, (GDestroyNotify) NULL); spell_setup (prefs); /* Forwards and Replies */ widget = e_builder_get_widget (prefs->builder, "comboboxForwardStyle"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-forward-style", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "comboboxReplyStyle"); - e_mutual_binding_new_full ( + g_object_bind_property_full ( shell_settings, "mail-reply-style", widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, transform_old_to_new_reply_style, transform_new_to_old_reply_style, - NULL, NULL); + NULL, (GDestroyNotify) NULL); /* Signatures */ signature_list = e_get_signature_list (); @@ -550,14 +553,17 @@ em_composer_prefs_construct (EMComposerPrefs *prefs, /* Express mode does not honor this setting. */ if (!e_shell_get_express_mode (shell)) - e_binding_new ( + g_object_bind_property ( shell_settings, "composer-format-html", - widget, "prefer-html"); + widget, "prefer-html", + G_BINDING_SYNC_CREATE); #ifndef G_OS_WIN32 - e_binding_new_with_negation ( + g_object_bind_property ( shell_settings, "disable-command-line", - widget, "allow-scripts"); + widget, "allow-scripts", + G_BINDING_SYNC_CREATE | + G_BINDING_INVERT_BOOLEAN); #endif signature_tree_view = e_signature_manager_get_tree_view ( @@ -570,14 +576,17 @@ em_composer_prefs_construct (EMComposerPrefs *prefs, gtk_widget_show (widget); #ifndef G_OS_WIN32 - e_binding_new_with_negation ( + g_object_bind_property ( shell_settings, "disable-command-line", - widget, "allow-scripts"); + widget, "allow-scripts", + G_BINDING_SYNC_CREATE | + G_BINDING_INVERT_BOOLEAN); #endif - e_binding_new ( + g_object_bind_property ( signature_tree_view, "selected", - widget, "signature"); + widget, "signature", + G_BINDING_SYNC_CREATE); /* Sanitize the dialog for Express mode */ e_shell_hide_widgets_for_express_mode (shell, prefs->builder, diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c index 60a8795a63..a1aed25c03 100644 --- a/modules/mail/em-mailer-prefs.c +++ b/modules/mail/em-mailer-prefs.c @@ -38,7 +38,6 @@ #include "libedataserverui/e-cell-renderer-color.h" #include "e-util/e-util.h" -#include "e-util/e-binding.h" #include "e-util/e-datetime-format.h" #include "e-util/e-util-private.h" #include "widgets/misc/e-charset-combo-box.h" @@ -821,77 +820,106 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs, /* Message Display */ widget = e_builder_get_widget (prefs->builder, "view-check"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-global-view-setting", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_charset_combo_box_new (); container = e_builder_get_widget (prefs->builder, "hboxDefaultCharset"); gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-charset", - widget, "charset"); + widget, "charset", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkHighlightCitations"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-mark-citations", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "colorButtonHighlightCitations"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-mark-citations", - widget, "sensitive"); - e_mutual_binding_new_full ( + widget, "sensitive", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); + g_object_bind_property_full ( shell_settings, "mail-citation-color", widget, "color", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, e_binding_transform_string_to_color, e_binding_transform_color_to_string, - NULL, NULL); + NULL, (GDestroyNotify) NULL); widget = e_builder_get_widget (prefs->builder, "thread-by-subject"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-thread-by-subject", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* Deleting Mail */ widget = e_builder_get_widget (prefs->builder, "chkEmptyTrashOnExit"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-empty-trash-on-exit", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "comboboxEmptyTrashDays"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-empty-trash-on-exit", - widget, "sensitive"); + widget, "sensitive", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); emmp_empty_trash_init (prefs, GTK_COMBO_BOX (widget)); widget = e_builder_get_widget (prefs->builder, "chkConfirmExpunge"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-confirm-expunge", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* Mail Fonts */ widget = e_builder_get_widget (prefs->builder, "radFontUseSame"); - e_mutual_binding_new_with_negation ( + g_object_bind_property ( shell_settings, "mail-use-custom-fonts", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE | + G_BINDING_INVERT_BOOLEAN); widget = e_builder_get_widget (prefs->builder, "FontFixed"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-font-monospace", - widget, "font-name"); - e_mutual_binding_new ( + widget, "font-name", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); + g_object_bind_property ( shell_settings, "mail-use-custom-fonts", - widget, "sensitive"); + widget, "sensitive", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "FontVariable"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-font-variable", - widget, "font-name"); - e_mutual_binding_new ( + widget, "font-name", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); + g_object_bind_property ( shell_settings, "mail-use-custom-fonts", - widget, "sensitive"); + widget, "sensitive", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* HTML Mail tab */ @@ -919,39 +947,51 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs, g_signal_connect (prefs->images_always, "toggled", G_CALLBACK (http_images_changed), prefs); widget = e_builder_get_widget (prefs->builder, "chkShowAnimatedImages"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-show-animated-images", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "chkPromptWantHTML"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-confirm-unwanted-html", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); container = e_builder_get_widget (prefs->builder, "labels-alignment"); widget = e_mail_label_manager_new (); gtk_container_add (GTK_CONTAINER (container), widget); gtk_widget_show (widget); - e_binding_new ( + g_object_bind_property ( shell_settings, "mail-label-list-store", - widget, "list-store"); + widget, "list-store", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* headers */ locked = !gconf_client_key_is_writable (prefs->gconf, "/apps/evolution/mail/display/headers", NULL); widget = e_builder_get_widget (prefs->builder, "photo_show"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-show-sender-photo", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "photo_local"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-show-sender-photo", - widget, "sensitive"); - e_mutual_binding_new ( + widget, "sensitive", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); + g_object_bind_property ( shell_settings, "mail-only-local-photos", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* always de-sensitised until the user types something in the entry */ prefs->add_header = GTK_BUTTON (e_builder_get_widget (prefs->builder, "cmdHeadersAdd")); @@ -1066,25 +1106,33 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs, widget = gtk_check_button_new_with_mnemonic (_("Show _original header value")); gtk_widget_show (widget); gtk_table_attach ((GtkTable *) table, widget, 0, 3, 2, 3, GTK_EXPAND | GTK_FILL, 0, 12, 0); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-show-real-date", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* Junk prefs */ widget = e_builder_get_widget (prefs->builder, "chkCheckIncomingMail"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-check-for-junk", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "junk_empty_check"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-empty-junk-on-exit", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "junk_empty_combobox"); - e_mutual_binding_new ( + g_object_bind_property ( shell_settings, "mail-empty-junk-on-exit", - widget, "sensitive"); + widget, "sensitive", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); emmp_empty_junk_init (prefs, GTK_COMBO_BOX (widget)); prefs->default_junk_plugin = GTK_COMBO_BOX (e_builder_get_widget (prefs->builder, "default_junk_plugin")); diff --git a/modules/mailto-handler/evolution-mailto-handler.c b/modules/mailto-handler/evolution-mailto-handler.c index 50212e11f0..367d9166d8 100644 --- a/modules/mailto-handler/evolution-mailto-handler.c +++ b/modules/mailto-handler/evolution-mailto-handler.c @@ -20,7 +20,6 @@ #include #include -#include #include /* Standard GObject macros */ @@ -150,9 +149,12 @@ mailto_handler_prompt (EMailtoHandler *extension) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 12); gtk_widget_show (widget); - e_mutual_binding_new_with_negation ( + g_object_bind_property ( shell_settings, "mailto-handler-check", - widget, "active"); + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE | + G_BINDING_INVERT_BOOLEAN); /* Direct input focus away from the checkbox. */ widget = gtk_dialog_get_widget_for_response ( diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c index 022c2c92d6..b83a1bf272 100644 --- a/plugins/mail-notification/mail-notification.c +++ b/plugins/mail-notification/mail-notification.c @@ -37,7 +37,6 @@ #include -#include #include #include #include @@ -640,9 +639,10 @@ get_config_widget_status (void) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - e_binding_new ( + g_object_bind_property ( master, "active", - widget, "sensitive"); + widget, "sensitive", + G_BINDING_SYNC_CREATE); container = widget; @@ -857,9 +857,10 @@ get_config_widget_sound (void) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - e_binding_new ( + g_object_bind_property ( master, "active", - widget, "sensitive"); + widget, "sensitive", + G_BINDING_SYNC_CREATE); container = widget; diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 527ef250a6..fd7645fe9f 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -29,7 +29,6 @@ #include -#include "e-util/e-binding.h" #include "e-util/e-extensible.h" #include "e-util/e-util.h" #include "e-util/e-alert-dialog.h" diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index ce433592b4..6597eb0597 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -31,7 +31,6 @@ #include #include "e-util/e-util.h" -#include "e-util/e-binding.h" #include "e-util/e-extensible.h" #include "widgets/misc/e-action-combo-box.h" #include "widgets/misc/e-hinted-entry.h" @@ -706,27 +705,33 @@ shell_searchbar_constructed (GObject *object) action = E_SHELL_WINDOW_ACTION_SEARCH_CLEAR (shell_window); - e_binding_new ( + g_object_bind_property ( action, "sensitive", - widget, "secondary-icon-sensitive"); - e_binding_new ( + widget, "secondary-icon-sensitive", + G_BINDING_SYNC_CREATE); + g_object_bind_property ( action, "stock-id", - widget, "secondary-icon-stock"); - e_binding_new ( + widget, "secondary-icon-stock", + G_BINDING_SYNC_CREATE); + g_object_bind_property ( action, "tooltip", - widget, "secondary-icon-tooltip-text"); + widget, "secondary-icon-tooltip-text", + G_BINDING_SYNC_CREATE); action = E_SHELL_WINDOW_ACTION_SEARCH_OPTIONS (shell_window); - e_binding_new ( + g_object_bind_property ( action, "sensitive", - widget, "primary-icon-sensitive"); - e_binding_new ( + widget, "primary-icon-sensitive", + G_BINDING_SYNC_CREATE); + g_object_bind_property ( action, "stock-id", - widget, "primary-icon-stock"); - e_binding_new ( + widget, "primary-icon-stock", + G_BINDING_SYNC_CREATE); + g_object_bind_property ( action, "tooltip", - widget, "primary-icon-tooltip-text"); + widget, "primary-icon-tooltip-text", + G_BINDING_SYNC_CREATE); widget = GTK_WIDGET (searchbar); gtk_size_group_add_widget (size_group, widget); @@ -919,9 +924,10 @@ e_shell_searchbar_init (EShellSearchbar *searchbar) widget = gtk_hbox_new (FALSE, 3); gtk_box_pack_start (box, widget, FALSE, FALSE, 0); - e_binding_new ( + g_object_bind_property ( searchbar, "filter-visible", - widget, "visible"); + widget, "visible", + G_BINDING_SYNC_CREATE); box = GTK_BOX (widget); @@ -933,9 +939,10 @@ e_shell_searchbar_init (EShellSearchbar *searchbar) gtk_box_pack_start (box, widget, FALSE, FALSE, 0); gtk_widget_show (widget); - e_binding_new ( + g_object_bind_property ( searchbar, "labels-visible", - widget, "visible"); + widget, "visible", + G_BINDING_SYNC_CREATE); label = GTK_LABEL (widget); @@ -952,9 +959,10 @@ e_shell_searchbar_init (EShellSearchbar *searchbar) widget = gtk_hbox_new (FALSE, 3); gtk_box_pack_start (box, widget, TRUE, TRUE, 0); - e_binding_new ( + g_object_bind_property ( searchbar, "search-visible", - widget, "visible"); + widget, "visible", + G_BINDING_SYNC_CREATE); box = GTK_BOX (widget); @@ -964,9 +972,10 @@ e_shell_searchbar_init (EShellSearchbar *searchbar) gtk_box_pack_start (box, widget, FALSE, FALSE, 0); gtk_widget_show (widget); - e_binding_new ( + g_object_bind_property ( searchbar, "labels-visible", - widget, "visible"); + widget, "visible", + G_BINDING_SYNC_CREATE); label = GTK_LABEL (widget); @@ -1013,9 +1022,10 @@ e_shell_searchbar_init (EShellSearchbar *searchbar) widget = gtk_hbox_new (FALSE, 3); gtk_box_pack_start (box, widget, FALSE, FALSE, 0); - e_binding_new ( + g_object_bind_property ( searchbar, "scope-visible", - widget, "visible"); + widget, "visible", + G_BINDING_SYNC_CREATE); box = GTK_BOX (widget); diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index 4e4ace07c9..b56e4c061d 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -27,7 +27,6 @@ #include "e-shell-sidebar.h" -#include #include #include #include @@ -414,7 +413,10 @@ e_shell_sidebar_init (EShellSidebar *shell_sidebar) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - e_binding_new (shell_sidebar, "icon-name", widget, "icon-name"); + g_object_bind_property ( + shell_sidebar, "icon-name", + widget, "icon-name", + G_BINDING_SYNC_CREATE); widget = gtk_label_new (NULL); gtk_label_set_ellipsize (GTK_LABEL (widget), PANGO_ELLIPSIZE_END); @@ -428,7 +430,10 @@ e_shell_sidebar_init (EShellSidebar *shell_sidebar) gtk_label_set_attributes (GTK_LABEL (widget), attribute_list); pango_attr_list_unref (attribute_list); - e_binding_new (shell_sidebar, "primary-text", widget, "label"); + g_object_bind_property ( + shell_sidebar, "primary-text", + widget, "label", + G_BINDING_SYNC_CREATE); widget = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (widget), 1.0, 0.5); @@ -441,7 +446,10 @@ e_shell_sidebar_init (EShellSidebar *shell_sidebar) gtk_label_set_attributes (GTK_LABEL (widget), attribute_list); pango_attr_list_unref (attribute_list); - e_binding_new (shell_sidebar, "secondary-text", widget, "label"); + g_object_bind_property ( + shell_sidebar, "secondary-text", + widget, "label", + G_BINDING_SYNC_CREATE); } /** diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c index ee1af8e3be..9d2d4ca584 100644 --- a/shell/e-shell-utils.c +++ b/shell/e-shell-utils.c @@ -29,7 +29,6 @@ #include -#include "e-util/e-binding.h" #include "widgets/misc/e-import-assistant.h" /** @@ -52,9 +51,10 @@ e_shell_configure_ui_manager (EShell *shell, shell_settings = e_shell_get_shell_settings (shell); - e_binding_new ( + g_object_bind_property ( shell, "express-mode", - ui_manager, "express-mode"); + ui_manager, "express-mode", + G_BINDING_SYNC_CREATE); } /** @@ -77,13 +77,15 @@ e_shell_configure_web_view (EShell *shell, shell_settings = e_shell_get_shell_settings (shell); #ifndef G_OS_WIN32 - e_binding_new ( + g_object_bind_property ( shell_settings, "disable-printing", - web_view, "disable-printing"); + web_view, "disable-printing", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_settings, "disable-save-to-disk", - web_view, "disable-save-to-disk"); + web_view, "disable-save-to-disk", + G_BINDING_SYNC_CREATE); #endif } diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index e6731af1b4..ab3f3973de 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -30,7 +30,6 @@ #include #include -#include "e-util/e-binding.h" #include "e-util/e-extensible.h" #include "e-util/e-file-utils.h" #include "e-util/e-plugin-ui.h" @@ -655,7 +654,10 @@ shell_view_construct_searchbar (EShellView *shell_view) gtk_widget_show (GTK_WIDGET (item)); action = e_shell_view_get_action (shell_view); - e_binding_new (action, "active", widget, "visible"); + g_object_bind_property ( + action, "active", + widget, "visible", + G_BINDING_SYNC_CREATE); gtk_toolbar_insert (GTK_TOOLBAR (main_toolbar), item, -1); diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index c619ac27cd..740adcc9f7 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1937,45 +1937,59 @@ e_shell_window_actions_init (EShellWindow *shell_window) g_object_set (ACTION (SEND_RECEIVE), "is-important", TRUE, NULL); - e_mutual_binding_new ( + g_object_bind_property ( shell_window, "sidebar-visible", - ACTION (SHOW_SIDEBAR), "active"); + ACTION (SHOW_SIDEBAR), "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( shell_window, "switcher-visible", - ACTION (SHOW_SWITCHER), "active"); + ACTION (SHOW_SWITCHER), "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( shell_window, "taskbar-visible", - ACTION (SHOW_TASKBAR), "active"); + ACTION (SHOW_TASKBAR), "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( shell_window, "toolbar-visible", - ACTION (SHOW_TOOLBAR), "active"); + ACTION (SHOW_TOOLBAR), "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (SHOW_SIDEBAR), "active", - ACTION (SHOW_SWITCHER), "sensitive"); + ACTION (SHOW_SWITCHER), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (SHOW_SIDEBAR), "active", - ACTION (SWITCHER_STYLE_BOTH), "sensitive"); + ACTION (SWITCHER_STYLE_BOTH), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (SHOW_SIDEBAR), "active", - ACTION (SWITCHER_STYLE_ICONS), "sensitive"); + ACTION (SWITCHER_STYLE_ICONS), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (SHOW_SIDEBAR), "active", - ACTION (SWITCHER_STYLE_TEXT), "sensitive"); + ACTION (SWITCHER_STYLE_TEXT), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (SHOW_SIDEBAR), "active", - ACTION (SWITCHER_STYLE_USER), "sensitive"); + ACTION (SWITCHER_STYLE_USER), "sensitive", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( ACTION (SHOW_SIDEBAR), "active", - ACTION (SWITCHER_MENU), "sensitive"); + ACTION (SWITCHER_MENU), "sensitive", + G_BINDING_SYNC_CREATE); /* Submitting bug reports requires bug-buddy. */ path = g_find_program_in_path ("bug-buddy"); diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index 200a56dbe6..5c4e1217ca 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -365,50 +365,62 @@ e_shell_window_private_constructed (EShellWindow *shell_window) action_group = ACTION_GROUP (LOCKDOWN_PRINTING); - e_binding_new_with_negation ( + g_object_bind_property ( shell_settings, "disable-printing", - action_group, "visible"); + action_group, "visible", + G_BINDING_SYNC_CREATE | + G_BINDING_INVERT_BOOLEAN); action_group = ACTION_GROUP (LOCKDOWN_PRINT_SETUP); - e_binding_new_with_negation ( + g_object_bind_property ( shell_settings, "disable-print-setup", - action_group, "visible"); + action_group, "visible", + G_BINDING_SYNC_CREATE | + G_BINDING_INVERT_BOOLEAN); action_group = ACTION_GROUP (LOCKDOWN_SAVE_TO_DISK); - e_binding_new_with_negation ( + g_object_bind_property ( shell_settings, "disable-save-to-disk", - action_group, "visible"); + action_group, "visible", + G_BINDING_SYNC_CREATE | + G_BINDING_INVERT_BOOLEAN); #endif /* Bind GObject properties to GObject properties. */ action = ACTION (SEND_RECEIVE); - e_binding_new ( + g_object_bind_property ( shell, "online", - action, "sensitive"); + action, "sensitive", + G_BINDING_SYNC_CREATE); action = ACTION (WORK_OFFLINE); - e_binding_new ( + g_object_bind_property ( shell, "online", - action, "visible"); + action, "visible", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell, "network-available", - action, "sensitive"); + action, "sensitive", + G_BINDING_SYNC_CREATE); action = ACTION (WORK_ONLINE); - e_binding_new_with_negation ( + g_object_bind_property ( shell, "online", - action, "visible"); + action, "visible", + G_BINDING_SYNC_CREATE | + G_BINDING_INVERT_BOOLEAN); - e_binding_new ( + g_object_bind_property ( shell, "network-available", - action, "sensitive"); + action, "sensitive", + G_BINDING_SYNC_CREATE); /* Bind GObject properties to GConf keys. */ diff --git a/shell/e-shell-window-private.h b/shell/e-shell-window-private.h index de2b32471a..960fc74773 100644 --- a/shell/e-shell-window-private.h +++ b/shell/e-shell-window-private.h @@ -28,7 +28,6 @@ #include #include -#include #include #include #include diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index e8be087560..7704fb5e71 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -359,8 +359,12 @@ shell_window_construct_menubar (EShellWindow *shell_window) gtk_container_add ((GtkContainer *)parent, child); shell_window->priv->menubar_box = child; - e_mutual_binding_new (main_menu, "visible", - child, "visible"); + g_object_bind_property ( + main_menu, "visible", + child, "visible", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); + main_menu = child; } @@ -392,9 +396,10 @@ shell_window_construct_toolbar (EShellWindow *shell_window) box = gtk_hbox_new (FALSE, 0); gtk_widget_show (box); - e_binding_new ( + g_object_bind_property ( shell_window, "toolbar-visible", - box, "visible"); + box, "visible", + G_BINDING_SYNC_CREATE); toolbar = e_shell_window_get_managed_widget ( shell_window, "/main-toolbar"); @@ -460,13 +465,15 @@ shell_window_construct_sidebar (EShellWindow *shell_window) switcher = e_shell_switcher_new (); shell_window->priv->switcher = g_object_ref_sink (switcher); - e_binding_new ( + g_object_bind_property ( shell_window, "sidebar-visible", - switcher, "visible"); + switcher, "visible", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell_window, "switcher-visible", - switcher, "toolbar-visible"); + switcher, "toolbar-visible", + G_BINDING_SYNC_CREATE); notebook = gtk_notebook_new (); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); @@ -515,9 +522,10 @@ shell_window_construct_taskbar (EShellWindow *shell_window) status_area = gtk_hbox_new (FALSE, 3); gtk_container_set_border_width (GTK_CONTAINER (status_area), 3); - e_binding_new ( + g_object_bind_property ( shell_window, "taskbar-visible", - status_area, "visible"); + status_area, "visible", + G_BINDING_SYNC_CREATE); /* Make the status area as large as the task bar. */ gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, NULL, &height); @@ -528,13 +536,15 @@ shell_window_construct_taskbar (EShellWindow *shell_window) GTK_BOX (status_area), online_button, FALSE, TRUE, 0); gtk_widget_show (online_button); - e_binding_new ( + g_object_bind_property ( shell, "online", - online_button, "online"); + online_button, "online", + G_BINDING_SYNC_CREATE); - e_binding_new ( + g_object_bind_property ( shell, "network-available", - online_button, "sensitive"); + online_button, "sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect ( online_button, "clicked", diff --git a/widgets/misc/e-account-manager.c b/widgets/misc/e-account-manager.c index b3b7f1861f..0c9e464657 100644 --- a/widgets/misc/e-account-manager.c +++ b/widgets/misc/e-account-manager.c @@ -23,7 +23,6 @@ #include #include -#include "e-util/e-binding.h" #include "e-account-tree-view.h" /* backward-compatibility cruft */ @@ -290,9 +289,11 @@ e_account_manager_init (EAccountManager *manager) manager->priv->tree_view = g_object_ref (widget); gtk_widget_show (widget); - e_mutual_binding_new ( + g_object_bind_property ( manager, "account-list", - widget, "account-list"); + widget, "account-list", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); g_signal_connect_swapped ( widget, "key-press-event", diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c index 3878c1ee8d..77bab884c9 100644 --- a/widgets/misc/e-attachment-button.c +++ b/widgets/misc/e-attachment-button.c @@ -23,8 +23,6 @@ #include "e-attachment-button.h" -#include "e-util/e-binding.h" - #define E_ATTACHMENT_BUTTON_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_ATTACHMENT_BUTTON, EAttachmentButtonPrivate)) @@ -35,8 +33,8 @@ struct _EAttachmentButtonPrivate { EAttachment *attachment; gulong reference_handler_id; - EMutualBinding *can_show_binding; - EMutualBinding *shown_binding; + GBinding *can_show_binding; + GBinding *shown_binding; GtkWidget *expand_button; GtkWidget *toggle_button; @@ -537,9 +535,11 @@ e_attachment_button_init (EAttachmentButton *button) button->priv->expand_button = g_object_ref (widget); gtk_widget_show (widget); - e_mutual_binding_new ( + g_object_bind_property ( button, "expandable", - widget, "sensitive"); + widget, "sensitive", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = gtk_toggle_button_new (); gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); @@ -567,9 +567,11 @@ e_attachment_button_init (EAttachmentButton *button) g_object_set (renderer, "is-expander", TRUE, NULL); gtk_cell_layout_pack_start (cell_layout, renderer, FALSE); - e_mutual_binding_new ( + g_object_bind_property ( button, "expanded", - renderer, "is-expanded"); + renderer, "is-expanded", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); renderer = gtk_cell_renderer_pixbuf_new (); g_object_set (renderer, "stock-size", GTK_ICON_SIZE_BUTTON, NULL); @@ -676,11 +678,9 @@ e_attachment_button_set_attachment (EAttachmentButton *button, } if (button->priv->attachment != NULL) { - e_mutual_binding_unbind ( - button->priv->can_show_binding); + g_object_unref (button->priv->can_show_binding); button->priv->can_show_binding = NULL; - e_mutual_binding_unbind ( - button->priv->shown_binding); + g_object_unref (button->priv->shown_binding); button->priv->shown_binding = NULL; g_signal_handler_disconnect ( button->priv->attachment, @@ -691,17 +691,21 @@ e_attachment_button_set_attachment (EAttachmentButton *button, button->priv->attachment = attachment; if (attachment != NULL) { - EMutualBinding *binding; + GBinding *binding; gulong handler_id; - binding = e_mutual_binding_new ( + binding = g_object_bind_property ( attachment, "can-show", - button, "expandable"); + button, "expandable", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); button->priv->can_show_binding = binding; - binding = e_mutual_binding_new ( + binding = g_object_bind_property ( attachment, "shown", - button, "expanded"); + button, "expanded", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); button->priv->shown_binding = binding; handler_id = g_signal_connect_swapped ( diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c index 683da6b933..d1b61e0857 100644 --- a/widgets/misc/e-attachment-paned.c +++ b/widgets/misc/e-attachment-paned.c @@ -23,7 +23,6 @@ #include -#include "e-util/e-binding.h" #include "e-util/gconf-bridge.h" #include "e-attachment-view.h" @@ -292,41 +291,59 @@ attachment_paned_constructed (GObject *object) /* Set up property-to-property bindings. */ - e_mutual_binding_new ( + g_object_bind_property ( object, "active-view", - priv->combo_box, "active"); + priv->combo_box, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "active-view", - priv->notebook, "page"); + priv->notebook, "page", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "dragging", - priv->icon_view, "dragging"); + priv->icon_view, "dragging", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "dragging", - priv->tree_view, "dragging"); + priv->tree_view, "dragging", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "editable", - priv->icon_view, "editable"); + priv->icon_view, "editable", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "editable", - priv->tree_view, "editable"); + priv->tree_view, "editable", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "expanded", - priv->expander, "expanded"); + priv->expander, "expanded", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "expanded", - priv->combo_box, "sensitive"); + priv->combo_box, "sensitive", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); - e_mutual_binding_new ( + g_object_bind_property ( object, "expanded", - priv->notebook, "visible"); + priv->notebook, "visible", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* Set up property-to-GConf bindings. */ diff --git a/widgets/misc/e-attachment-view.c b/widgets/misc/e-attachment-view.c index f641f76f1d..5094a54f1d 100644 --- a/widgets/misc/e-attachment-view.c +++ b/widgets/misc/e-attachment-view.c @@ -25,7 +25,6 @@ #include #include -#include "e-util/e-binding.h" #include "e-util/e-selection.h" #include "e-util/e-ui-manager.h" #include "e-util/e-util.h" @@ -858,9 +857,11 @@ e_attachment_view_init (EAttachmentView *view) action_group = e_attachment_view_add_action_group (view, "editable"); - e_mutual_binding_new ( + g_object_bind_property ( view, "editable", - action_group, "visible"); + action_group, "visible", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); gtk_action_group_add_actions ( action_group, editable_entries, G_N_ELEMENTS (editable_entries), view); diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index b976355801..4954ccff2e 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include "e-calendar.h" @@ -684,9 +683,10 @@ create_children (EDateEdit *dedit) gtk_container_add (GTK_CONTAINER (bbox), priv->none_button); g_signal_connect (priv->none_button, "clicked", G_CALLBACK (on_date_popup_none_button_clicked), dedit); - e_binding_new ( + g_object_bind_property ( dedit, "allow-no-date-set", - priv->none_button, "visible"); + priv->none_button, "visible", + G_BINDING_SYNC_CREATE); } /* GtkWidget::mnemonic_activate() handler for the EDateEdit */ diff --git a/widgets/misc/e-popup-action.c b/widgets/misc/e-popup-action.c index 73f9c0778a..99e1994010 100644 --- a/widgets/misc/e-popup-action.c +++ b/widgets/misc/e-popup-action.c @@ -22,7 +22,6 @@ #include "e-popup-action.h" #include -#include "e-util/e-binding.h" #define E_POPUP_ACTION_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 9846576a5e..ede2e2fb37 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -25,8 +25,6 @@ #include #include -#include "e-util/e-binding.h" - /* backward-compatibility cruft */ #include "e-util/gtk-compat.h" @@ -380,9 +378,11 @@ search_bar_constructed (GObject *object) priv = E_SEARCH_BAR_GET_PRIVATE (object); - e_mutual_binding_new ( + g_object_bind_property ( object, "case-sensitive", - priv->case_sensitive_button, "active"); + priv->case_sensitive_button, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); } static void @@ -584,9 +584,10 @@ e_search_bar_init (ESearchBar *search_bar) search_bar->priv->entry = g_object_ref (widget); gtk_widget_show (widget); - e_binding_new ( + g_object_bind_property ( search_bar, "active-search", - widget, "secondary-icon-sensitive"); + widget, "secondary-icon-sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped ( widget, "activate", @@ -610,7 +611,10 @@ e_search_bar_init (ESearchBar *search_bar) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - e_binding_new (search_bar, "active-search", widget, "sensitive"); + g_object_bind_property ( + search_bar, "active-search", + widget, "sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped ( widget, "clicked", @@ -626,7 +630,10 @@ e_search_bar_init (ESearchBar *search_bar) gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); gtk_widget_show (widget); - e_binding_new (search_bar, "active-search", widget, "sensitive"); + g_object_bind_property ( + search_bar, "active-search", + widget, "sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped ( widget, "clicked", diff --git a/widgets/misc/e-signature-manager.c b/widgets/misc/e-signature-manager.c index d6d021cd3d..43b6be6c63 100644 --- a/widgets/misc/e-signature-manager.c +++ b/widgets/misc/e-signature-manager.c @@ -24,7 +24,6 @@ #include #include #include -#include "e-util/e-binding.h" #include "e-signature-tree-view.h" #include "e-signature-script-dialog.h" @@ -535,9 +534,11 @@ e_signature_manager_init (ESignatureManager *manager) manager->priv->tree_view = g_object_ref (widget); gtk_widget_show (widget); - e_mutual_binding_new ( + g_object_bind_property ( manager, "signature-list", - widget, "signature-list"); + widget, "signature-list", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); g_signal_connect_swapped ( widget, "key-press-event", @@ -587,9 +588,10 @@ e_signature_manager_init (ESignatureManager *manager) manager->priv->add_script_button = g_object_ref (widget); gtk_widget_show (widget); - e_binding_new ( + g_object_bind_property ( manager, "allow-scripts", - widget, "sensitive"); + widget, "sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped ( widget, "clicked", diff --git a/widgets/misc/e-signature-script-dialog.c b/widgets/misc/e-signature-script-dialog.c index fa725081dc..1d514f5da0 100644 --- a/widgets/misc/e-signature-script-dialog.c +++ b/widgets/misc/e-signature-script-dialog.c @@ -22,7 +22,6 @@ #include "e-signature-script-dialog.h" #include -#include "e-util/e-binding.h" #define E_SIGNATURE_SCRIPT_DIALOG_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index 26613cb686..afc0476ad5 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -28,7 +28,6 @@ #include #include -#include #include #include @@ -1427,9 +1426,11 @@ e_web_view_init (EWebView *web_view) gtk_action_group_add_action (action_group, GTK_ACTION (popup_action)); g_object_unref (popup_action); - e_mutual_binding_new ( + g_object_bind_property ( web_view, "open-proxy", - popup_action, "related-action"); + popup_action, "related-action", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* Support lockdown. */ @@ -1442,9 +1443,11 @@ e_web_view_init (EWebView *web_view) gtk_action_group_add_action (action_group, GTK_ACTION (popup_action)); g_object_unref (popup_action); - e_mutual_binding_new ( + g_object_bind_property ( web_view, "print-proxy", - popup_action, "related-action"); + popup_action, "related-action", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); action_group = gtk_action_group_new ("lockdown-save-to-disk"); gtk_action_group_set_translation_domain (action_group, domain); @@ -1455,9 +1458,11 @@ e_web_view_init (EWebView *web_view) gtk_action_group_add_action (action_group, GTK_ACTION (popup_action)); g_object_unref (popup_action); - e_mutual_binding_new ( + g_object_bind_property ( web_view, "save-as-proxy", - popup_action, "related-action"); + popup_action, "related-action", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); /* Because we are loading from a hard-coded string, there is * no chance of I/O errors. Failure here implies a malformed -- cgit