From 3b0699fc304d0f4aecb261d19869de221f5d6abf Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 7 Aug 2009 21:43:09 -0400 Subject: More refactoring of settings management. --- calendar/gui/dialogs/event-editor.c | 41 ++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'calendar/gui/dialogs/event-editor.c') diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index e7d602c335..94006a961c 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -247,15 +247,6 @@ static GtkActionEntry meeting_entries[] = { G_CALLBACK (action_free_busy_cb) } }; -static void -event_editor_client_changed_cb (EventEditor *ee) -{ - ECal *client; - - client = comp_editor_get_client (COMP_EDITOR (ee)); - e_meeting_store_set_e_cal (ee->priv->model, client); -} - static void event_editor_model_changed_cb (EventEditor *ee) { @@ -368,6 +359,31 @@ event_editor_dispose (GObject *object) G_OBJECT_CLASS (event_editor_parent_class)->dispose (object); } +static void +event_editor_constructed (GObject *object) +{ + EventEditorPrivate *priv; + EShellSettings *shell_settings; + EShell *shell; + + priv = EVENT_EDITOR_GET_PRIVATE (object); + + shell = comp_editor_get_shell (COMP_EDITOR (object)); + shell_settings = e_shell_get_shell_settings (shell); + + e_binding_new ( + G_OBJECT (object), "client", + G_OBJECT (priv->model), "client"); + + e_binding_new ( + G_OBJECT (shell_settings), "cal-free-busy-template", + G_OBJECT (priv->model), "free-busy-template"); + + e_binding_new ( + G_OBJECT (shell_settings), "cal-timezone", + G_OBJECT (priv->model), "timezone"); +} + static void event_editor_show_categories (CompEditor *editor, gboolean visible) @@ -445,6 +461,7 @@ event_editor_class_init (EventEditorClass *class) object_class = G_OBJECT_CLASS (class); object_class->constructor = event_editor_constructor; object_class->dispose = event_editor_dispose; + object_class->constructed = event_editor_constructed; editor_class = COMP_EDITOR_CLASS (class); editor_class->help_section = "usage-calendar-apts"; @@ -502,10 +519,6 @@ event_editor_init (EventEditor *ee) action = comp_editor_get_action (editor, "send-options"); gtk_action_set_visible (action, FALSE); - g_signal_connect ( - ee, "notify::client", - G_CALLBACK (event_editor_client_changed_cb), NULL); - g_signal_connect_swapped ( ee->priv->model, "row_changed", G_CALLBACK (event_editor_model_changed_cb), ee); @@ -640,7 +653,7 @@ event_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method, gboo ECal *client; gboolean result; - client = e_meeting_store_get_e_cal (priv->model); + client = e_meeting_store_get_client (priv->model); result = itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp, client, NULL, NULL, NULL, strip_alarms); g_object_unref (comp); -- cgit v1.2.3