From ba1c4eade6a41d285fae59969f2db4b253139041 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 1 Apr 2010 15:33:04 +0200 Subject: Bug #613356 - Calendar doesn't save Task/Memo table state --- modules/calendar/e-cal-shell-view-private.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/calendar/e-cal-shell-view-private.c') diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 5fc42feacc..8806ad691b 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -591,6 +591,10 @@ e_cal_shell_view_private_dispose (ECalShellView *cal_shell_view) { ECalShellViewPrivate *priv = cal_shell_view->priv; + /* Calling calendar's save state from here, because it is too late in its dispose */ + if (priv->cal_shell_content) + e_cal_shell_content_save_state (priv->cal_shell_content); + DISPOSE (priv->cal_shell_backend); DISPOSE (priv->cal_shell_content); DISPOSE (priv->cal_shell_sidebar); -- cgit From b276c75c7c0f537cf4f5d122b1bff41420ca3232 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 1 Apr 2010 16:18:40 +0200 Subject: Bug #613352 - Changed time range not propagated to calendar --- modules/calendar/e-cal-shell-view-private.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules/calendar/e-cal-shell-view-private.c') diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 8806ad691b..dc30897aab 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -219,7 +219,7 @@ cal_shell_view_date_navigator_scroll_event_cb (ECalShellView *cal_shell_view, * we could move this handler into ECalShellSidebar. */ e_calendar_item_set_selection (calitem, &start_date, &end_date); - cal_shell_view_date_navigator_date_range_changed_cb ( + cal_shell_view_date_navigator_selection_changed_cb ( cal_shell_view, calitem); } @@ -459,8 +459,10 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar); date_navigator = e_cal_shell_sidebar_get_date_navigator (cal_shell_sidebar); - /* Give GnomeCalendar a handle to the date navigator. */ + /* Give GnomeCalendar a handle to the date navigator, memo and task table. */ gnome_calendar_set_date_navigator (calendar, date_navigator); + gnome_calendar_set_memo_table (calendar, memo_table ? GTK_WIDGET (memo_table) : NULL); + gnome_calendar_set_task_table (calendar, task_table ? GTK_WIDGET (task_table) : NULL); e_calendar_item_set_get_time_callback ( date_navigator->calitem, (ECalendarItemGetTimeCallback) -- cgit From 4cc6bd4673115dff52a403d31e9613deea402d0e Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Fri, 19 Mar 2010 22:41:25 +0530 Subject: Redo Calendar for express mode. Just design/layout changes. --- modules/calendar/e-cal-shell-view-private.c | 56 ++++++++++++++++------------- 1 file changed, 31 insertions(+), 25 deletions(-) (limited to 'modules/calendar/e-cal-shell-view-private.c') diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index dc30897aab..1c9c26840c 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -535,35 +535,41 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) G_CALLBACK (cal_shell_view_selector_client_removed_cb), cal_shell_view); - g_signal_connect_swapped ( - memo_table, "popup-event", - G_CALLBACK (cal_shell_view_memopad_popup_event_cb), - cal_shell_view); - - g_signal_connect_swapped ( - memo_table, "selection-change", - G_CALLBACK (e_cal_shell_view_memopad_actions_update), - cal_shell_view); + if (memo_table) + g_signal_connect_swapped ( + memo_table, "popup-event", + G_CALLBACK (cal_shell_view_memopad_popup_event_cb), + cal_shell_view); - g_signal_connect_swapped ( - memo_table, "status-message", - G_CALLBACK (e_cal_shell_view_memopad_set_status_message), - cal_shell_view); + if (memo_table) + g_signal_connect_swapped ( + memo_table, "selection-change", + G_CALLBACK (e_cal_shell_view_memopad_actions_update), + cal_shell_view); - g_signal_connect_swapped ( - task_table, "popup-event", - G_CALLBACK (cal_shell_view_taskpad_popup_event_cb), - cal_shell_view); + if (memo_table) + g_signal_connect_swapped ( + memo_table, "status-message", + G_CALLBACK (e_cal_shell_view_memopad_set_status_message), + cal_shell_view); - g_signal_connect_swapped ( - task_table, "status-message", - G_CALLBACK (e_cal_shell_view_taskpad_set_status_message), - cal_shell_view); + if (task_table) + g_signal_connect_swapped ( + task_table, "popup-event", + G_CALLBACK (cal_shell_view_taskpad_popup_event_cb), + cal_shell_view); - g_signal_connect_swapped ( - task_table, "selection-change", - G_CALLBACK (e_cal_shell_view_taskpad_actions_update), - cal_shell_view); + if (task_table) + g_signal_connect_swapped ( + task_table, "status-message", + G_CALLBACK (e_cal_shell_view_taskpad_set_status_message), + cal_shell_view); + + if (task_table) + g_signal_connect_swapped ( + task_table, "selection-change", + G_CALLBACK (e_cal_shell_view_taskpad_actions_update), + cal_shell_view); e_categories_add_change_hook ( (GHookFunc) e_cal_shell_view_update_search_filter, -- cgit From dac959d85813debca9762eaf4c4cf8cebc1090fe Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Fri, 16 Apr 2010 13:37:40 +0200 Subject: Bug 596601 (bnc) - monitor system timezone changes in evolution --- modules/calendar/e-cal-shell-view-private.c | 85 ++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) (limited to 'modules/calendar/e-cal-shell-view-private.c') diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index dc30897aab..c669c29b33 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -26,6 +26,16 @@ #include "calendar/gui/calendar-view-factory.h" #include "widgets/menus/gal-view-factory-etable.h" +#define CHECK_NB 5 + +static const gchar * files_to_check [CHECK_NB] = { + ETC_TIMEZONE, + ETC_TIMEZONE_MAJ, + ETC_SYSCONFIG_CLOCK, + ETC_CONF_D_CLOCK, + ETC_LOCALTIME +}; + static void cal_shell_view_process_completed_tasks (ECalShellView *cal_shell_view, gboolean config_changed) @@ -416,6 +426,72 @@ e_cal_shell_view_private_init (ECalShellView *cal_shell_view, G_CALLBACK (cal_shell_view_notify_view_id_cb), NULL); } + +static void +system_timezone_monitor_changed (GFileMonitor *handle, + GFile *file, + GFile *other_file, + GFileMonitorEvent event, + gpointer user_data) +{ + ECalShellView *view = E_CAL_SHELL_VIEW (user_data); + ECalShellViewPrivate *priv = view->priv; + ECalShellContent *cal_shell_content; + icaltimezone *timezone = NULL, *current_zone = NULL; + EShellSettings *settings; + EShellBackend *shell_backend; + EShell *shell; + ECalModel *model; + const gchar *location; + + if (event != G_FILE_MONITOR_EVENT_CHANGED && + event != G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT && + event != G_FILE_MONITOR_EVENT_DELETED && + event != G_FILE_MONITOR_EVENT_CREATED) + return; + + cal_shell_content = priv->cal_shell_content; + model = e_cal_shell_content_get_model (cal_shell_content); + current_zone = e_cal_model_get_timezone (model); + timezone = e_cal_util_get_system_timezone (); + + if (!g_strcmp0 (icaltimezone_get_tzid (timezone), icaltimezone_get_tzid (current_zone))) + return; + + shell_backend = e_shell_view_get_shell_backend ((EShellView *) view); + shell = e_shell_backend_get_shell (shell_backend); + settings = e_shell_get_shell_settings (shell); + location = icaltimezone_get_location (timezone); + if (location == NULL) + location = "UTC"; + + g_object_set (settings, "cal-timezone-string", location, NULL); + g_object_set (settings, "cal-timezone", timezone, NULL); +} + +static void +init_timezone_monitors (ECalShellView *view) +{ + ECalShellViewPrivate *priv = view->priv; + gint i; + + for (i = 0; i < CHECK_NB; i++) { + GFile *file; + + file = g_file_new_for_path (files_to_check[i]); + priv->monitors[i] = g_file_monitor_file (file, + G_FILE_MONITOR_NONE, + NULL, NULL); + g_object_unref (file); + + if (priv->monitors[i]) + g_signal_connect (G_OBJECT (priv->monitors[i]), + "changed", + G_CALLBACK (system_timezone_monitor_changed), + view); + } +} + void e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) { @@ -569,6 +645,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) (GHookFunc) e_cal_shell_view_update_search_filter, cal_shell_view); + init_timezone_monitors (cal_shell_view); e_cal_shell_view_actions_init (cal_shell_view); e_cal_shell_view_update_sidebar (cal_shell_view); e_cal_shell_view_update_search_filter (cal_shell_view); @@ -592,6 +669,7 @@ void e_cal_shell_view_private_dispose (ECalShellView *cal_shell_view) { ECalShellViewPrivate *priv = cal_shell_view->priv; + gint i; /* Calling calendar's save state from here, because it is too late in its dispose */ if (priv->cal_shell_content) @@ -621,6 +699,11 @@ e_cal_shell_view_private_dispose (ECalShellView *cal_shell_view) g_object_unref (priv->taskpad_activity); priv->taskpad_activity = NULL; } + + for (i = 0; i < CHECK_NB; i++) { + g_object_unref (priv->monitors[i]); + priv->monitors[i] = NULL; + } } void @@ -982,7 +1065,7 @@ e_cal_shell_view_update_timezone (ECalShellView *cal_shell_view) cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar; clients = e_cal_shell_sidebar_get_clients (cal_shell_sidebar); - + for (iter = clients; iter != NULL; iter = iter->next) { ECal *client = iter->data; -- cgit From 51f5d2876da1d8dea05ef7362110ef94d2b2d13a Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 23 Apr 2010 10:29:34 +0100 Subject: add defines to ease MeeGo building --- modules/calendar/e-cal-shell-view-private.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules/calendar/e-cal-shell-view-private.c') diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 4730ca004b..4d6f8e3144 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -28,6 +28,16 @@ #define CHECK_NB 5 +/* be compatible with older e-d-s for MeeGo */ +#ifndef ETC_TIMEZONE +# define ETC_TIMEZONE "/etc/timezone" +# define ETC_TIMEZONE_MAJ "/etc/TIMEZONE" +# define ETC_RC_CONF "/etc/rc.conf" +# define ETC_SYSCONFIG_CLOCK "/etc/sysconfig/clock" +# define ETC_CONF_D_CLOCK "/etc/conf.d/clock" +# define ETC_LOCALTIME "/etc/localtime +#endif + static const gchar * files_to_check [CHECK_NB] = { ETC_TIMEZONE, ETC_TIMEZONE_MAJ, -- cgit From 554a8acb0567923bff6f9e4d9c20b213e9165c3c Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 23 Apr 2010 10:32:54 +0100 Subject: fix build snafu (urk) --- modules/calendar/e-cal-shell-view-private.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/calendar/e-cal-shell-view-private.c') diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 4d6f8e3144..a958a9f05e 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -35,7 +35,7 @@ # define ETC_RC_CONF "/etc/rc.conf" # define ETC_SYSCONFIG_CLOCK "/etc/sysconfig/clock" # define ETC_CONF_D_CLOCK "/etc/conf.d/clock" -# define ETC_LOCALTIME "/etc/localtime +# define ETC_LOCALTIME "/etc/localtime" #endif static const gchar * files_to_check [CHECK_NB] = { -- cgit From 96538878911586a9e9ca26b81e1916c04e538980 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 25 May 2010 10:15:32 -0400 Subject: Coding style and whitespace cleanup. --- modules/calendar/e-cal-shell-view-private.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'modules/calendar/e-cal-shell-view-private.c') diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index a958a9f05e..43b8ae61cd 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -436,7 +436,6 @@ e_cal_shell_view_private_init (ECalShellView *cal_shell_view, G_CALLBACK (cal_shell_view_notify_view_id_cb), NULL); } - static void system_timezone_monitor_changed (GFileMonitor *handle, GFile *file, @@ -453,12 +452,12 @@ system_timezone_monitor_changed (GFileMonitor *handle, EShell *shell; ECalModel *model; const gchar *location; - - if (event != G_FILE_MONITOR_EVENT_CHANGED && - event != G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT && - event != G_FILE_MONITOR_EVENT_DELETED && - event != G_FILE_MONITOR_EVENT_CREATED) - return; + + if (event != G_FILE_MONITOR_EVENT_CHANGED && + event != G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT && + event != G_FILE_MONITOR_EVENT_DELETED && + event != G_FILE_MONITOR_EVENT_CREATED) + return; cal_shell_content = priv->cal_shell_content; model = e_cal_shell_content_get_model (cal_shell_content); @@ -474,7 +473,7 @@ system_timezone_monitor_changed (GFileMonitor *handle, location = icaltimezone_get_location (timezone); if (location == NULL) location = "UTC"; - + g_object_set (settings, "cal-timezone-string", location, NULL); g_object_set (settings, "cal-timezone", timezone, NULL); } @@ -496,7 +495,7 @@ init_timezone_monitors (ECalShellView *view) if (priv->monitors[i]) g_signal_connect (G_OBJECT (priv->monitors[i]), - "changed", + "changed", G_CALLBACK (system_timezone_monitor_changed), view); } @@ -621,7 +620,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) G_CALLBACK (cal_shell_view_selector_client_removed_cb), cal_shell_view); - if (memo_table) + if (memo_table) g_signal_connect_swapped ( memo_table, "popup-event", G_CALLBACK (cal_shell_view_memopad_popup_event_cb), @@ -650,7 +649,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) task_table, "status-message", G_CALLBACK (e_cal_shell_view_taskpad_set_status_message), cal_shell_view); - + if (task_table) g_signal_connect_swapped ( task_table, "selection-change", @@ -1081,7 +1080,7 @@ e_cal_shell_view_update_timezone (ECalShellView *cal_shell_view) cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar; clients = e_cal_shell_sidebar_get_clients (cal_shell_sidebar); - + for (iter = clients; iter != NULL; iter = iter->next) { ECal *client = iter->data; -- cgit