aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-29 04:59:35 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-09-29 05:00:51 +0800
commit5999e07ac4d7ce14c62173ea6e80efe3a08426cb (patch)
tree303e24f09691fd4d18629c0c9a5f28b6bad2c948
parente9895d699951cc049b6d468c0e75b77e5f5341c1 (diff)
downloadgsoc2013-evolution-5999e07ac4d7ce14c62173ea6e80efe3a08426cb.tar
gsoc2013-evolution-5999e07ac4d7ce14c62173ea6e80efe3a08426cb.tar.gz
gsoc2013-evolution-5999e07ac4d7ce14c62173ea6e80efe3a08426cb.tar.bz2
gsoc2013-evolution-5999e07ac4d7ce14c62173ea6e80efe3a08426cb.tar.lz
gsoc2013-evolution-5999e07ac4d7ce14c62173ea6e80efe3a08426cb.tar.xz
gsoc2013-evolution-5999e07ac4d7ce14c62173ea6e80efe3a08426cb.tar.zst
gsoc2013-evolution-5999e07ac4d7ce14c62173ea6e80efe3a08426cb.zip
Bug 594534 - Can't select calendar for a new appointment
-rw-r--r--modules/calendar/e-cal-shell-view-private.c27
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