aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-tasks.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/e-tasks.c')
-rw-r--r--calendar/gui/e-tasks.c172
1 files changed, 86 insertions, 86 deletions
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
index a2faca60f4..b127fdab30 100644
--- a/calendar/gui/e-tasks.c
+++ b/calendar/gui/e-tasks.c
@@ -69,13 +69,13 @@ struct _ETasksPrivate {
ECal *default_client;
ECalView *query;
-
+
EConfigListener *config_listener;
/* The ECalendarTable showing the tasks. */
GtkWidget *tasks_view;
ECalendarTableConfig *tasks_view_config;
-
+
/* Calendar search bar for tasks */
GtkWidget *search_bar;
@@ -87,11 +87,11 @@ struct _ETasksPrivate {
/* The preview */
GtkWidget *preview;
-
+
gchar *current_uid;
char *sexp;
guint update_timeout;
-
+
/* View instance and the view menus handler */
GalViewInstance *view_instance;
GalViewMenus *view_menus;
@@ -145,27 +145,27 @@ table_cursor_change_cb (ETable *etable, int row, gpointer 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);
}
@@ -226,7 +226,7 @@ search_bar_sexp_changed_cb (CalSearchBar *cal_search, const char *sexp, gpointer
if (priv->sexp)
g_free (priv->sexp);
-
+
priv->sexp = g_strdup (sexp);
update_view (tasks);
@@ -256,14 +256,14 @@ vpaned_resized_cb (GtkWidget *widget, GdkEventButton *event, ETasks *tasks)
}
static void
-set_timezone (ETasks *tasks)
+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;
@@ -271,7 +271,7 @@ set_timezone (ETasks *tasks)
e_cal_set_default_timezone (client, zone, NULL);
}
- if (priv->default_client)
+ if (priv->default_client)
/* FIXME Error checking */
e_cal_set_default_timezone (priv->default_client, zone, NULL);
@@ -283,7 +283,7 @@ static void
timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
{
ETasks *tasks = data;
-
+
set_timezone (tasks);
}
@@ -294,11 +294,11 @@ update_view (ETasks *tasks)
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);
@@ -325,7 +325,7 @@ process_completed_tasks (ETasks *tasks, gboolean config_changed)
static gboolean
update_view_cb (ETasks *tasks)
-{
+{
ECalModel *model;
model = e_calendar_table_get_model (E_CALENDAR_TABLE (tasks->priv->tasks_view));
@@ -373,16 +373,16 @@ model_row_changed_cb (ETableModel *etm, int row, gpointer data)
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)),
+ 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)),
+ e_calendar_table_set_status_message (E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)),
NULL, -1);
-
+
}
static void
@@ -407,24 +407,24 @@ setup_config (ETasks *tasks)
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,
+
+ 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,
+
+ 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,
+
+ 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));
+ 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));
@@ -570,7 +570,7 @@ table_drag_end (ETable *table,
}
*/
-static void
+static void
table_drag_data_delete (ETable *table,
int row,
int col,
@@ -635,7 +635,7 @@ setup_widgets (ETasks *tasks)
priv->tasks_view = e_calendar_table_new ();
g_object_set_data (G_OBJECT (priv->tasks_view), "tasks", tasks);
priv->tasks_view_config = e_calendar_table_config_new (E_CALENDAR_TABLE (priv->tasks_view));
-
+
g_signal_connect (priv->tasks_view, "user_created", G_CALLBACK (user_created_cb), tasks);
etable = e_table_scrolled_get_table (
@@ -648,7 +648,7 @@ setup_widgets (ETasks *tasks)
e_table_drag_source_set (etable, GDK_BUTTON1_MASK,
list_drag_types, num_list_drag_types,
GDK_ACTION_MOVE|GDK_ACTION_COPY|GDK_ACTION_ASK);
-
+
g_signal_connect (etable, "table_drag_data_get",
G_CALLBACK(table_drag_data_get), tasks);
g_signal_connect (etable, "table_drag_data_delete",
@@ -670,11 +670,11 @@ setup_widgets (ETasks *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);
+ 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 ());
+ e_cal_component_preview_set_default_timezone (E_CAL_COMPONENT_PREVIEW (priv->preview), calendar_config_get_icaltimezone ());
gtk_paned_add2 (GTK_PANED (priv->paned), priv->preview);
state = calendar_config_get_preview_state ();
@@ -684,7 +684,7 @@ setup_widgets (ETasks *tasks)
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",
@@ -702,7 +702,7 @@ e_tasks_class_init (ETasksClass *class)
e_tasks_signals[SELECTION_CHANGED] =
gtk_signal_new ("selection_changed",
GTK_RUN_LAST,
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (object_class),
GTK_SIGNAL_OFFSET (ETasksClass, selection_changed),
g_cclosure_marshal_VOID__INT,
GTK_TYPE_NONE, 1,
@@ -766,7 +766,7 @@ static void
e_tasks_init (ETasks *tasks)
{
ETasksPrivate *priv;
-
+
priv = g_new0 (ETasksPrivate, 1);
tasks->priv = priv;
@@ -776,7 +776,7 @@ e_tasks_init (ETasks *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->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;
@@ -850,7 +850,7 @@ e_tasks_destroy (GtkObject *object)
g_free (priv->current_uid);
priv->current_uid = NULL;
}
-
+
if (priv->sexp) {
g_free (priv->sexp);
priv->sexp = NULL;
@@ -860,12 +860,12 @@ e_tasks_destroy (GtkObject *object)
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;
}
-
+
for (l = priv->notifications; l; l = l->next)
calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
priv->notifications = NULL;
@@ -893,7 +893,7 @@ set_status_message (ETasks *tasks, const char *message, ...)
}
priv = tasks->priv;
-
+
e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->tasks_view), msg_string, -1);
}
@@ -929,7 +929,7 @@ backend_died_cb (ECal *client, gpointer data)
ETasks *tasks;
ETasksPrivate *priv;
ESource *source;
-
+
tasks = E_TASKS (data);
priv = tasks->priv;
@@ -941,10 +941,10 @@ backend_died_cb (ECal *client, gpointer data)
gtk_signal_emit (GTK_OBJECT (tasks), e_tasks_signals[SOURCE_REMOVED], source);
e_calendar_table_set_status_message (E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)), NULL, -1);
-
+
e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))),
"calendar:tasks-crashed", NULL);
-
+
g_object_unref (source);
}
@@ -1009,7 +1009,7 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, ETasks *tasks)
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;
@@ -1046,11 +1046,11 @@ open_ecal (ETasks *tasks, ECal *cal, gboolean only_if_exists, open_func of)
icaltimezone *zone;
priv = tasks->priv;
-
+
zone = calendar_config_get_icaltimezone ();
e_cal_set_default_timezone (cal, zone, NULL);
-
+
set_status_message (tasks, _("Opening tasks at %s"), e_cal_get_uri (cal));
g_signal_connect (G_OBJECT (cal), "cal_opened", G_CALLBACK (of), tasks);
@@ -1063,7 +1063,7 @@ void
e_tasks_open_task (ETasks *tasks)
{
ECalendarTable *cal_table;
-
+
cal_table = e_tasks_get_calendar_table (tasks);
e_calendar_table_open_selected (cal_table);
}
@@ -1077,7 +1077,7 @@ e_tasks_new_task (ETasks *tasks)
const char *category;
ECal *ecal;
guint32 flags = 0;
-
+
g_return_if_fail (E_IS_TASKS (tasks));
priv = tasks->priv;
@@ -1086,9 +1086,9 @@ e_tasks_new_task (ETasks *tasks)
ecal = e_tasks_get_default_client (tasks);
if (!ecal)
return;
-
+
flags |= COMP_EDITOR_NEW_ITEM | COMP_EDITOR_USER_ORG;
-
+
comp = cal_comp_task_new_with_defaults (ecal);
category = cal_search_bar_get_category (CAL_SEARCH_BAR (priv->search_bar));
@@ -1117,32 +1117,32 @@ e_tasks_show_preview (ETasks *tasks, gboolean state)
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));
+ e_cal_component_preview_clear (E_CAL_COMPONENT_PREVIEW (priv->preview));
gtk_widget_hide (priv->preview);
}
}
@@ -1168,10 +1168,10 @@ e_tasks_add_todo_source (ETasks *tasks, ESource *source)
return TRUE;
} else {
ESource *default_source;
-
+
if (priv->default_client) {
default_source = e_cal_get_source (priv->default_client);
-
+
/* We don't have it but the default client is it */
if (!strcmp (e_source_peek_uid (default_source), uid))
client = g_object_ref (priv->default_client);
@@ -1188,7 +1188,7 @@ e_tasks_add_todo_source (ETasks *tasks, ESource *source)
g_signal_connect (G_OBJECT (client), "backend_error", G_CALLBACK (backend_error_cb), tasks);
g_signal_connect (G_OBJECT (client), "backend_died", G_CALLBACK (backend_died_cb), tasks);
- /* add the client to internal structure */
+ /* add the client to internal structure */
g_hash_table_insert (priv->clients, g_strdup (uid) , client);
priv->clients_list = g_list_prepend (priv->clients_list, client);
@@ -1215,19 +1215,19 @@ e_tasks_remove_todo_source (ETasks *tasks, ESource *source)
uid = e_source_peek_uid (source);
client = g_hash_table_lookup (priv->clients, uid);
- if (!client)
+ if (!client)
return TRUE;
-
+
priv->clients_list = g_list_remove (priv->clients_list, client);
g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, tasks);
+ 0, 0, NULL, NULL, tasks);
model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
e_cal_model_remove_client (model, client);
g_hash_table_remove (priv->clients, uid);
-
+
gtk_signal_emit (GTK_OBJECT (tasks), e_tasks_signals[SOURCE_REMOVED], source);
@@ -1239,7 +1239,7 @@ e_tasks_set_default_source (ETasks *tasks, ESource *source)
{
ETasksPrivate *priv;
ECal *ecal;
-
+
g_return_val_if_fail (tasks != NULL, FALSE);
g_return_val_if_fail (E_IS_TASKS (tasks), FALSE);
g_return_val_if_fail (E_IS_SOURCE (source), FALSE);
@@ -1268,19 +1268,19 @@ 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)));
+ 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
@@ -1304,7 +1304,7 @@ e_tasks_complete_selected (ETasks *tasks)
/**
* e_tasks_delete_selected:
* @tasks: A tasks control widget.
- *
+ *
* Deletes the selected tasks in the task list.
**/
void
@@ -1329,7 +1329,7 @@ e_tasks_delete_selected (ETasks *tasks)
/**
* e_tasks_expunge:
* @tasks: A tasks control widget
- *
+ *
* Removes all tasks marked as completed
**/
void
@@ -1338,7 +1338,7 @@ e_tasks_delete_completed (ETasks *tasks)
ETasksPrivate *priv;
char *sexp;
GList *l;
-
+
g_return_if_fail (tasks != NULL);
g_return_if_fail (E_IS_TASKS (tasks));
@@ -1346,23 +1346,23 @@ e_tasks_delete_completed (ETasks *tasks)
sexp = g_strdup ("(is-completed?)");
- set_status_message (tasks, _("Expunging"));
+ set_status_message (tasks, _("Expunging"));
for (l = priv->clients_list; l != NULL; l = l->next) {
ECal *client = l->data;
GList *objects, *m;
gboolean read_only = TRUE;
-
+
e_cal_is_read_only (client, &read_only, NULL);
if (read_only)
continue;
-
+
if (!e_cal_get_object_list (client, sexp, &objects, NULL)) {
g_warning (G_STRLOC ": Could not get the objects");
-
+
continue;
}
-
+
for (m = objects; m; m = m->next) {
/* FIXME Better error handling */
e_cal_remove_object (client, icalcomponent_get_uid (m->data), NULL);
@@ -1396,7 +1396,7 @@ display_view_cb (GalViewInstance *instance, GalView *view, gpointer data)
* e_tasks_setup_view_menus:
* @tasks: A tasks widget.
* @uic: UI controller to use for the menus.
- *
+ *
* Sets up the #GalView menus for a tasks control. This function should be
* called from the Bonobo control activation callback for this tasks control.
* Also, the menus should be discarded using e_tasks_discard_view_menus().
@@ -1432,7 +1432,7 @@ e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic)
dir0 = g_build_filename (EVOLUTION_GALVIEWSDIR,
"tasks",
NULL);
- dir1 = g_build_filename (tasks_component_peek_base_directory (tasks_component_peek ()),
+ dir1 = g_build_filename (tasks_component_peek_base_directory (tasks_component_peek ()),
"tasks", "views", NULL);
gal_view_collection_set_storage_directories (collection,
dir0,
@@ -1472,7 +1472,7 @@ e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic)
/**
* e_tasks_discard_view_menus:
* @tasks: A tasks widget.
- *
+ *
* Discards the #GalView menus used by a tasks control. This function should be
* called from the Bonobo control deactivation callback for this tasks control.
* The menus should have been set up with e_tasks_setup_view_menus().
@@ -1510,7 +1510,7 @@ e_tasks_open_task_id (ETasks *tasks,
if (!src_uid || !comp_uid)
return;
-
+
for (l = tasks->priv->clients_list; l != NULL; l = l->next) {
ESource *client_src;
@@ -1521,7 +1521,7 @@ e_tasks_open_task_id (ETasks *tasks,
break;
}
- if (!client)
+ if (!client)
return;
e_cal_get_object (client, comp_uid, comp_rid, &icalcomp, NULL);
@@ -1539,9 +1539,9 @@ e_tasks_open_task_id (ETasks *tasks,
/**
* 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.
**/