diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-10-14 11:40:16 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-14 19:12:52 +0800 |
commit | 1e663aa13266cad55e5019c03e768a38955166eb (patch) | |
tree | 6d7a3e20d3a24f004d0db4ab1c06d8a768b2f112 /modules | |
parent | 3f58ba3d833953c29bb6aa5e1834e2f367f15202 (diff) | |
download | gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar.gz gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar.bz2 gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar.lz gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar.xz gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar.zst gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.zip |
Replace EBinding with GBinding.
GObject now does property bindings itself.
Requires GLib >= 2.26.
Diffstat (limited to 'modules')
34 files changed, 583 insertions, 414 deletions
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 <libedataserverui/e-source-selector.h> #include <libedataserverui/e-name-selector-entry.h> -#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 <glib/gi18n.h> -#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 <libedataserverui/e-source-selector.h> #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 <shell/e-shell.h> -#include <e-util/e-binding.h> #include <e-util/e-extension.h> #include <misc/e-calendar-item.h> @@ -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 <shell/e-shell.h> -#include <e-util/e-binding.h> #include <e-util/e-extension.h> #include <misc/e-dateedit.h> @@ -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 <shell/e-shell.h> -#include <e-util/e-binding.h> #include <e-util/e-extension.h> #include <calendar/gui/e-meeting-store.h> @@ -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 <shell/e-shell.h> -#include <e-util/e-binding.h> #include <e-util/e-extension.h> #include <calendar/gui/e-meeting-time-sel.h> @@ -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 <shell/e-shell.h> -#include <e-util/e-binding.h> #include <e-util/e-extension.h> #include <calendar/gui/e-cal-model.h> #include <calendar/gui/e-cal-model-tasks.h> @@ -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 <shell/e-shell.h> -#include <e-util/e-binding.h> #include <e-util/e-extension.h> #include <calendar/gui/e-day-view.h> #include <calendar/gui/e-week-view.h> @@ -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 <string.h> #include <glib/gi18n.h> -#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 <gconf/gconf-client.h> #include <libecal/e-cal-util.h> -#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 <glib/gi18n.h> #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 <libedataserver/e-data-server-util.h> #include <libedataserver/e-sexp.h> -#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 <glib/gi18n.h> -#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 <libedataserver/e-categories.h> #include <libedataserver/e-sexp.h> -#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 <glib/gi18n.h> -#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 <libedataserver/e-categories.h> #include <libedataserver/e-sexp.h> -#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 <shell/e-shell.h> -#include <e-util/e-binding.h> +#include <e-util/e-util.h> #include <e-util/e-extension.h> #include <mail/em-format-html.h> @@ -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 <shell/e-shell.h> -#include <e-util/e-binding.h> #include <e-util/e-extension.h> #include <misc/e-web-view.h> @@ -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 <glib/gi18n.h> -#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 <libedataserver/e-data-server-util.h> #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 <camel/camel-search-private.h> /* 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 <unistd.h> #include <fcntl.h> -#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 <glib/gi18n-lib.h> #include <shell/e-shell.h> -#include <e-util/e-binding.h> #include <e-util/e-extension.h> /* 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 ( |