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 /calendar/gui/dialogs | |
parent | 3f58ba3d833953c29bb6aa5e1834e2f367f15202 (diff) | |
download | gsoc2013-evolution-1e663aa13266cad55e5019c03e768a38955166eb.tar.gz 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 'calendar/gui/dialogs')
-rw-r--r-- | calendar/gui/dialogs/cal-prefs-dialog.c | 131 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor-util.c | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 6 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-editor.c | 11 | ||||
-rw-r--r-- | calendar/gui/dialogs/recurrence-page.c | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/schedule-page.c | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-editor.c | 6 |
7 files changed, 100 insertions, 57 deletions
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 <widgets/misc/e-dateedit.h> #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 <glib/gi18n.h> #include <libedataserver/e-time-utils.h> #include <libecal/e-cal-time-util.h> -#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 <glib/gstdio.h> #include <gdk/gdkkeysyms.h> #include <e-util/e-util.h> -#include <e-util/e-binding.h> #include <e-util/e-alert-sink.h> #include <e-util/e-dialog-utils.h> #include <e-util/e-util-private.h> @@ -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 <glib/gi18n.h> #include <misc/e-dateedit.h> -#include <e-util/e-binding.h> #include <e-util/e-plugin-ui.h> #include <e-util/e-util-private.h> #include <e-util/e-ui-manager.h> @@ -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 <gtk/gtk.h> #include <glib/gi18n.h> -#include <e-util/e-binding.h> #include <e-util/e-dialog-widgets.h> #include <e-util/e-util-private.h> #include <misc/e-dateedit.h> 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 <string.h> #include <glib/gi18n.h> -#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 |