aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/e-tasks.c592
-rw-r--r--calendar/gui/e-tasks.h14
-rw-r--r--calendar/gui/gnome-cal.c279
-rw-r--r--calendar/gui/gnome-cal.h3
-rw-r--r--calendar/gui/main.c9
-rw-r--r--calendar/modules/e-cal-shell-module.c20
-rw-r--r--calendar/modules/e-cal-shell-sidebar.c45
-rw-r--r--calendar/modules/e-cal-shell-sidebar.h3
-rw-r--r--calendar/modules/e-cal-shell-view-actions.c4
-rw-r--r--calendar/modules/e-cal-shell-view-private.c132
-rw-r--r--calendar/modules/e-cal-shell-view-private.h2
-rw-r--r--calendar/modules/e-task-shell-content.c2
-rw-r--r--calendar/modules/e-task-shell-sidebar.c48
-rw-r--r--calendar/modules/e-task-shell-sidebar.h1
-rw-r--r--calendar/modules/e-task-shell-view-private.c149
-rw-r--r--calendar/modules/e-task-shell-view-private.h6
16 files changed, 285 insertions, 1024 deletions
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
index 7860217045..ebf8c91df6 100644
--- a/calendar/gui/e-tasks.c
+++ b/calendar/gui/e-tasks.c
@@ -74,9 +74,6 @@ struct _ETasksPrivate {
/* Calendar search bar for tasks */
GtkWidget *search_bar;
- /* Tasks menu */
- ECalMenu *tasks_menu;
-
/* Paned widget */
GtkWidget *paned;
@@ -87,18 +84,12 @@ struct _ETasksPrivate {
char *sexp;
guint update_timeout;
- /* View instance and the view menus handler */
- GalViewInstance *view_instance;
- GalViewMenus *view_menus;
-
GList *notifications;
};
static void setup_widgets (ETasks *tasks);
static void e_tasks_destroy (GtkObject *object);
-static void update_view (ETasks *tasks);
-static void categories_changed_cb (gpointer object, gpointer user_data);
static void backend_error_cb (ECal *client, const char *message, gpointer data);
/* Signal IDs */
@@ -113,112 +104,6 @@ static guint e_tasks_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (ETasks, e_tasks, GTK_TYPE_TABLE)
-/* Callback used when the cursor changes in the table */
-static void
-table_cursor_change_cb (ETable *etable, int row, gpointer data)
-{
- ETasks *tasks;
- ETasksPrivate *priv;
- ECalModel *model;
- ECalModelComponent *comp_data;
- ECalComponent *comp;
- const char *uid;
-
- int n_selected;
-
- tasks = E_TASKS (data);
- priv = tasks->priv;
-
- n_selected = e_table_selected_count (etable);
-
- /* update the HTML widget */
- if (n_selected != 1) {
- e_cal_component_preview_clear (E_CAL_COMPONENT_PREVIEW (priv->preview));
-
- return;
- }
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
-
- comp_data = e_cal_model_get_component_at (model, e_table_get_cursor_row (etable));
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
-
- e_cal_component_preview_display (E_CAL_COMPONENT_PREVIEW (priv->preview), comp_data->client, comp);
-
- e_cal_component_get_uid (comp, &uid);
- if (priv->current_uid)
- g_free (priv->current_uid);
- priv->current_uid = g_strdup (uid);
-
- g_object_unref (comp);
-}
-
-ECalMenu *
-e_tasks_get_tasks_menu (ETasks *tasks)
-{
- g_return_val_if_fail (E_IS_TASKS (tasks), NULL);
-
- return tasks->priv->tasks_menu;
-}
-
-
-/* Callback used when the selection changes in the table. */
-static void
-table_selection_change_cb (ETable *etable, gpointer data)
-{
- ETasks *tasks;
- int n_selected;
-
- tasks = E_TASKS (data);
-
- n_selected = e_table_selected_count (etable);
- g_signal_emit (tasks, e_tasks_signals[SELECTION_CHANGED], 0, n_selected);
-
- if (n_selected != 1)
- e_cal_component_preview_clear (E_CAL_COMPONENT_PREVIEW (tasks->priv->preview));
-}
-
-static void
-user_created_cb (GtkWidget *view, ETasks *tasks)
-{
- ETasksPrivate *priv;
- ECalendarTable *cal_table;
- ECal *ecal;
-
- priv = tasks->priv;
- cal_table = E_CALENDAR_TABLE (priv->tasks_view);
-
- if (cal_table->user_created_cal)
- ecal = cal_table->user_created_cal;
- else {
- ECalModel *model;
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
- ecal = e_cal_model_get_default_client (model);
- }
-
- e_tasks_add_todo_source (tasks, e_cal_get_source (ecal));
-}
-
-/* Callback used when the sexp in the search bar changes */
-static void
-search_bar_sexp_changed_cb (CalSearchBar *cal_search, const char *sexp, gpointer data)
-{
- ETasks *tasks;
- ETasksPrivate *priv;
-
- tasks = E_TASKS (data);
- priv = tasks->priv;
-
- if (priv->sexp)
- g_free (priv->sexp);
-
- priv->sexp = g_strdup (sexp);
-
- update_view (tasks);
-}
-
/* Callback used when the selected category in the search bar changes */
static void
search_bar_category_changed_cb (CalSearchBar *cal_search, const char *category, gpointer data)
@@ -234,194 +119,6 @@ search_bar_category_changed_cb (CalSearchBar *cal_search, const char *category,
e_cal_model_set_default_category (model, category);
}
-static gboolean
-vpaned_resized_cb (GtkWidget *widget, GdkEventButton *event, ETasks *tasks)
-{
- calendar_config_set_task_vpane_pos (gtk_paned_get_position (GTK_PANED (widget)));
-
- return FALSE;
-}
-
-static void
-set_timezone (ETasks *tasks)
-{
- ETasksPrivate *priv;
- icaltimezone *zone;
- GList *l;
-
- priv = tasks->priv;
-
- zone = calendar_config_get_icaltimezone ();
- for (l = priv->clients_list; l != NULL; l = l->next) {
- ECal *client = l->data;
- /* FIXME Error checking */
- e_cal_set_default_timezone (client, zone, NULL);
- }
-
- if (priv->default_client)
- /* FIXME Error checking */
- e_cal_set_default_timezone (priv->default_client, zone, NULL);
-
- if (priv->preview)
- e_cal_component_preview_set_default_timezone (E_CAL_COMPONENT_PREVIEW (priv->preview), zone);
-}
-
-static void
-timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- ETasks *tasks = data;
-
- set_timezone (tasks);
-}
-
-static void
-update_view (ETasks *tasks)
-{
- ETasksPrivate *priv;
- ECalModel *model;
- char *real_sexp = NULL;
- char *new_sexp = NULL;
-
- priv = tasks->priv;
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
-
- if ((new_sexp = calendar_config_get_hide_completed_tasks_sexp (FALSE)) != NULL) {
- real_sexp = g_strdup_printf ("(and %s %s)", new_sexp, priv->sexp);
- e_cal_model_set_search_query (model, real_sexp);
- g_free (new_sexp);
- g_free (real_sexp);
- } else
- e_cal_model_set_search_query (model, priv->sexp);
-
- e_cal_component_preview_clear (E_CAL_COMPONENT_PREVIEW (priv->preview));
-}
-
-static void
-process_completed_tasks (ETasks *tasks, gboolean config_changed)
-{
- ETasksPrivate *priv;
-
- g_return_if_fail (tasks != NULL);
- g_return_if_fail (E_IS_TASKS (tasks));
-
- priv = tasks->priv;
-
- e_calendar_table_process_completed_tasks (e_tasks_get_calendar_table (tasks), priv->clients_list, config_changed);
-}
-
-static gboolean
-update_view_cb (ETasks *tasks)
-{
- ECalModel *model;
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (tasks->priv->tasks_view));
-
- process_completed_tasks (tasks, FALSE);
- e_cal_model_tasks_update_due_tasks (E_CAL_MODEL_TASKS (model));
-
- return TRUE;
-}
-
-static void
-config_hide_completed_tasks_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- process_completed_tasks (data, TRUE);
- update_view (data);
-}
-
-static void
-model_row_changed_cb (ETableModel *etm, int row, gpointer data)
-{
- ETasks *tasks;
- ETasksPrivate *priv;
- ECalModelComponent *comp_data;
-
- tasks = E_TASKS (data);
- priv = tasks->priv;
-
- if (priv->current_uid) {
- const char *uid;
-
- comp_data = e_cal_model_get_component_at (E_CAL_MODEL (etm), row);
- if (comp_data) {
- uid = icalcomponent_get_uid (comp_data->icalcomp);
- if (!strcmp (uid ? uid : "", priv->current_uid)) {
- ETable *etable;
-
- etable = e_table_scrolled_get_table (
- E_TABLE_SCROLLED (E_CALENDAR_TABLE (priv->tasks_view)->etable));
- table_cursor_change_cb (etable, 0, tasks);
- }
- }
- }
-}
-
-static void
-view_progress_cb (ECalModel *model, const char *message, int percent, ECalSourceType type, ETasks *tasks)
-{
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)),
- message, percent);
-}
-
-static void
-view_done_cb (ECalModel *model, ECalendarStatus status, ECalSourceType type, ETasks *tasks)
-{
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)),
- NULL, -1);
-
-}
-
-static void
-config_preview_state_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
- gboolean state;
- GConfValue *value;
- ETasks *tasks = (ETasks *)data;
-
- g_return_if_fail (gconf_entry_get_key (entry) != NULL);
- g_return_if_fail ((value = gconf_entry_get_value (entry)) != NULL);
-
- state = gconf_value_get_bool (value);
- e_tasks_show_preview (tasks, state);
- bonobo_ui_component_set_prop (E_SEARCH_BAR (tasks->priv->search_bar)->ui_component, "/commands/ViewPreview", "state", state ? "1" : "0", NULL);
-}
-
-static void
-setup_config (ETasks *tasks)
-{
- ETasksPrivate *priv;
- guint not;
-
- priv = tasks->priv;
-
- /* Timezone */
- set_timezone (tasks);
-
- not = calendar_config_add_notification_timezone (timezone_changed_cb, tasks);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- not = calendar_config_add_notification_hide_completed_tasks (config_hide_completed_tasks_changed_cb,
- tasks);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- not = calendar_config_add_notification_hide_completed_tasks_units (config_hide_completed_tasks_changed_cb,
- tasks);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- not = calendar_config_add_notification_hide_completed_tasks_value (config_hide_completed_tasks_changed_cb,
- tasks);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-
- not = calendar_config_add_notification_preview_state (config_preview_state_changed_cb, tasks);
- priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
-}
-
-struct AffectedComponents {
- ECalendarTable *cal_table;
- GSList *components; /* contains pointers to ECalModelComponent */
-};
-
/**
* get_selected_components_cb
* Helper function to fill list of selected components in ECalendarTable.
@@ -605,7 +302,6 @@ setup_widgets (ETasks *tasks)
G_CALLBACK (search_bar_sexp_changed_cb), tasks);
g_signal_connect (priv->search_bar, "category_changed",
G_CALLBACK (search_bar_category_changed_cb), tasks);
- categories_changed_cb (NULL, tasks);
gtk_table_attach (GTK_TABLE (tasks), priv->search_bar, 0, 1, 0, 1,
GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0);
@@ -615,8 +311,6 @@ setup_widgets (ETasks *tasks)
priv->paned = gtk_vpaned_new ();
g_signal_connect (priv->paned, "realize", G_CALLBACK (pane_realized), tasks);
- g_signal_connect (G_OBJECT (priv->paned), "button_release_event",
- G_CALLBACK (vpaned_resized_cb), tasks);
gtk_table_attach (GTK_TABLE (tasks), priv->paned, 0, 1, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (priv->paned);
@@ -656,12 +350,8 @@ setup_widgets (ETasks *tasks)
"table_drag_data_received", G_CALLBACK(table_drag_data_received_cb), editor);
*/
- g_signal_connect (etable, "cursor_change", G_CALLBACK (table_cursor_change_cb), tasks);
g_signal_connect (etable, "selection_change", G_CALLBACK (table_selection_change_cb), tasks);
- /* Timeout check to hide completed items */
- priv->update_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_view_cb, tasks, NULL);
-
/* create the task detail */
priv->preview = e_cal_component_preview_new ();
e_cal_component_preview_set_default_timezone (E_CAL_COMPONENT_PREVIEW (priv->preview), calendar_config_get_icaltimezone ());
@@ -670,15 +360,6 @@ setup_widgets (ETasks *tasks)
if (state)
gtk_widget_show (priv->preview);
-
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
- g_signal_connect (G_OBJECT (model), "model_row_changed",
- G_CALLBACK (model_row_changed_cb), tasks);
-
- g_signal_connect (G_OBJECT (model), "cal_view_progress",
- G_CALLBACK (view_progress_cb), tasks);
- g_signal_connect (G_OBJECT (model), "cal_view_done",
- G_CALLBACK (view_done_cb), tasks);
}
/* Class initialization function for the gnome calendar */
@@ -729,29 +410,6 @@ e_tasks_class_init (ETasksClass *class)
}
-static void
-categories_changed_cb (gpointer object, gpointer user_data)
-{
- GList *cat_list;
- GPtrArray *cat_array;
- ETasksPrivate *priv;
- ETasks *tasks = user_data;
-
- priv = tasks->priv;
-
- cat_array = g_ptr_array_new ();
- cat_list = e_categories_get_list ();
- while (cat_list != NULL) {
- if (e_categories_is_searchable ((const char *) cat_list->data))
- g_ptr_array_add (cat_array, cat_list->data);
- cat_list = g_list_remove (cat_list, cat_list->data);
- }
-
- cal_search_bar_set_categories ((CalSearchBar *)priv->search_bar, cat_array);
-
- g_ptr_array_free (cat_array, TRUE);
-}
-
/* Object initialization function for the gnome calendar */
static void
e_tasks_init (ETasks *tasks)
@@ -761,20 +419,13 @@ e_tasks_init (ETasks *tasks)
priv = g_new0 (ETasksPrivate, 1);
tasks->priv = priv;
- e_categories_register_change_listener (G_CALLBACK (categories_changed_cb), tasks);
-
- setup_config (tasks);
setup_widgets (tasks);
priv->clients = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
priv->query = NULL;
- priv->view_instance = NULL;
- priv->view_menus = NULL;
priv->current_uid = NULL;
priv->sexp = g_strdup ("#t");
priv->default_client = NULL;
- priv->tasks_menu = e_cal_menu_new ("org.gnome.evolution.tasks.view");
- update_view (tasks);
}
GtkWidget *
@@ -787,18 +438,6 @@ e_tasks_new (void)
return GTK_WIDGET (tasks);
}
-
-void
-e_tasks_set_ui_component (ETasks *tasks,
- BonoboUIComponent *ui_component)
-{
- g_return_if_fail (E_IS_TASKS (tasks));
- g_return_if_fail (ui_component == NULL || BONOBO_IS_UI_COMPONENT (ui_component));
-
- e_search_bar_set_ui_component (E_SEARCH_BAR (tasks->priv->search_bar), ui_component);
-}
-
-
static void
e_tasks_destroy (GtkObject *object)
{
@@ -814,8 +453,6 @@ e_tasks_destroy (GtkObject *object)
if (priv) {
GList *l;
- e_categories_unregister_change_listener (G_CALLBACK (categories_changed_cb), tasks);
-
/* disconnect from signals on all the clients */
for (l = priv->clients_list; l != NULL; l = l->next) {
g_signal_handlers_disconnect_matched (l->data, G_SIGNAL_MATCH_DATA,
@@ -839,11 +476,6 @@ e_tasks_destroy (GtkObject *object)
priv->sexp = NULL;
}
- if (priv->update_timeout) {
- g_source_remove (priv->update_timeout);
- priv->update_timeout = 0;
- }
-
if (priv->tasks_view_config) {
g_object_unref (priv->tasks_view_config);
priv->tasks_view_config = NULL;
@@ -880,101 +512,6 @@ set_status_message (ETasks *tasks, const char *message, ...)
e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->tasks_view), msg_string, -1);
}
-/* Callback from the calendar client when the calendar is opened */
-static void
-client_cal_opened_cb (ECal *ecal, ECalendarStatus status, ETasks *tasks)
-{
- ECalModel *model;
- ESource *source;
- ETasksPrivate *priv;
-
- priv = tasks->priv;
-
- source = e_cal_get_source (ecal);
-
- if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED)
- auth_cal_forget_password (ecal);
-
- switch (status) {
- case E_CALENDAR_STATUS_OK :
- g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, client_cal_opened_cb, NULL);
-
- set_status_message (tasks, _("Loading tasks"));
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
- e_cal_model_add_client (model, ecal);
-
- set_status_message (tasks, NULL);
- break;
- case E_CALENDAR_STATUS_BUSY :
- break;
- case E_CALENDAR_STATUS_REPOSITORY_OFFLINE:
- e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))), "calendar:prompt-no-contents-offline-tasks", NULL);
- default :
- /* Make sure the source doesn't disappear on us */
- g_object_ref (source);
-
- priv->clients_list = g_list_remove (priv->clients_list, ecal);
- g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, tasks);
-
- /* Do this last because it unrefs the client */
- g_hash_table_remove (priv->clients, e_source_peek_uid (source));
-
- g_signal_emit (tasks, e_tasks_signals[SOURCE_REMOVED], 0, source);
-
- set_status_message (tasks, NULL);
- g_object_unref (source);
-
- break;
- }
-}
-
-static void
-default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, ETasks *tasks)
-{
- ECalModel *model;
- ESource *source;
- ETasksPrivate *priv;
-
- priv = tasks->priv;
-
- source = e_cal_get_source (ecal);
-
- if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED)
- auth_cal_forget_password (ecal);
-
- switch (status) {
- case E_CALENDAR_STATUS_OK :
- g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL);
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
-
- e_cal_model_set_default_client (model, ecal);
- set_status_message (tasks, NULL);
- break;
- case E_CALENDAR_STATUS_BUSY:
- break;
- default :
- /* Make sure the source doesn't disappear on us */
- g_object_ref (source);
-
- priv->clients_list = g_list_remove (priv->clients_list, ecal);
- g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, tasks);
-
- /* Do this last because it unrefs the client */
- g_hash_table_remove (priv->clients, e_source_peek_uid (source));
-
- g_signal_emit (tasks, e_tasks_signals[SOURCE_REMOVED], 0, source);
-
- set_status_message (tasks, NULL);
- g_object_unref (priv->default_client);
- priv->default_client = NULL;
- g_object_unref (source);
-
- break;
- }
-}
-
typedef void (*open_func) (ECal *, ECalendarStatus, ETasks *);
static gboolean
@@ -1039,52 +576,6 @@ e_tasks_new_task (ETasks *tasks)
gtk_window_present (GTK_WINDOW (editor));
}
-void
-e_tasks_show_preview (ETasks *tasks, gboolean state)
-{
- ETasksPrivate *priv;
-
- g_return_if_fail (tasks != NULL);
- g_return_if_fail (E_IS_TASKS (tasks));
- priv = tasks->priv;
-
- if (state) {
- ECalModel *model;
- ECalModelComponent *comp_data;
- ECalComponent *comp;
- ETable *etable;
- const char *uid;
- int n_selected;
-
- etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (E_CALENDAR_TABLE (priv->tasks_view)->etable));
- n_selected = e_table_selected_count (etable);
-
- if (n_selected != 1) {
- e_cal_component_preview_clear (E_CAL_COMPONENT_PREVIEW (priv->preview));
- } else {
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
-
- comp_data = e_cal_model_get_component_at (model, e_table_get_cursor_row (etable));
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
-
- e_cal_component_preview_display (E_CAL_COMPONENT_PREVIEW (priv->preview), comp_data->client, comp);
-
- e_cal_component_get_uid (comp, &uid);
- if (priv->current_uid)
- g_free (priv->current_uid);
- priv->current_uid = g_strdup (uid);
-
- g_object_unref (comp);
- }
- gtk_widget_show (priv->preview);
-
- } else {
- e_cal_component_preview_clear (E_CAL_COMPONENT_PREVIEW (priv->preview));
- gtk_widget_hide (priv->preview);
- }
-}
-
gboolean
e_tasks_remove_todo_source (ETasks *tasks, ESource *source)
{
@@ -1150,68 +641,6 @@ e_tasks_set_default_source (ETasks *tasks, ESource *source)
return TRUE;
}
-ECal *
-e_tasks_get_default_client (ETasks *tasks)
-{
- ETasksPrivate *priv;
-
- g_return_val_if_fail (tasks != NULL, NULL);
- g_return_val_if_fail (E_IS_TASKS (tasks), NULL);
-
- priv = tasks->priv;
-
- return e_cal_model_get_default_client (e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view)));
-}
-
-/**
- * e_tasks_complete_selected:
- * @tasks: A tasks control widget
- *
- * Marks the selected tasks complete
- **/
-void
-e_tasks_complete_selected (ETasks *tasks)
-{
- ETasksPrivate *priv;
- ECalendarTable *cal_table;
-
- g_return_if_fail (tasks != NULL);
- g_return_if_fail (E_IS_TASKS (tasks));
-
- priv = tasks->priv;
-
- cal_table = E_CALENDAR_TABLE (priv->tasks_view);
-
- set_status_message (tasks, _("Completing tasks..."));
- e_calendar_table_complete_selected (cal_table);
- set_status_message (tasks, NULL);
-}
-
-/**
- * e_tasks_delete_selected:
- * @tasks: A tasks control widget.
- *
- * Deletes the selected tasks in the task list.
- **/
-void
-e_tasks_delete_selected (ETasks *tasks)
-{
- ETasksPrivate *priv;
- ECalendarTable *cal_table;
-
- g_return_if_fail (tasks != NULL);
- g_return_if_fail (E_IS_TASKS (tasks));
-
- priv = tasks->priv;
-
- cal_table = E_CALENDAR_TABLE (priv->tasks_view);
- set_status_message (tasks, _("Deleting selected objects..."));
- e_calendar_table_delete_selected (cal_table);
- set_status_message (tasks, NULL);
-
- e_cal_component_preview_clear (E_CAL_COMPONENT_PREVIEW (priv->preview));
-}
-
/**
* e_tasks_expunge:
* @tasks: A tasks control widget
@@ -1301,24 +730,3 @@ e_tasks_open_task_id (ETasks *tasks,
return;
}
-
-/**
- * e_tasks_get_calendar_table:
- * @tasks: A tasks widget.
- *
- * Queries the #ECalendarTable contained in a tasks widget.
- *
- * Return value: The #ECalendarTable that the tasks widget uses to display its
- * information.
- **/
-ECalendarTable *
-e_tasks_get_calendar_table (ETasks *tasks)
-{
- ETasksPrivate *priv;
-
- g_return_val_if_fail (tasks != NULL, NULL);
- g_return_val_if_fail (E_IS_TASKS (tasks), NULL);
-
- priv = tasks->priv;
- return E_CALENDAR_TABLE (priv->tasks_view);
-}
diff --git a/calendar/gui/e-tasks.h b/calendar/gui/e-tasks.h
index f94ee27ad9..85444392d1 100644
--- a/calendar/gui/e-tasks.h
+++ b/calendar/gui/e-tasks.h
@@ -63,29 +63,15 @@ GtkWidget *e_tasks_construct (ETasks *tasks);
GtkWidget *e_tasks_new (void);
-void e_tasks_set_ui_component (ETasks *tasks,
- BonoboUIComponent *ui_component);
-
gboolean e_tasks_add_todo_source (ETasks *tasks, ESource *source);
gboolean e_tasks_remove_todo_source (ETasks *tasks, ESource *source);
gboolean e_tasks_set_default_source (ETasks *tasks, ESource *source);
-ECal *e_tasks_get_default_client (ETasks *tasks);
-
void e_tasks_open_task (ETasks *tasks);
void e_tasks_open_task_id (ETasks *tasks,
const char *src_uid,
const char *comp_uid,
const char *comp_rid);
void e_tasks_new_task (ETasks *tasks);
-void e_tasks_complete_selected (ETasks *tasks);
-void e_tasks_delete_selected (ETasks *tasks);
void e_tasks_delete_completed (ETasks *tasks);
-void e_tasks_show_preview (ETasks *tasks, gboolean state);
-void e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic);
-void e_tasks_discard_view_menus (ETasks *tasks);
-
-struct _ECalMenu *e_tasks_get_tasks_menu (ETasks *tasks);
-ECalendarTable *e_tasks_get_calendar_table (ETasks *tasks);
-
#endif /* _E_TASKS_H_ */
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 31d72ee545..1e396cdf12 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -55,7 +55,6 @@
#include "e-comp-editor-registry.h"
#include "dialogs/delete-error.h"
#include "dialogs/event-editor.h"
-#include "dialogs/task-editor.h"
#include "comp-util.h"
#include "e-calendar-marshal.h"
#include "e-cal-model-calendar.h"
@@ -68,11 +67,9 @@
#include "e-cal-list-view-config.h"
#include "e-mini-calendar-config.h"
#include "e-calendar-table-config.h"
-#include "e-memo-table-config.h"
#include "evolution-calendar.h"
#include "gnome-cal.h"
#include "calendar-component.h"
-#include "memos-component.h"
#include "cal-search-bar.h"
#include "calendar-commands.h"
#include "calendar-config.h"
@@ -84,7 +81,6 @@
#include "common/authentication.h"
#include "e-cal-popup.h"
#include "e-cal-menu.h"
-#include "e-cal-model-tasks.h"
/* FIXME glib 2.4 and above has this */
#ifndef G_MAXINT32
@@ -118,9 +114,6 @@ struct _GnomeCalendarPrivate {
ECalendar *date_navigator;
EMiniCalendarConfig *date_navigator_config;
- GtkWidget *todo;
-
- GtkWidget *memo;
GtkWidget *day_view;
GtkWidget *work_week_view;
@@ -133,8 +126,6 @@ struct _GnomeCalendarPrivate {
/* plugin menu managers */
ECalMenu *calendar_menu;
- ECalMenu *taskpad_menu;
- ECalMenu *memopad_menu;
/* Calendar query for the date navigator */
GList *dn_queries; /* list of CalQueries */
@@ -192,10 +183,8 @@ struct _GnomeCalendarPrivate {
enum {
DATES_SHOWN_CHANGED,
CALENDAR_SELECTION_CHANGED,
- TASKPAD_SELECTION_CHANGED,
MEMOPAD_SELECTION_CHANGED,
CALENDAR_FOCUS_CHANGE,
- TASKPAD_FOCUS_CHANGE,
MEMOPAD_FOCUS_CHANGE,
GOTO_DATE,
SOURCE_ADDED,
@@ -300,25 +289,6 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- gnome_calendar_signals[TASKPAD_SELECTION_CHANGED] =
- g_signal_new ("taskpad_selection_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GnomeCalendarClass, taskpad_selection_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- gnome_calendar_signals[MEMOPAD_SELECTION_CHANGED] =
- g_signal_new ("memopad_selection_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GnomeCalendarClass, memopad_selection_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
-
gnome_calendar_signals[CALENDAR_FOCUS_CHANGE] =
g_signal_new ("calendar_focus_change",
G_TYPE_FROM_CLASS (object_class),
@@ -329,26 +299,6 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
- gnome_calendar_signals[TASKPAD_FOCUS_CHANGE] =
- g_signal_new ("taskpad_focus_change",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (GnomeCalendarClass, taskpad_focus_change),
- NULL, NULL,
- g_cclosure_marshal_VOID__BOOLEAN,
- G_TYPE_NONE, 1,
- G_TYPE_BOOLEAN);
-
- gnome_calendar_signals[MEMOPAD_FOCUS_CHANGE] =
- g_signal_new ("memopad_focus_change",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (GnomeCalendarClass, memopad_focus_change),
- NULL, NULL,
- g_cclosure_marshal_VOID__BOOLEAN,
- G_TYPE_NONE, 1,
- G_TYPE_BOOLEAN);
-
gnome_calendar_signals[SOURCE_ADDED] =
g_signal_new ("source_added",
G_TYPE_FROM_CLASS (object_class),
@@ -397,11 +347,7 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
class->dates_shown_changed = NULL;
class->calendar_selection_changed = NULL;
- class->taskpad_selection_changed = NULL;
- class->memopad_selection_changed = NULL;
class->calendar_focus_change = NULL;
- class->taskpad_focus_change = NULL;
- class->memopad_focus_change = NULL;
class->source_added = NULL;
class->source_removed = NULL;
class->goto_date = gnome_calendar_goto_date;
@@ -979,8 +925,9 @@ search_bar_category_changed_cb (CalSearchBar *cal_search, const char *category,
category);
}
+ /* [KILL-BONOBO] Delete this when moved to ECalShellView.
model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo));
- e_cal_model_set_default_category (model, category);
+ e_cal_model_set_default_category (model, category); */
}
static void
@@ -1031,35 +978,6 @@ user_created_cb (GtkWidget *view, GnomeCalendar *gcal)
}
-/* Callback used when the taskpad receives a focus event. We emit the
- * corresponding signal so that parents can change the menus as appropriate.
- */
-static gint
-table_canvas_focus_change_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- g_signal_emit (gcal, gnome_calendar_signals [TASKPAD_FOCUS_CHANGE], 0,
- event->in ? TRUE : FALSE);
-
- return FALSE;
-}
-
-static gint
-memo_canvas_focus_change_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- g_signal_emit (gcal, gnome_calendar_signals [MEMOPAD_FOCUS_CHANGE], 0,
- event->in ? TRUE : FALSE);
-
- return FALSE;
-}
-
static gint
calendar_focus_change_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
{
@@ -1114,29 +1032,6 @@ connect_list_view_focus (GnomeCalendar *gcal, ECalListView *lv)
G_CALLBACK (calendar_focus_change_cb), gcal);
}
-/* Callback used when the selection in the taskpad table changes. We just proxy
- * the signal with our own one.
- */
-static void
-table_selection_change_cb (ETable *etable, gpointer data)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- g_signal_emit (gcal, gnome_calendar_signals[TASKPAD_SELECTION_CHANGED], 0);
-}
-
-static void
-memo_selection_change_cb (ETable *etable, gpointer data)
-{
- GnomeCalendar *gcal;
-
- gcal = GNOME_CALENDAR (data);
-
- g_signal_emit (gcal, gnome_calendar_signals[MEMOPAD_SELECTION_CHANGED], 0);
-}
-
static void
set_week_start (GnomeCalendar *calendar)
{
@@ -1457,26 +1352,15 @@ categories_changed_cb (gpointer object, gpointer user_data)
static void
view_progress_cb (ECalModel *model, const char *message, int percent, ECalSourceType type, GnomeCalendar *gcal)
{
- if (type == E_CAL_SOURCE_TYPE_EVENT) {
+ if (type == E_CAL_SOURCE_TYPE_EVENT)
e_calendar_view_set_status_message (E_CALENDAR_VIEW (gcal->priv->week_view), message, percent);
- } else if (type == E_CAL_SOURCE_TYPE_TODO) {
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (gcal->priv->todo), message, percent);
- } else if (type == E_CAL_SOURCE_TYPE_JOURNAL) {
- e_memo_table_set_status_message (E_MEMO_TABLE (gcal->priv->memo), message);
- }
}
static void
view_done_cb (ECalModel *model, ECalendarStatus status, ECalSourceType type, GnomeCalendar *gcal)
{
- if (type == E_CAL_SOURCE_TYPE_EVENT) {
+ if (type == E_CAL_SOURCE_TYPE_EVENT)
e_calendar_view_set_status_message (E_CALENDAR_VIEW (gcal->priv->week_view), NULL, -1);
- } else if (type == E_CAL_SOURCE_TYPE_TODO) {
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (gcal->priv->todo), NULL, -1);
- } else if (type == E_CAL_SOURCE_TYPE_JOURNAL) {
- e_memo_table_set_status_message (E_MEMO_TABLE (gcal->priv->memo), NULL);
- }
-
}
GtkWidget *
@@ -1573,20 +1457,6 @@ setup_widgets (GnomeCalendar *gcal)
update_todo_view (gcal);
- etable = e_calendar_table_get_table (E_CALENDAR_TABLE (priv->todo));
- g_signal_connect (etable->table_canvas, "focus_in_event",
- G_CALLBACK (table_canvas_focus_change_cb), gcal);
- g_signal_connect (etable->table_canvas, "focus_out_event",
- G_CALLBACK (table_canvas_focus_change_cb), gcal);
-
- g_signal_connect (etable, "selection_change",
- G_CALLBACK (table_selection_change_cb), gcal);
-
- g_signal_connect (e_calendar_table_get_model ((ECalendarTable *)priv->todo), "cal_view_progress",
- G_CALLBACK (view_progress_cb), gcal);
- g_signal_connect (e_calendar_table_get_model ((ECalendarTable *)priv->todo), "cal_view_done",
- G_CALLBACK (view_done_cb), gcal);
-
/* Timeout check to hide completed items */
priv->update_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_todo_view_cb, gcal, NULL);
@@ -1691,21 +1561,6 @@ setup_widgets (GnomeCalendar *gcal)
gtk_widget_show (vbox);
update_memo_view (gcal);
-
- etable = e_memo_table_get_table (E_MEMO_TABLE (priv->memo));
- g_signal_connect (etable->table_canvas, "focus_in_event",
- G_CALLBACK (memo_canvas_focus_change_cb), gcal);
- g_signal_connect (etable->table_canvas, "focus_out_event",
- G_CALLBACK (memo_canvas_focus_change_cb), gcal);
-
- g_signal_connect (etable, "selection_change",
- G_CALLBACK (memo_selection_change_cb), gcal);
-
- g_signal_connect (e_memo_table_get_model ((EMemoTable *)priv->memo), "cal_view_progress",
- G_CALLBACK (view_progress_cb), gcal);
- g_signal_connect (e_memo_table_get_model ((EMemoTable *)priv->memo), "cal_view_done",
- G_CALLBACK (view_done_cb), gcal);
-
}
/* Object initialization function for the gnome calendar */
@@ -1731,7 +1586,6 @@ gnome_calendar_init (GnomeCalendar *gcal)
setup_widgets (gcal);
priv->calendar_menu = e_cal_menu_new("org.gnome.evolution.calendar.view");
- priv->taskpad_menu = e_cal_menu_new("org.gnome.evolution.calendar.taskpad");
priv->dn_queries = NULL;
priv->sexp = g_strdup ("#t"); /* Match all */
@@ -1799,18 +1653,6 @@ gnome_calendar_destroy (GtkObject *object)
g_list_free (priv->notifications);
priv->notifications = NULL;
- /* Save the TaskPad layout. */
- filename = g_build_filename (calendar_component_peek_config_directory (calendar_component_peek ()),
- "TaskPad", NULL);
- e_calendar_table_save_state (E_CALENDAR_TABLE (priv->todo), filename);
- g_free (filename);
-
- /* Save the MemoPad layout. */
- filename = g_build_filename (memos_component_peek_config_directory (memos_component_peek ()),
- "MemoPad", NULL);
- e_memo_table_save_state (E_MEMO_TABLE (priv->memo), filename);
- g_free (filename);
-
if (priv->dn_queries) {
for (l = priv->dn_queries; l != NULL; l = l->next) {
g_signal_handlers_disconnect_matched ((ECalView *) l->data, G_SIGNAL_MATCH_DATA,
@@ -1827,11 +1669,6 @@ gnome_calendar_destroy (GtkObject *object)
priv->sexp = NULL;
}
- if (priv->todo_sexp) {
- g_free (priv->todo_sexp);
- priv->todo_sexp = NULL;
- }
-
if (priv->update_timeout) {
g_source_remove (priv->update_timeout);
priv->update_timeout = 0;
@@ -1847,15 +1684,6 @@ gnome_calendar_destroy (GtkObject *object)
priv->calendar_menu = NULL;
}
- if (priv->taskpad_menu) {
- g_object_unref (priv->taskpad_menu);
- priv->taskpad_menu = NULL;
- }
-
- if (priv->memopad_menu) {
- g_object_unref (priv->memopad_menu);
- priv->memopad_menu = NULL;
- }
/* Disconnect all handlers */
cal_model = e_calendar_view_get_model ((ECalendarView *)priv->week_view);
g_signal_handlers_disconnect_by_func (cal_model,
@@ -1863,18 +1691,6 @@ gnome_calendar_destroy (GtkObject *object)
g_signal_handlers_disconnect_by_func (cal_model,
G_CALLBACK (view_done_cb), gcal);
- cal_model = e_calendar_table_get_model ((ECalendarTable *) priv->todo);
- g_signal_handlers_disconnect_by_func (cal_model,
- G_CALLBACK (view_progress_cb), gcal);
- g_signal_handlers_disconnect_by_func (cal_model,
- G_CALLBACK (view_done_cb), gcal);
-
- cal_model = e_memo_table_get_model ((EMemoTable *)priv->memo);
- g_signal_handlers_disconnect_by_func (cal_model,
- G_CALLBACK (view_progress_cb), gcal);
- g_signal_handlers_disconnect_by_func (cal_model,
- G_CALLBACK (view_done_cb), gcal);
-
g_free (priv);
gcal->priv = NULL;
}
@@ -2361,11 +2177,6 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal)
case E_CAL_SOURCE_TYPE_EVENT:
e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1);
break;
- case E_CAL_SOURCE_TYPE_TODO:
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL, -1);
- break;
- case E_CAL_SOURCE_TYPE_JOURNAL:
- e_memo_table_set_status_message (E_MEMO_TABLE (priv->memo), NULL);
default:
break;
}
@@ -2432,22 +2243,6 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal)
e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1);
break;
- case E_CAL_SOURCE_TYPE_TODO :
- msg = g_strdup_printf (_("Loading tasks at %s"), e_cal_get_uri (ecal));
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), msg, -1);
- g_free (msg);
-
- e_cal_model_add_client (e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)), ecal);
-
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL, -1);
- break;
- case E_CAL_SOURCE_TYPE_JOURNAL:
- msg = g_strdup_printf (_("Loading memos at %s"), e_cal_get_uri (ecal));
- e_memo_table_set_status_message (E_MEMO_TABLE (priv->memo), msg);
- g_free (msg);
- e_cal_model_add_client (e_memo_table_get_model (E_MEMO_TABLE (priv->memo)), ecal);
- e_memo_table_set_status_message (E_MEMO_TABLE (priv->memo), NULL);
- break;
default:
g_return_if_reached ();
}
@@ -2471,12 +2266,6 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar
case E_CAL_SOURCE_TYPE_EVENT:
e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1);
break;
- case E_CAL_SOURCE_TYPE_TODO:
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL, -1);
- break;
- case E_CAL_SOURCE_TYPE_JOURNAL:
- e_memo_table_set_status_message (E_MEMO_TABLE (priv->memo), NULL);
- break;
default:
break;
}
@@ -2522,12 +2311,6 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar
ecal);
break;
- case E_CAL_SOURCE_TYPE_TODO:
- e_cal_model_set_default_client (e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)), ecal);
- break;
- case E_CAL_SOURCE_TYPE_JOURNAL:
- e_cal_model_set_default_client (e_memo_table_get_model (E_MEMO_TABLE (priv->memo)), ecal);
- break;
default:
break;
}
@@ -2552,12 +2335,6 @@ open_ecal (GnomeCalendar *gcal, ECal *cal, gboolean only_if_exists, open_func of
case E_CAL_SOURCE_TYPE_EVENT :
e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), msg, -1);
break;
- case E_CAL_SOURCE_TYPE_TODO :
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), msg, -1);
- break;
- case E_CAL_SOURCE_TYPE_JOURNAL:
- e_memo_table_set_status_message (E_MEMO_TABLE (priv->memo), msg);
- break;
default:
g_free (msg);
g_return_val_if_reached (FALSE);
@@ -2627,21 +2404,6 @@ backend_died_cb (ECal *ecal, gpointer data)
g_signal_emit (gcal, gnome_calendar_signals[SOURCE_REMOVED], 0, source_type, source);
break;
- case E_CAL_SOURCE_TYPE_TODO:
- id = "calendar:tasks-crashed";
-
- e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL, -1);
-
- g_signal_emit (gcal, gnome_calendar_signals[SOURCE_REMOVED], 0, source_type, source);
- break;
-
- case E_CAL_SOURCE_TYPE_JOURNAL:
- id = "calendar:memos-crashed";
-
- e_memo_table_set_status_message (E_MEMO_TABLE (priv->memo), NULL);
-
- g_signal_emit (gcal, gnome_calendar_signals[SOURCE_REMOVED], 0, source_type, source);
- break;
default:
g_return_if_reached ();
}
@@ -2847,16 +2609,6 @@ gnome_calendar_remove_source_by_uid (GnomeCalendar *gcal, ECalSourceType source_
update_query (gcal);
break;
- case E_CAL_SOURCE_TYPE_TODO:
- model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo));
- e_cal_model_remove_client (model, client);
- break;
-
- case E_CAL_SOURCE_TYPE_JOURNAL:
- model = e_memo_table_get_model (E_MEMO_TABLE (priv->memo));
- e_cal_model_remove_client (model, client);
- break;
-
default:
g_return_val_if_reached (TRUE);
}
@@ -3474,14 +3226,6 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than)
}
-ECalendarTable*
-gnome_calendar_get_task_pad (GnomeCalendar *gcal)
-{
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- return E_CALENDAR_TABLE (gcal->priv->todo);
-}
-
GtkWidget *
gnome_calendar_get_e_calendar_widget (GnomeCalendar *gcal)
{
@@ -3506,13 +3250,6 @@ gnome_calendar_get_view_notebook_widget (GnomeCalendar *gcal)
return GTK_WIDGET(gcal->priv->notebook);
}
-ECalMenu *gnome_calendar_get_taskpad_menu (GnomeCalendar *gcal)
-{
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- return gcal->priv->taskpad_menu;
-}
-
ECalMenu *gnome_calendar_get_calendar_menu (GnomeCalendar *gcal)
{
g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
@@ -3520,14 +3257,6 @@ ECalMenu *gnome_calendar_get_calendar_menu (GnomeCalendar *gcal)
return gcal->priv->calendar_menu;
}
-ECalMenu *gnome_calendar_get_memopad_menu (GnomeCalendar *gcal)
-{
- g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
-
- return gcal->priv->memopad_menu;
-}
-
-
void
gnome_calendar_edit_appointment (GnomeCalendar *gcal,
const char* src_uid,
diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h
index 6c758a60cd..7d354381bc 100644
--- a/calendar/gui/gnome-cal.h
+++ b/calendar/gui/gnome-cal.h
@@ -133,15 +133,12 @@ void gnome_calendar_set_view (GnomeCalendar *gcal, GnomeCalendarViewType view_ty
GtkWidget *gnome_calendar_get_current_view_widget (GnomeCalendar *gcal);
-ECalendarTable *gnome_calendar_get_task_pad (GnomeCalendar *gcal);
GtkWidget *gnome_calendar_get_e_calendar_widget (GnomeCalendar *gcal);
GtkWidget *gnome_calendar_get_search_bar_widget (GnomeCalendar *gcal);
GtkWidget *gnome_calendar_get_view_notebook_widget (GnomeCalendar *gcal);
GtkWidget *gnome_calendar_get_tag (GnomeCalendar *gcal);
-struct _ECalMenu *gnome_calendar_get_taskpad_menu (GnomeCalendar *gcal);
struct _ECalMenu *gnome_calendar_get_calendar_menu (GnomeCalendar *gcal);
-struct _ECalMenu *gnome_calendar_get_memopad_menu (GnomeCalendar *gcal);
void gnome_calendar_set_selected_time_range (GnomeCalendar *gcal,
time_t start_time,
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
index 259ac2ecb9..af6d5bcd42 100644
--- a/calendar/gui/main.c
+++ b/calendar/gui/main.c
@@ -174,15 +174,6 @@ factory (BonoboGenericFactory *factory,
return object;
} else if (strcmp (component_id, ITIP_CONTROL_ID) == 0)
return BONOBO_OBJECT (itip_bonobo_control_new ());
- else if (strcmp (component_id, CONFIG_CONTROL_ID) == 0) {
- GtkWidget *prefs;
- EvolutionConfigControl *control;
-
- prefs = calendar_prefs_dialog_new ();
- gtk_widget_show (prefs);
- control = evolution_config_control_new (prefs);
-
- return BONOBO_OBJECT (control);
} else if (strcmp (component_id, COMP_EDITOR_FACTORY_ID) == 0)
return BONOBO_OBJECT (comp_editor_factory_fn ());
diff --git a/calendar/modules/e-cal-shell-module.c b/calendar/modules/e-cal-shell-module.c
index 88f743f1ee..b6e1aa4208 100644
--- a/calendar/modules/e-cal-shell-module.c
+++ b/calendar/modules/e-cal-shell-module.c
@@ -30,10 +30,12 @@
#include "shell/e-shell.h"
#include "shell/e-shell-module.h"
#include "shell/e-shell-window.h"
+#include "widgets/misc/e-preferences-window.h"
#include "calendar/common/authentication.h"
#include "calendar/gui/calendar-config.h"
#include "calendar/gui/comp-util.h"
+#include "calendar/gui/dialogs/cal-prefs-dialog.h"
#include "calendar/gui/dialogs/calendar-setup.h"
#include "calendar/gui/dialogs/event-editor.h"
@@ -404,6 +406,22 @@ static GtkActionEntry source_entries[] = {
G_CALLBACK (action_calendar_new_cb) }
};
+static void
+cal_module_init_preferences (void)
+{
+ GtkWidget *preferences_window;
+
+ preferences_window = e_shell_get_preferences_window ();
+
+ e_preferences_window_add_page (
+ E_PREFERENCES_WINDOW (preferences_window),
+ "calendar-and-tasks",
+ "preferences-calendar-and-tasks",
+ _("Calendar and Tasks"),
+ calendar_prefs_dialog_new (),
+ 600);
+}
+
static gboolean
cal_module_handle_uri (EShellModule *shell_module,
const gchar *uri)
@@ -463,4 +481,6 @@ e_shell_module_init (GTypeModule *type_module)
g_signal_connect_swapped (
shell, "window-created",
G_CALLBACK (cal_module_window_created), shell_module);
+
+ cal_module_init_preferences ();
}
diff --git a/calendar/modules/e-cal-shell-sidebar.c b/calendar/modules/e-cal-shell-sidebar.c
index 7c2777bf04..312cb8649c 100644
--- a/calendar/modules/e-cal-shell-sidebar.c
+++ b/calendar/modules/e-cal-shell-sidebar.c
@@ -473,14 +473,6 @@ cal_shell_sidebar_constructed (GObject *object)
}
static void
-cal_shell_sidebar_client_added (ECalShellSidebar *cal_shell_sidebar,
- ECal *client)
-{
- /* FIXME */
- /*cal_shell_sidebar_update_timezone (cal_shell_sidebar);*/
-}
-
-static void
cal_shell_sidebar_client_removed (ECalShellSidebar *cal_shell_sidebar,
ECal *client)
{
@@ -519,7 +511,6 @@ cal_shell_sidebar_class_init (ECalShellSidebarClass *class)
object_class->finalize = cal_shell_sidebar_finalize;
object_class->constructed = cal_shell_sidebar_constructed;
- class->client_added = cal_shell_sidebar_client_added;
class->client_removed = cal_shell_sidebar_client_removed;
g_object_class_install_property (
@@ -628,6 +619,19 @@ e_cal_shell_sidebar_new (EShellView *shell_view)
"shell-view", shell_view, NULL);
}
+GList *
+e_cal_shell_sidebar_get_clients (ECalShellSidebar *cal_shell_sidebar)
+{
+ GHashTable *client_table;
+
+ g_return_val_if_fail (
+ E_IS_CAL_SHELL_SIDEBAR (cal_shell_sidebar), NULL);
+
+ client_table = cal_shell_sidebar->priv->client_table;
+
+ return g_hash_table_get_values (client_table);
+}
+
ECalendar *
e_cal_shell_sidebar_get_mini_calendar (ECalShellSidebar *cal_shell_sidebar)
{
@@ -721,26 +725,3 @@ e_cal_shell_sidebar_remove_source (ECalShellSidebar *cal_shell_sidebar,
cal_shell_sidebar_emit_client_removed (cal_shell_sidebar, client);
}
-
-void
-e_cal_shell_sidebar_update_timezone (ECalShellSidebar *cal_shell_sidebar)
-{
- GHashTable *client_table;
- icaltimezone *timezone;
- GList *values;
-
- g_return_if_fail (E_CAL_SHELL_SIDEBAR (cal_shell_sidebar));
-
- timezone = calendar_config_get_icaltimezone ();
- client_table = cal_shell_sidebar->priv->client_table;
- values = g_hash_table_get_values (client_table);
-
- while (values != NULL) {
- ECal *client = values->data;
-
- if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED)
- e_cal_set_default_timezone (client, timezone, NULL);
-
- values = g_list_delete_link (values, values);
- }
-}
diff --git a/calendar/modules/e-cal-shell-sidebar.h b/calendar/modules/e-cal-shell-sidebar.h
index ff30541448..d77482eb64 100644
--- a/calendar/modules/e-cal-shell-sidebar.h
+++ b/calendar/modules/e-cal-shell-sidebar.h
@@ -80,6 +80,7 @@ struct _ECalShellSidebarClass {
GType e_cal_shell_sidebar_get_type (void);
GtkWidget * e_cal_shell_sidebar_new (EShellView *shell_view);
+GList * e_cal_shell_sidebar_get_clients (ECalShellSidebar *cal_shell_sidebar);
ECalendar * e_cal_shell_sidebar_get_mini_calendar
(ECalShellSidebar *cal_shell_sidebar);
ESourceSelector *
@@ -89,8 +90,6 @@ void e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar,
void e_cal_shell_sidebar_remove_source
(ECalShellSidebar *cal_shell_sidebar,
ESource *source);
-void e_cal_shell_sidebar_update_timezone
- (ECalShellSidebar *cal_shell_sidebar);
G_END_DECLS
diff --git a/calendar/modules/e-cal-shell-view-actions.c b/calendar/modules/e-cal-shell-view-actions.c
index 7de429c3e8..f2c7d47b62 100644
--- a/calendar/modules/e-cal-shell-view-actions.c
+++ b/calendar/modules/e-cal-shell-view-actions.c
@@ -516,7 +516,6 @@ static void
action_search_execute_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
-#if 0
EShellView *shell_view;
/* All shell views respond to the activation of this action,
@@ -527,7 +526,6 @@ action_search_execute_cb (GtkAction *action,
return;
e_cal_shell_view_execute_search (cal_shell_view);
-#endif
}
static void
@@ -535,9 +533,7 @@ action_search_filter_cb (GtkRadioAction *action,
GtkRadioAction *current,
ECalShellView *cal_shell_view)
{
-#if 0
e_cal_shell_view_execute_search (cal_shell_view);
-#endif
}
static GtkActionEntry calendar_entries[] = {
diff --git a/calendar/modules/e-cal-shell-view-private.c b/calendar/modules/e-cal-shell-view-private.c
index 7f24eddd2e..8b1f0d9c82 100644
--- a/calendar/modules/e-cal-shell-view-private.c
+++ b/calendar/modules/e-cal-shell-view-private.c
@@ -41,41 +41,6 @@ cal_shell_view_process_completed_tasks (ECalShellView *cal_shell_view,
}
static void
-cal_shell_view_update_timezone (ECalShellView *cal_shell_view)
-{
-#if 0
- ECalShellContent *cal_shell_content;
- ECalShellSidebar *cal_shell_sidebar;
- GnomeCalendarViewType view_type;
- ECalendarView *calendar_view;
- icaltimezone *timezone;
-
- cal_shell_content = cal_shell_view->priv->cal_shell_content;
- cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar;
-
- e_cal_shell_sidebar_update_timezone (cal_shell_sidebar);
-
- view_type = e_cal_shell_content_get_current_view (cal_shell_content);
- calendar_view = e_cal_shell_content_get_calendar_view (
- cal_shell_content, view_type);
-
- timezone = calendar_config_get_icaltimezone ();
- e_calendar_view_get_icaltimezone (calendar_view, timezone);
-#endif
-}
-
-static void
-cal_shell_view_config_hide_completed_tasks_changed_cb (GConfClient *client,
- guint id,
- GConfEntry *entry,
- gpointer user_data)
-{
- ECalShellView *cal_shell_view = user_data;
-
- /* FIXME */
-}
-
-static void
cal_shell_view_config_timezone_changed_cb (GConfClient *client,
guint id,
GConfEntry *entry,
@@ -83,7 +48,7 @@ cal_shell_view_config_timezone_changed_cb (GConfClient *client,
{
ECalShellView *cal_shell_view = user_data;
- cal_shell_view_update_timezone (cal_shell_view);
+ e_cal_shell_view_update_timezone (cal_shell_view);
}
static struct tm
@@ -152,6 +117,26 @@ cal_shell_view_mini_calendar_scroll_event_cb (ECalShellView *cal_shell_view,
}
static void
+cal_shell_view_memopad_popup_event_cb (EShellView *shell_view,
+ GdkEventButton *event)
+{
+ const gchar *widget_path;
+
+ widget_path = "/calendar-memopad-popup";
+ e_shell_view_show_popup_menu (shell_view, widget_path, event);
+}
+
+static void
+cal_shell_view_taskpad_popup_event_cb (EShellView *shell_view,
+ GdkEventButton *event)
+{
+ const gchar *widget_path;
+
+ widget_path = "/calendar-taskpad-popup";
+ e_shell_view_show_popup_menu (shell_view, widget_path, event);
+}
+
+static void
cal_shell_view_load_view_collection (EShellViewClass *shell_view_class)
{
GalViewCollection *collection;
@@ -300,11 +285,21 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
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, "status-message",
G_CALLBACK (e_cal_shell_view_memopad_set_status_message),
cal_shell_view);
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, "status-message",
G_CALLBACK (e_cal_shell_view_taskpad_set_status_message),
cal_shell_view);
@@ -319,6 +314,10 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
G_CALLBACK (e_cal_shell_view_taskpad_actions_update),
cal_shell_view);
+ e_categories_register_change_listener (
+ G_CALLBACK (e_cal_shell_view_update_search_filter),
+ cal_shell_view);
+
/* Listen for configuration changes. */
/* Timezone */
@@ -326,30 +325,11 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view)
cal_shell_view_config_timezone_changed_cb, cal_shell_view);
priv->notifications = g_list_prepend (
priv->notifications, GUINT_TO_POINTER (id));
- cal_shell_view_update_timezone (cal_shell_view);
-
- /* Hide Completed Tasks (enable/units/value) */
- id = calendar_config_add_notification_hide_completed_tasks (
- cal_shell_view_config_hide_completed_tasks_changed_cb,
- cal_shell_view);
- priv->notifications = g_list_prepend (
- priv->notifications, GUINT_TO_POINTER (id));
- id = calendar_config_add_notification_hide_completed_tasks_units (
- cal_shell_view_config_hide_completed_tasks_changed_cb,
- cal_shell_view);
- priv->notifications = g_list_prepend (
- priv->notifications, GUINT_TO_POINTER (id));
- id = calendar_config_add_notification_hide_completed_tasks_value (
- cal_shell_view_config_hide_completed_tasks_changed_cb,
- cal_shell_view);
-
- e_categories_register_change_listener (
- G_CALLBACK (e_cal_shell_view_update_search_filter),
- 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);
+ e_cal_shell_view_update_timezone (cal_shell_view);
}
void
@@ -402,6 +382,12 @@ e_cal_shell_view_private_finalize (ECalShellView *cal_shell_view)
}
void
+e_cal_shell_view_execute_search (ECalShellView *cal_shell_view)
+{
+ /* FIXME */
+}
+
+void
e_cal_shell_view_open_event (ECalShellView *cal_shell_view,
ECalModelComponent *comp_data)
{
@@ -610,3 +596,37 @@ e_cal_shell_view_update_sidebar (ECalShellView *cal_shell_view)
e_shell_sidebar_set_secondary_text (shell_sidebar, buffer);
#endif
}
+
+void
+e_cal_shell_view_update_timezone (ECalShellView *cal_shell_view)
+{
+#if 0
+ ECalShellContent *cal_shell_content;
+ ECalShellSidebar *cal_shell_sidebar;
+ GnomeCalendarViewType view_type;
+ ECalendarView *calendar_view;
+ icaltimezone *timezone;
+ GList *clients, *iter;
+
+ cal_shell_content = cal_shell_view->priv->cal_shell_content;
+ view_type = e_cal_shell_content_get_current_view (cal_shell_content);
+ calendar_view = e_cal_shell_content_get_calendar_view (
+ cal_shell_content, view_type);
+
+ cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar;
+ clients = e_cal_shell_sidebar_get_clients (cal_shell_sidebar);
+
+ timezone = calendar_config_get_icaltimezone ();
+
+ for (iter = clients; iter != NULL; iter = iter->next) {
+ ECal *client = iter->data;
+
+ if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED)
+ e_cal_set_default_timezone (client, timezone, NULL);
+ }
+
+ e_calendar_view_set_icaltimezone (calendar_view, timezone);
+
+ g_list_free (clients);
+#endif
+}
diff --git a/calendar/modules/e-cal-shell-view-private.h b/calendar/modules/e-cal-shell-view-private.h
index 66083a0903..3407b660d6 100644
--- a/calendar/modules/e-cal-shell-view-private.h
+++ b/calendar/modules/e-cal-shell-view-private.h
@@ -140,6 +140,8 @@ void e_cal_shell_view_update_sidebar
(ECalShellView *cal_shell_view);
void e_cal_shell_view_update_search_filter
(ECalShellView *cal_shell_view);
+void e_cal_shell_view_update_timezone
+ (ECalShellView *cal_shell_view);
/* Memo Pad Utilities */
diff --git a/calendar/modules/e-task-shell-content.c b/calendar/modules/e-task-shell-content.c
index b45daedd21..dec1760151 100644
--- a/calendar/modules/e-task-shell-content.c
+++ b/calendar/modules/e-task-shell-content.c
@@ -175,8 +175,6 @@ task_shell_content_selection_change_cb (ETaskShellContent *task_shell_content,
task_preview = e_task_shell_content_get_task_preview (task_shell_content);
- /* XXX Old code emits a "selection-changed" signal here. */
-
if (e_table_selected_count (table) != 1)
e_cal_component_preview_clear (task_preview);
}
diff --git a/calendar/modules/e-task-shell-sidebar.c b/calendar/modules/e-task-shell-sidebar.c
index f58df26dfc..bce2684515 100644
--- a/calendar/modules/e-task-shell-sidebar.c
+++ b/calendar/modules/e-task-shell-sidebar.c
@@ -88,33 +88,6 @@ task_shell_sidebar_emit_status_message (ETaskShellSidebar *task_shell_sidebar,
}
static void
-task_shell_sidebar_update_timezone (ETaskShellSidebar *task_shell_sidebar)
-{
- GHashTable *client_table;
- icaltimezone *zone;
- GList *values;
-
- zone = calendar_config_get_icaltimezone ();
- client_table = task_shell_sidebar->priv->client_table;
- values = g_hash_table_get_values (client_table);
-
- while (values != NULL) {
- ECal *client = values->data;
-
- if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED)
- e_cal_set_default_timezone (client, zone, NULL);
-
- values = g_list_delete_link (values, values);
- }
-
- /* XXX Need to call e_cal_component_preview_set_default_timezone()
- * here but the sidebar is not really supposed to access content
- * stuff. I guess we could emit an "update-timezone" signal
- * here, but that feels wrong. Maybe this whole thing should
- * be in ETaskShellView instead. */
-}
-
-static void
task_shell_sidebar_backend_died_cb (ETaskShellSidebar *task_shell_sidebar,
ECal *client)
{
@@ -471,13 +444,6 @@ task_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
}
static void
-task_shell_sidebar_client_added (ETaskShellSidebar *task_shell_sidebar,
- ECal *client)
-{
- task_shell_sidebar_update_timezone (task_shell_sidebar);
-}
-
-static void
task_shell_sidebar_client_removed (ETaskShellSidebar *task_shell_sidebar,
ECal *client)
{
@@ -520,7 +486,6 @@ task_shell_sidebar_class_init (ETaskShellSidebarClass *class)
shell_sidebar_class = E_SHELL_SIDEBAR_CLASS (class);
shell_sidebar_class->check_state = task_shell_sidebar_check_state;
- class->client_added = task_shell_sidebar_client_added;
class->client_removed = task_shell_sidebar_client_removed;
g_object_class_install_property (
@@ -620,6 +585,19 @@ e_task_shell_sidebar_new (EShellView *shell_view)
"shell-view", shell_view, NULL);
}
+GList *
+e_task_shell_sidebar_get_clients (ETaskShellSidebar *task_shell_sidebar)
+{
+ GHashTable *client_table;
+
+ g_return_val_if_fail (
+ E_IS_TASK_SHELL_SIDEBAR (task_shell_sidebar), NULL);
+
+ client_table = task_shell_sidebar->priv->client_table;
+
+ return g_hash_table_get_values (client_table);
+}
+
ESourceSelector *
e_task_shell_sidebar_get_selector (ETaskShellSidebar *task_shell_sidebar)
{
diff --git a/calendar/modules/e-task-shell-sidebar.h b/calendar/modules/e-task-shell-sidebar.h
index 57f12d3738..2d8fceaeb8 100644
--- a/calendar/modules/e-task-shell-sidebar.h
+++ b/calendar/modules/e-task-shell-sidebar.h
@@ -78,6 +78,7 @@ struct _ETaskShellSidebarClass {
GType e_task_shell_sidebar_get_type (void);
GtkWidget * e_task_shell_sidebar_new (EShellView *shell_view);
+GList * e_task_shell_sidebar_get_clients(ETaskShellSidebar *task_shell_sidebar);
ESourceSelector *
e_task_shell_sidebar_get_selector
(ETaskShellSidebar *task_shell_sidebar);
diff --git a/calendar/modules/e-task-shell-view-private.c b/calendar/modules/e-task-shell-view-private.c
index ef2b641ff3..47692fd037 100644
--- a/calendar/modules/e-task-shell-view-private.c
+++ b/calendar/modules/e-task-shell-view-private.c
@@ -24,6 +24,44 @@
#include <widgets/menus/gal-view-factory-etable.h>
static void
+task_shell_view_config_hide_completed_tasks_changed_cb (GConfClient *client,
+ guint id,
+ GConfEntry *entry,
+ gpointer user_data)
+{
+ ETaskShellView *task_shell_view = user_data;
+ ETaskShellContent *task_shell_content;
+ ETaskShellSidebar *task_shell_sidebar;
+ ECalendarTable *task_table;
+ GList *clients;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ task_table = e_task_shell_content_get_task_table (task_shell_content);
+
+ task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
+ clients = e_task_shell_sidebar_get_clients (task_shell_sidebar);
+
+ e_calendar_table_process_completed_tasks (task_table, clients, TRUE);
+
+ /* Search query takes whether to show completed tasks into account,
+ * so if the preference has changed we need to update the query. */
+ e_task_shell_view_execute_search (task_shell_view);
+
+ g_list_free (clients);
+}
+
+static void
+task_shell_view_config_timezone_changed_cb (GConfClient *client,
+ guint id,
+ GConfEntry *entry,
+ gpointer user_data)
+{
+ ETaskShellView *task_shell_view = user_data;
+
+ e_task_shell_view_update_timezone (task_shell_view);
+}
+
+static void
task_shell_view_table_popup_event_cb (EShellView *shell_view,
GdkEventButton *event)
{
@@ -67,6 +105,7 @@ task_shell_view_selector_client_added_cb (ETaskShellView *task_shell_view,
model = e_calendar_table_get_model (task_table);
e_cal_model_add_client (model, client);
+ e_task_shell_view_update_timezone (task_shell_view);
}
static void
@@ -97,6 +136,30 @@ task_shell_view_selector_popup_event_cb (EShellView *shell_view,
return TRUE;
}
+static gboolean
+task_shell_view_update_timeout_cb (ETaskShellView *task_shell_view)
+{
+ ETaskShellContent *task_shell_content;
+ ETaskShellSidebar *task_shell_sidebar;
+ ECalendarTable *task_table;
+ ECalModel *model;
+ GList *clients;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ task_table = e_task_shell_content_get_task_table (task_shell_content);
+ model = e_calendar_table_get_model (task_table);
+
+ task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
+ clients = e_task_shell_sidebar_get_clients (task_shell_sidebar);
+
+ e_calendar_table_process_completed_tasks (task_table, clients, FALSE);
+ e_cal_model_tasks_update_due_tasks (E_CAL_MODEL_TASKS (model));
+
+ g_list_free (clients);
+
+ return TRUE;
+}
+
static void
task_shell_view_load_view_collection (EShellViewClass *shell_view_class)
{
@@ -184,6 +247,7 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view)
ECalModel *model;
ETable *table;
ESourceSelector *selector;
+ guint id;
shell_view = E_SHELL_VIEW (task_shell_view);
shell_content = e_shell_view_get_shell_content (shell_view);
@@ -270,9 +334,41 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view)
G_CALLBACK (e_task_shell_view_update_search_filter),
task_shell_view);
+ task_shell_view_update_timeout_cb (task_shell_view);
+ priv->update_timeout = g_timeout_add_full (
+ G_PRIORITY_LOW, 60000, (GSourceFunc)
+ task_shell_view_update_timeout_cb,
+ task_shell_view, NULL);
+
+ /* Listen for configuration changes. */
+
+ /* Timezone */
+ id = calendar_config_add_notification_timezone (
+ task_shell_view_config_timezone_changed_cb, task_shell_view);
+ priv->notifications = g_list_prepend (
+ priv->notifications, GUINT_TO_POINTER (id));
+
+ /* Hide Completed Tasks (enable/units/value) */
+ id = calendar_config_add_notification_hide_completed_tasks (
+ task_shell_view_config_hide_completed_tasks_changed_cb,
+ task_shell_view);
+ priv->notifications = g_list_prepend (
+ priv->notifications, GUINT_TO_POINTER (id));
+ id = calendar_config_add_notification_hide_completed_tasks_units (
+ task_shell_view_config_hide_completed_tasks_changed_cb,
+ task_shell_view);
+ priv->notifications = g_list_prepend (
+ priv->notifications, GUINT_TO_POINTER (id));
+ id = calendar_config_add_notification_hide_completed_tasks_value (
+ task_shell_view_config_hide_completed_tasks_changed_cb,
+ task_shell_view);
+ priv->notifications = g_list_prepend (
+ priv->notifications, GUINT_TO_POINTER (id));
+
e_task_shell_view_actions_init (task_shell_view);
e_task_shell_view_update_sidebar (task_shell_view);
e_task_shell_view_update_search_filter (task_shell_view);
+ e_task_shell_view_update_timezone (task_shell_view);
e_task_shell_view_execute_search (task_shell_view);
}
@@ -281,6 +377,7 @@ void
e_task_shell_view_private_dispose (ETaskShellView *task_shell_view)
{
ETaskShellViewPrivate *priv = task_shell_view->priv;
+ GList *iter;
DISPOSE (priv->source_list);
@@ -296,6 +393,18 @@ e_task_shell_view_private_dispose (ETaskShellView *task_shell_view)
g_object_unref (task_shell_view->priv->activity);
task_shell_view->priv->activity = NULL;
}
+
+ if (priv->update_timeout > 0) {
+ g_source_remove (priv->update_timeout);
+ priv->update_timeout = 0;
+ }
+
+ for (iter = priv->notifications; iter != NULL; iter = iter->next) {
+ guint notification_id = GPOINTER_TO_UINT (iter->data);
+ calendar_config_remove_notification (notification_id);
+ }
+ g_list_free (priv->notifications);
+ priv->notifications = NULL;
}
void
@@ -453,6 +562,17 @@ e_task_shell_view_execute_search (ETaskShellView *task_shell_view)
}
}
+ /* Honor the user's preference to hide completed tasks. */
+ temp = calendar_config_get_hide_completed_tasks_sexp (FALSE);
+ if (temp != NULL) {
+ gchar *temp2;
+
+ temp2 = g_strdup_printf ("(and %s %s)", temp, query);
+ g_free (query);
+ g_free (temp);
+ query = temp2;
+ }
+
/* XXX This is wrong. We need to programmatically construct a
* FilterRule, tell it to build code, and pass the resulting
* expression string to ECalModel. */
@@ -595,3 +715,32 @@ e_task_shell_view_update_sidebar (ETaskShellView *task_shell_view)
g_string_free (string, TRUE);
}
+
+void
+e_task_shell_view_update_timezone (ETaskShellView *task_shell_view)
+{
+ ETaskShellContent *task_shell_content;
+ ETaskShellSidebar *task_shell_sidebar;
+ ECalComponentPreview *task_preview;
+ icaltimezone *timezone;
+ GList *clients, *iter;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ task_preview = e_task_shell_content_get_task_preview (task_shell_content);
+
+ task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
+ clients = e_task_shell_sidebar_get_clients (task_shell_sidebar);
+
+ timezone = calendar_config_get_icaltimezone ();
+
+ for (iter = clients; iter != NULL; iter = iter->next) {
+ ECal *client = iter->data;
+
+ if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED)
+ e_cal_set_default_timezone (client, timezone, NULL);
+ }
+
+ e_cal_component_preview_set_default_timezone (task_preview, timezone);
+
+ g_list_free (clients);
+}
diff --git a/calendar/modules/e-task-shell-view-private.h b/calendar/modules/e-task-shell-view-private.h
index ba6e076c12..c0e2d97145 100644
--- a/calendar/modules/e-task-shell-view-private.h
+++ b/calendar/modules/e-task-shell-view-private.h
@@ -108,6 +108,10 @@ struct _ETaskShellViewPrivate {
ETaskShellSidebar *task_shell_sidebar;
EActivity *activity;
+ guint update_timeout;
+
+ /* GConf notification IDs */
+ GList *notifications;
};
void e_task_shell_view_private_init
@@ -137,6 +141,8 @@ void e_task_shell_view_update_sidebar
(ETaskShellView *task_shell_view);
void e_task_shell_view_update_search_filter
(ETaskShellView *task_shell_view);
+void e_task_shell_view_update_timezone
+ (ETaskShellView *task_shell_view);
G_END_DECLS