From 9199f2c5b1925b6d1092738bf1a1c026e53d37f0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 12 Aug 2009 09:29:44 -0400 Subject: Get the itip-formatter plugin working. --- calendar/gui/calendar-config.c | 57 ------------------------ calendar/gui/calendar-config.h | 10 ----- configure.ac | 3 +- modules/calendar/e-cal-shell-settings.c | 8 ++++ modules/calendar/e-cal-shell-sidebar.c | 4 +- modules/calendar/e-memo-shell-backend.c | 78 +++++++++++++++++++++++++-------- modules/calendar/e-memo-shell-migrate.c | 19 ++++++-- modules/calendar/e-memo-shell-sidebar.c | 26 +++++++++-- modules/calendar/e-task-shell-backend.c | 78 +++++++++++++++++++++++++-------- modules/calendar/e-task-shell-migrate.c | 17 ++++++- modules/calendar/e-task-shell-sidebar.c | 26 +++++++++-- plugins/itip-formatter/Makefile.am | 1 + plugins/itip-formatter/itip-formatter.c | 17 +++++-- 13 files changed, 217 insertions(+), 127 deletions(-) diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index 088e0703cd..3208fb5f5b 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -415,35 +415,6 @@ calendar_config_add_notification_tasks_selected (GConfClientNotifyFunc func, gpo return id; } -/* The primary task list */ -gchar * -calendar_config_get_primary_tasks (void) -{ - calendar_config_init (); - - return gconf_client_get_string (config, CALENDAR_CONFIG_PRIMARY_TASKS, NULL); -} - -void -calendar_config_set_primary_tasks (const gchar *primary_uid) -{ - calendar_config_init (); - - gconf_client_set_string (config, CALENDAR_CONFIG_PRIMARY_TASKS, primary_uid, NULL); -} - -guint -calendar_config_add_notification_primary_tasks (GConfClientNotifyFunc func, gpointer data) -{ - guint id; - - calendar_config_init (); - - id = gconf_client_notify_add (config, CALENDAR_CONFIG_PRIMARY_TASKS, func, data, NULL, NULL); - - return id; -} - /***************************************/ /* The current list of memo lists selected */ @@ -475,34 +446,6 @@ calendar_config_add_notification_memos_selected (GConfClientNotifyFunc func, gpo return id; } -/* The primary memo list */ -gchar * -calendar_config_get_primary_memos (void) -{ - calendar_config_init (); - - return gconf_client_get_string (config, CALENDAR_CONFIG_PRIMARY_MEMOS, NULL); -} - -void -calendar_config_set_primary_memos (const gchar *primary_uid) -{ - calendar_config_init (); - - gconf_client_set_string (config, CALENDAR_CONFIG_PRIMARY_MEMOS, primary_uid, NULL); -} - -guint -calendar_config_add_notification_primary_memos (GConfClientNotifyFunc func, gpointer data) -{ - guint id; - - calendar_config_init (); - - id = gconf_client_notify_add (config, CALENDAR_CONFIG_PRIMARY_MEMOS, func, data, NULL, NULL); - - return id; -} /***************************************/ /* Whether we compress the weekend in the week/month views. */ diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h index 50df8a4875..ff018abeca 100644 --- a/calendar/gui/calendar-config.h +++ b/calendar/gui/calendar-config.h @@ -114,21 +114,11 @@ GSList *calendar_config_get_tasks_selected (void); void calendar_config_set_tasks_selected (GSList *selected); guint calendar_config_add_notification_tasks_selected (GConfClientNotifyFunc func, gpointer data); -/* The primary calendar */ -gchar *calendar_config_get_primary_tasks (void); -void calendar_config_set_primary_tasks (const gchar *primary_uid); -guint calendar_config_add_notification_primary_tasks (GConfClientNotifyFunc func, gpointer data); - /* The current list of memo lists selected */ GSList *calendar_config_get_memos_selected (void); void calendar_config_set_memos_selected (GSList *selected); guint calendar_config_add_notification_memos_selected (GConfClientNotifyFunc func, gpointer data); -/* The primary calendar */ -gchar *calendar_config_get_primary_memos (void); -void calendar_config_set_primary_memos (const gchar *primary_uid); -guint calendar_config_add_notification_primary_memos (GConfClientNotifyFunc func, gpointer data); - /* Settings to hide completed tasks. */ gboolean calendar_config_get_hide_completed_tasks (void); void calendar_config_set_hide_completed_tasks (gboolean hide); diff --git a/configure.ac b/configure.ac index 10c9c0db19..c4a468c719 100644 --- a/configure.ac +++ b/configure.ac @@ -1735,7 +1735,7 @@ plugins_experimental="$plugins_experimental_always $IPOD_SYNC $TNEF_ATTACHMENTS all_plugins_experimental="$plugins_experimental_always ipod-sync tnef-attachments" dnl Temporary KILL-BONOBO hack -enable_plugins="attachment-reminder addressbook-file audio-inline bbdb bogo-junk-plugin caldav calendar-file calendar-http calendar-weather default-mailer default-source email-custom-header external-editor face google-account-setup hula-account-setup imap-features mail-notification mail-to-task mark-all-read plugin-manager prefer-plain profiler pst-import sa-junk-plugin save-calendar startup-wizard subject-thread templates $TNEF_ATTACHMENTS vcard-inline webdav-account-setup" +enable_plugins="attachment-reminder addressbook-file audio-inline bbdb bogo-junk-plugin caldav calendar-file calendar-http calendar-weather default-mailer default-source email-custom-header external-editor face google-account-setup hula-account-setup imap-features itip-formatter mail-notification mail-to-task mark-all-read plugin-manager prefer-plain profiler pst-import sa-junk-plugin save-calendar startup-wizard subject-thread templates $TNEF_ATTACHMENTS vcard-inline webdav-account-setup" dnl PLUGINS NOT BUILDING YET dnl ------------------------ @@ -1743,7 +1743,6 @@ dnl backup-restore dnl exchange-operations dnl groupwise-features dnl ipod-sync -dnl itip-formatter dnl mailing-list-actions dnl mono dnl publish-calendar diff --git a/modules/calendar/e-cal-shell-settings.c b/modules/calendar/e-cal-shell-settings.c index 4d75bae4e9..be50c8e7b3 100644 --- a/modules/calendar/e-cal-shell-settings.c +++ b/modules/calendar/e-cal-shell-settings.c @@ -524,6 +524,14 @@ e_cal_shell_backend_init_settings (EShell *shell) "cal-primary-calendar", "/apps/evolution/calendar/display/primary_calendar"); + e_shell_settings_install_property_for_key ( + "cal-primary-memo-list", + "/apps/evolution/calendar/memos/primary_memos"); + + e_shell_settings_install_property_for_key ( + "cal-primary-task-list", + "/apps/evolution/calendar/tasks/primary_tasks"); + e_shell_settings_install_property_for_key ( "cal-show-event-end-times", "/apps/evolution/calendar/display/show_event_end"); diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index 28f96e553d..f8f6acae9b 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -368,7 +368,6 @@ cal_shell_sidebar_constructed (GObject *object) ECalShellSidebarPrivate *priv; EShell *shell; EShellView *shell_view; - EShellWindow *shell_window; EShellBackend *shell_backend; EShellSidebar *shell_sidebar; EShellSettings *shell_settings; @@ -393,9 +392,8 @@ cal_shell_sidebar_constructed (GObject *object) shell_sidebar = E_SHELL_SIDEBAR (object); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_backend = e_shell_view_get_shell_backend (shell_view); - shell_window = e_shell_view_get_shell_window (shell_view); - shell = e_shell_window_get_shell (shell_window); + shell = e_shell_backend_get_shell (shell_backend); shell_settings = e_shell_get_shell_settings (shell); source_list = e_cal_shell_backend_get_source_list ( diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c index dc072e3062..9642528b78 100644 --- a/modules/calendar/e-memo-shell-backend.c +++ b/modules/calendar/e-memo-shell-backend.c @@ -71,6 +71,8 @@ memo_module_ensure_sources (EShellBackend *shell_backend) ESourceGroup *on_this_computer; ESourceGroup *on_the_web; ESource *personal; + EShell *shell; + EShellSettings *shell_settings; GSList *groups, *iter; const gchar *data_dir; const gchar *name; @@ -83,6 +85,9 @@ memo_module_ensure_sources (EShellBackend *shell_backend) priv = E_MEMO_SHELL_BACKEND_GET_PRIVATE (shell_backend); + shell = e_shell_backend_get_shell (shell_backend); + shell_settings = e_shell_get_shell_settings (shell); + if (!e_cal_get_sources (&priv->source_list, E_CAL_SOURCE_TYPE_JOURNAL, NULL)) { g_warning ("Could not get memo sources from GConf!"); return; @@ -172,7 +177,9 @@ memo_module_ensure_sources (EShellBackend *shell_backend) e_source_group_add_source (on_this_computer, source, -1); g_object_unref (source); - primary = calendar_config_get_primary_memos (); + primary = e_shell_settings_get_string ( + shell_settings, "cal-primary-memo-list"); + selected = calendar_config_get_memos_selected (); if (primary == NULL && selected == NULL) { @@ -181,7 +188,8 @@ memo_module_ensure_sources (EShellBackend *shell_backend) uid = e_source_peek_uid (source); selected = g_slist_prepend (NULL, g_strdup (uid)); - calendar_config_set_primary_memos (uid); + e_shell_settings_set_string ( + shell_settings, "cal-primary-memo-list", uid); calendar_config_set_memos_selected (selected); } @@ -210,30 +218,46 @@ memo_module_ensure_sources (EShellBackend *shell_backend) } static void -memo_module_cal_opened_cb (ECal *cal, - ECalendarStatus status, - GtkAction *action) +memo_shell_backend_memo_new_cb (ECal *cal, + ECalendarStatus status, + EShell *shell) { - EShell *shell; ECalComponent *comp; CompEditor *editor; CompEditorFlags flags = 0; - const gchar *action_name; - - /* FIXME Pass this in. */ - shell = e_shell_get_default (); /* XXX Handle errors better. */ if (status != E_CALENDAR_STATUS_OK) return; - action_name = gtk_action_get_name (action); + flags |= COMP_EDITOR_NEW_ITEM; + + editor = memo_editor_new (cal, shell, flags); + comp = cal_comp_memo_new_with_defaults (cal); + comp_editor_edit_comp (editor, comp); + + gtk_window_present (GTK_WINDOW (editor)); + + g_object_unref (comp); + g_object_unref (cal); +} + +static void +memo_shell_backend_memo_shared_new_cb (ECal *cal, + ECalendarStatus status, + EShell *shell) +{ + ECalComponent *comp; + CompEditor *editor; + CompEditorFlags flags = 0; + + /* XXX Handle errors better. */ + if (status != E_CALENDAR_STATUS_OK) + return; flags |= COMP_EDITOR_NEW_ITEM; - if (strcmp (action_name, "memo-shared-new") == 0) { - flags |= COMP_EDITOR_IS_SHARED; - flags |= COMP_EDITOR_USER_ORG; - } + flags |= COMP_EDITOR_IS_SHARED; + flags |= COMP_EDITOR_USER_ORG; editor = memo_editor_new (cal, shell, flags); comp = cal_comp_memo_new_with_defaults (cal); @@ -252,18 +276,25 @@ action_memo_new_cb (GtkAction *action, ECal *cal = NULL; ECalSourceType source_type; ESourceList *source_list; + EShellSettings *shell_settings; + EShell *shell; + const gchar *action_name; gchar *uid; /* This callback is used for both memos and shared memos. */ source_type = E_CAL_SOURCE_TYPE_JOURNAL; + shell = e_shell_window_get_shell (shell_window); + shell_settings = e_shell_get_shell_settings (shell); + if (!e_cal_get_sources (&source_list, source_type, NULL)) { g_warning ("Could not get memo sources from GConf!"); return; } - uid = calendar_config_get_primary_memos (); + uid = e_shell_settings_get_string ( + shell_settings, "cal-primary-memo-list"); if (uid != NULL) { ESource *source; @@ -279,9 +310,18 @@ action_memo_new_cb (GtkAction *action, g_return_if_fail (cal != NULL); - g_signal_connect ( - cal, "cal-opened", - G_CALLBACK (memo_module_cal_opened_cb), action); + /* Connect the appropriate signal handler. */ + action_name = gtk_action_get_name (action); + if (strcmp (action_name, "memo-shared-new") == 0) + g_signal_connect ( + cal, "cal-opened", + G_CALLBACK (memo_shell_backend_memo_shared_new_cb), + shell); + else + g_signal_connect ( + cal, "cal-opened", + G_CALLBACK (memo_shell_backend_memo_new_cb), + shell); e_cal_open_async (cal, FALSE); } diff --git a/modules/calendar/e-memo-shell-migrate.c b/modules/calendar/e-memo-shell-migrate.c index 20b9fea43e..d2dce309d7 100644 --- a/modules/calendar/e-memo-shell-migrate.c +++ b/modules/calendar/e-memo-shell-migrate.c @@ -32,6 +32,7 @@ #include "calendar/gui/calendar-config.h" #include "calendar/gui/calendar-config-keys.h" +#include "shell/e-shell.h" #define WEBCAL_BASE_URI "webcal://" #define PERSONAL_RELATIVE_URI "system" @@ -44,6 +45,8 @@ create_memo_sources (EShellBackend *shell_backend, ESourceGroup **on_the_web, ESource **personal_source) { + EShell *shell; + EShellSettings *shell_settings; GSList *groups; ESourceGroup *group; gchar *base_uri, *base_uri_proto; @@ -53,6 +56,9 @@ create_memo_sources (EShellBackend *shell_backend, *on_the_web = NULL; *personal_source = NULL; + shell = e_shell_backend_get_shell (shell_backend); + shell_settings = e_shell_get_shell_settings (shell); + base_dir = e_shell_backend_get_config_dir (shell_backend); base_uri = g_build_filename (base_dir, "local", NULL); @@ -100,14 +106,21 @@ create_memo_sources (EShellBackend *shell_backend, } if (!*personal_source) { - /* Create the default Person task list */ + gchar *primary_memo_list; + + /* Create the default Person memo list */ ESource *source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); e_source_group_add_source (*on_this_computer, source, -1); - if (!calendar_config_get_primary_memos () && !calendar_config_get_memos_selected ()) { + primary_memo_list = e_shell_settings_get_string ( + shell_settings, "cal-primary-memo-list"); + + if (!primary_memo_list && !calendar_config_get_memos_selected ()) { GSList selected; - calendar_config_set_primary_memos (e_source_peek_uid (source)); + e_shell_settings_set_string ( + shell_settings, "cal-primary-memo-list", + e_source_peek_uid (source)); selected.data = (gpointer)e_source_peek_uid (source); selected.next = NULL; diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index 0962a8a20d..33a2226c00 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -271,8 +271,12 @@ static void memo_shell_sidebar_primary_selection_changed_cb (EMemoShellSidebar *memo_shell_sidebar, ESourceSelector *selector) { + EShell *shell; + EShellView *shell_view; + EShellWindow *shell_window; + EShellSidebar *shell_sidebar; + EShellSettings *shell_settings; ESource *source; - const gchar *uid; /* XXX ESourceSelector needs a "primary-selection-uid" property * so we can just bind the property with GConfBridge. */ @@ -281,8 +285,16 @@ memo_shell_sidebar_primary_selection_changed_cb (EMemoShellSidebar *memo_shell_s if (source == NULL) return; - uid = e_source_peek_uid (source); - calendar_config_set_primary_memos (uid); + shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar); + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_window = e_shell_view_get_shell_window (shell_view); + + shell = e_shell_window_get_shell (shell_window); + shell_settings = e_shell_get_shell_settings (shell); + + e_shell_settings_set_string ( + shell_settings, "cal-primary-memo-list", + e_source_peek_uid (source)); } static void @@ -337,9 +349,11 @@ static void memo_shell_sidebar_constructed (GObject *object) { EMemoShellSidebarPrivate *priv; + EShell *shell; EShellView *shell_view; EShellBackend *shell_backend; EShellSidebar *shell_sidebar; + EShellSettings *shell_settings; ESourceSelector *selector; ESourceList *source_list; ESource *source; @@ -359,6 +373,9 @@ memo_shell_sidebar_constructed (GObject *object) shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_backend = e_shell_view_get_shell_backend (shell_view); + shell = e_shell_backend_get_shell (shell_backend); + shell_settings = e_shell_get_shell_settings (shell); + source_list = e_memo_shell_backend_get_source_list ( E_MEMO_SHELL_BACKEND (shell_backend)); @@ -394,7 +411,8 @@ memo_shell_sidebar_constructed (GObject *object) object); source = NULL; - uid = calendar_config_get_primary_memos (); + uid = e_shell_settings_get_string ( + shell_settings, "cal-primary-memo-list"); if (uid != NULL) source = e_source_list_peek_source_by_uid (source_list, uid); if (source == NULL) diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c index b9280c7373..23d5e35d7b 100644 --- a/modules/calendar/e-task-shell-backend.c +++ b/modules/calendar/e-task-shell-backend.c @@ -73,6 +73,8 @@ task_module_ensure_sources (EShellBackend *shell_backend) ESourceGroup *on_this_computer; ESourceGroup *on_the_web; ESource *personal; + EShell *shell; + EShellSettings *shell_settings; GSList *groups, *iter; const gchar *data_dir; const gchar *name; @@ -85,6 +87,9 @@ task_module_ensure_sources (EShellBackend *shell_backend) priv = E_TASK_SHELL_BACKEND_GET_PRIVATE (shell_backend); + shell = e_shell_backend_get_shell (shell_backend); + shell_settings = e_shell_get_shell_settings (shell); + if (!e_cal_get_sources (&priv->source_list, E_CAL_SOURCE_TYPE_TODO, NULL)) { g_warning ("Could not get task sources from GConf!"); return; @@ -174,7 +179,9 @@ task_module_ensure_sources (EShellBackend *shell_backend) e_source_group_add_source (on_this_computer, source, -1); g_object_unref (source); - primary = calendar_config_get_primary_tasks (); + primary = e_shell_settings_get_string ( + shell_settings, "cal-primary-task-list"); + selected = calendar_config_get_tasks_selected (); if (primary == NULL && selected == NULL) { @@ -183,7 +190,8 @@ task_module_ensure_sources (EShellBackend *shell_backend) uid = e_source_peek_uid (source); selected = g_slist_prepend (NULL, g_strdup (uid)); - calendar_config_set_primary_tasks (uid); + e_shell_settings_set_string ( + shell_settings, "cal-primary-task-list", uid); calendar_config_set_tasks_selected (selected); } @@ -212,30 +220,46 @@ task_module_ensure_sources (EShellBackend *shell_backend) } static void -task_module_cal_opened_cb (ECal *cal, - ECalendarStatus status, - GtkAction *action) +task_shell_backend_task_new_cb (ECal *cal, + ECalendarStatus status, + EShell *shell) { - EShell *shell; ECalComponent *comp; CompEditor *editor; CompEditorFlags flags = 0; - const gchar *action_name; - - /* FIXME Pass this in. */ - shell = e_shell_get_default (); /* XXX Handle errors better. */ if (status != E_CALENDAR_STATUS_OK) return; - action_name = gtk_action_get_name (action); + flags |= COMP_EDITOR_NEW_ITEM; + + editor = task_editor_new (cal, shell, flags); + comp = cal_comp_task_new_with_defaults (cal); + comp_editor_edit_comp (editor, comp); + + gtk_window_present (GTK_WINDOW (editor)); + + g_object_unref (comp); + g_object_unref (cal); +} + +static void +task_shell_backend_task_assigned_new_cb (ECal *cal, + ECalendarStatus status, + EShell *shell) +{ + ECalComponent *comp; + CompEditor *editor; + CompEditorFlags flags = 0; + + /* XXX Handle errors better. */ + if (status != E_CALENDAR_STATUS_OK) + return; flags |= COMP_EDITOR_NEW_ITEM; - if (strcmp (action_name, "task-assigned-new") == 0) { - flags |= COMP_EDITOR_IS_ASSIGNED; - flags |= COMP_EDITOR_USER_ORG; - } + flags |= COMP_EDITOR_IS_ASSIGNED; + flags |= COMP_EDITOR_USER_ORG; editor = task_editor_new (cal, shell, flags); comp = cal_comp_task_new_with_defaults (cal); @@ -254,18 +278,25 @@ action_task_new_cb (GtkAction *action, ECal *cal = NULL; ECalSourceType source_type; ESourceList *source_list; + EShellSettings *shell_settings; + EShell *shell; + const gchar *action_name; gchar *uid; /* This callback is used for both tasks and assigned tasks. */ source_type = E_CAL_SOURCE_TYPE_TODO; + shell = e_shell_window_get_shell (shell_window); + shell_settings = e_shell_get_shell_settings (shell); + if (!e_cal_get_sources (&source_list, source_type, NULL)) { g_warning ("Could not get task sources from GConf!"); return; } - uid = calendar_config_get_primary_tasks (); + uid = e_shell_settings_get_string ( + shell_settings, "cal-primary-task-list"); if (uid != NULL) { ESource *source; @@ -281,9 +312,18 @@ action_task_new_cb (GtkAction *action, g_return_if_fail (cal != NULL); - g_signal_connect ( - cal, "cal-opened", - G_CALLBACK (task_module_cal_opened_cb), action); + /* Connect the appropriate signal handler. */ + action_name = gtk_action_get_name (action); + if (strcmp (action_name, "task-assigned-new") == 0) + g_signal_connect ( + cal, "cal-opened", + G_CALLBACK (task_shell_backend_task_assigned_new_cb), + shell); + else + g_signal_connect ( + cal, "cal-opened", + G_CALLBACK (task_shell_backend_task_new_cb), + shell); e_cal_open_async (cal, FALSE); } diff --git a/modules/calendar/e-task-shell-migrate.c b/modules/calendar/e-task-shell-migrate.c index 2e7928fd14..4bbaee65a6 100644 --- a/modules/calendar/e-task-shell-migrate.c +++ b/modules/calendar/e-task-shell-migrate.c @@ -42,6 +42,7 @@ #include "e-util/e-util-private.h" #include "calendar/gui/calendar-config.h" #include "calendar/gui/calendar-config-keys.h" +#include "shell/e-shell.h" #define WEBCAL_BASE_URI "webcal://" #define PERSONAL_RELATIVE_URI "system" @@ -443,6 +444,8 @@ create_task_sources (EShellBackend *shell_backend, ESourceGroup **on_the_web, ESource **personal_source) { + EShell *shell; + EShellSettings *shell_settings; GSList *groups; ESourceGroup *group; gchar *base_uri, *base_uri_proto; @@ -452,6 +455,9 @@ create_task_sources (EShellBackend *shell_backend, *on_the_web = NULL; *personal_source = NULL; + shell = e_shell_backend_get_shell (shell_backend); + shell_settings = e_shell_get_shell_settings (shell); + base_dir = e_shell_backend_get_config_dir (shell_backend); base_uri = g_build_filename (base_dir, "local", NULL); @@ -499,14 +505,21 @@ create_task_sources (EShellBackend *shell_backend, } if (!*personal_source) { + gchar *primary_task_list; + /* Create the default Person task list */ ESource *source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); e_source_group_add_source (*on_this_computer, source, -1); - if (!calendar_config_get_primary_tasks () && !calendar_config_get_tasks_selected ()) { + primary_task_list = e_shell_settings_get_string ( + shell_settings, "cal-primary-task-list"); + + if (!primary_task_list && !calendar_config_get_tasks_selected ()) { GSList selected; - calendar_config_set_primary_tasks (e_source_peek_uid (source)); + e_shell_settings_set_string ( + shell_settings, "cal-primary-task-list", + e_source_peek_uid (source)); selected.data = (gpointer)e_source_peek_uid (source); selected.next = NULL; diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c index 827a0a037e..6bd7700fcf 100644 --- a/modules/calendar/e-task-shell-sidebar.c +++ b/modules/calendar/e-task-shell-sidebar.c @@ -269,8 +269,12 @@ static void task_shell_sidebar_primary_selection_changed_cb (ETaskShellSidebar *task_shell_sidebar, ESourceSelector *selector) { + EShell *shell; + EShellView *shell_view; + EShellWindow *shell_window; + EShellSidebar *shell_sidebar; + EShellSettings *shell_settings; ESource *source; - const gchar *uid; /* XXX ESourceSelector needs a "primary-selection-uid" property * so we can just bind the property with GConfBridge. */ @@ -279,8 +283,16 @@ task_shell_sidebar_primary_selection_changed_cb (ETaskShellSidebar *task_shell_s if (source == NULL) return; - uid = e_source_peek_uid (source); - calendar_config_set_primary_tasks (uid); + shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar); + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_window = e_shell_view_get_shell_window (shell_view); + + shell = e_shell_window_get_shell (shell_window); + shell_settings = e_shell_get_shell_settings (shell); + + e_shell_settings_set_string ( + shell_settings, "cal-primary-task-list", + e_source_peek_uid (source)); } static void @@ -335,9 +347,11 @@ static void task_shell_sidebar_constructed (GObject *object) { ETaskShellSidebarPrivate *priv; + EShell *shell; EShellView *shell_view; EShellBackend *shell_backend; EShellSidebar *shell_sidebar; + EShellSettings *shell_settings; ESourceSelector *selector; ESourceList *source_list; ESource *source; @@ -357,6 +371,9 @@ task_shell_sidebar_constructed (GObject *object) shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_backend = e_shell_view_get_shell_backend (shell_view); + shell = e_shell_backend_get_shell (shell_backend); + shell_settings = e_shell_get_shell_settings (shell); + source_list = e_task_shell_backend_get_source_list ( E_TASK_SHELL_BACKEND (shell_backend)); @@ -392,7 +409,8 @@ task_shell_sidebar_constructed (GObject *object) object); source = NULL; - uid = calendar_config_get_primary_tasks (); + uid = e_shell_settings_get_string ( + shell_settings, "cal-primary-task-list"); if (uid != NULL) source = e_source_list_peek_source_by_uid (source_list, uid); if (source == NULL) diff --git a/plugins/itip-formatter/Makefile.am b/plugins/itip-formatter/Makefile.am index 80b70cc6c9..5253742169 100644 --- a/plugins/itip-formatter/Makefile.am +++ b/plugins/itip-formatter/Makefile.am @@ -1,5 +1,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir) \ + -I$(top_srcdir)/widgets \ $(EVOLUTION_MAIL_CFLAGS) \ $(EVOLUTION_CALENDAR_CFLAGS) diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 89313dd995..94f9081ecd 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -57,6 +56,7 @@ #include #include #include +#include #include "itip-view.h" #define CLASSID "itip://" @@ -715,18 +715,27 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) if ((pitip->method == ICAL_METHOD_PUBLISH || pitip->method == ICAL_METHOD_REQUEST) && !pitip->current_ecal) { /* Reuse already declared one or rename? */ + EShell *shell; + EShellSettings *shell_settings; ESource *source = NULL; gchar *uid; + /* FIXME Find a better way to obtain the shell. */ + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); + switch (pitip->type) { case E_CAL_SOURCE_TYPE_EVENT: - uid = calendar_config_get_primary_calendar (); + uid = e_shell_settings_get_string ( + shell_settings, "cal-primary-calendar"); break; case E_CAL_SOURCE_TYPE_TODO: - uid = calendar_config_get_primary_tasks (); + uid = e_shell_settings_get_string ( + shell_settings, "cal-primary-task-list"); break; case E_CAL_SOURCE_TYPE_JOURNAL: - uid = calendar_config_get_primary_memos (); + uid = e_shell_settings_get_string ( + shell_settings, "cal-primary-memo-list"); break; default: uid = NULL; -- cgit v1.2.3