diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-29 04:59:35 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-09-29 05:00:51 +0800 |
commit | 5999e07ac4d7ce14c62173ea6e80efe3a08426cb (patch) | |
tree | 303e24f09691fd4d18629c0c9a5f28b6bad2c948 /modules/calendar/e-cal-shell-view-private.c | |
parent | e9895d699951cc049b6d468c0e75b77e5f5341c1 (diff) | |
download | gsoc2013-evolution-5999e07ac4d7ce14c62173ea6e80efe3a08426cb.tar.gz gsoc2013-evolution-5999e07ac4d7ce14c62173ea6e80efe3a08426cb.tar.zst gsoc2013-evolution-5999e07ac4d7ce14c62173ea6e80efe3a08426cb.zip |
Bug 594534 - Can't select calendar for a new appointment
Diffstat (limited to 'modules/calendar/e-cal-shell-view-private.c')
-rw-r--r-- | modules/calendar/e-cal-shell-view-private.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 98aacb9db7..89d8ef5ba9 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -245,6 +245,25 @@ cal_shell_view_selector_popup_event_cb (EShellView *shell_view, } static void +cal_shell_view_selector_primary_changed_cb (ECalShellView *cal_shell_view, + ESourceSelector *selector) +{ + ECalShellContent *cal_shell_content; + GnomeCalendar *calendar; + ESource *source; + + /* XXX ESourceSelector -really- needs a "primary-selection" + * ESource property. Then we could just use EBindings. */ + + cal_shell_content = cal_shell_view->priv->cal_shell_content; + calendar = e_cal_shell_content_get_calendar (cal_shell_content); + source = e_source_selector_peek_primary_selection (selector); + + if (source != NULL) + gnome_calendar_set_default_source (calendar, source); +} + +static void cal_shell_view_selector_client_added_cb (ECalShellView *cal_shell_view, ECal *client) { @@ -489,6 +508,11 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) cal_shell_view); g_signal_connect_swapped ( + selector, "primary-selection-changed", + G_CALLBACK (cal_shell_view_selector_primary_changed_cb), + cal_shell_view); + + g_signal_connect_swapped ( cal_shell_sidebar, "client-added", G_CALLBACK (cal_shell_view_selector_client_added_cb), cal_shell_view); @@ -541,6 +565,9 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) e_mutual_binding_new ( calendar, "view", ACTION (CALENDAR_VIEW_DAY), "current-value"); + + /* Force the main calendar to update its default source. */ + g_signal_emit_by_name (selector, "primary-selection-changed"); } void |