diff options
28 files changed, 536 insertions, 1349 deletions
diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index a2c40200d5..018a2fd8f7 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -28,10 +28,11 @@ #include <libedataserverui/e-name-selector-entry.h> #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <e-preferences-window.h> #include <libedataserver/e-source-list.h> #include <libedataserverui/e-source-selector.h> +#include "widgets/misc/e-preferences-window.h" + static void source_selection_changed_cb (ESourceSelector *source_selector) { 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 diff --git a/mail/Makefile.am b/mail/Makefile.am index 8eaf2ae5de..5165e04527 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -53,6 +53,8 @@ libevolution_module_mail_la_SOURCES = \ e-searching-tokenizer.h \ em-account-editor.c \ em-account-editor.h \ + em-account-prefs.c \ + em-account-prefs.h \ em-composer-prefs.c \ em-composer-prefs.h \ em-composer-utils.c \ @@ -105,6 +107,10 @@ libevolution_module_mail_la_SOURCES = \ em-inline-filter.h \ em-junk-hook.c \ em-junk-hook.h \ + em-mailer-prefs.c \ + em-mailer-prefs.h \ + em-network-prefs.c \ + em-network-prefs.h \ em-popup.c \ em-popup.h \ em-search-context.c \ @@ -238,14 +244,10 @@ libevolution_module_mail_la_LIBADD = \ # em-icon-stream.c \ # em-inline-filter.c \ # em-junk-hook.c \ -# em-mailer-prefs.c \ -# em-mailer-prefs.h \ # em-menu.c \ # em-message-browser.c \ # em-migrate.c \ # em-migrate.h \ -# em-network-prefs.c \ -# em-network-prefs.h \ # em-popup.c \ # em-search-context.c \ # em-search-context.h \ @@ -263,8 +265,6 @@ libevolution_module_mail_la_LIBADD = \ # mail-autofilter.c \ # mail-component-factory.c \ # mail-component.c \ -# mail-config-factory.c \ -# mail-config-factory.h \ # mail-config.c \ # mail-crypto.c \ # mail-crypto.h \ diff --git a/mail/e-mail-shell-module.c b/mail/e-mail-shell-module.c index 7ee718a9de..b7aa7a68c1 100644 --- a/mail/e-mail-shell-module.c +++ b/mail/e-mail-shell-module.c @@ -27,17 +27,22 @@ #include "e-util/e-util.h" #include "shell/e-shell.h" #include "shell/e-shell-window.h" +#include "widgets/misc/e-preferences-window.h" #include "e-mail-shell-view.h" #include "e-mail-shell-module.h" #include "e-mail-shell-module-migrate.h" +#include "em-account-prefs.h" +#include "em-composer-prefs.h" #include "em-config.h" #include "em-event.h" #include "em-folder-tree-model.h" #include "em-format-hook.h" #include "em-format-html-display.h" #include "em-junk-hook.h" +#include "em-mailer-prefs.h" +#include "em-network-prefs.h" #include "mail-config.h" #include "mail-folder-cache.h" #include "mail-mt.h" @@ -413,17 +418,57 @@ static GtkActionEntry source_entries[] = { G_CALLBACK (action_mail_folder_new_cb) } }; +static void +mail_shell_module_init_preferences (void) +{ + GtkWidget *preferences_window; + + preferences_window = e_shell_get_preferences_window (); + + e_preferences_window_add_page ( + E_PREFERENCES_WINDOW (preferences_window), + "mail-accounts", + "preferences-mail-accounts", + _("Mail Accounts"), + em_account_prefs_new (), + 100); + + e_preferences_window_add_page ( + E_PREFERENCES_WINDOW (preferences_window), + "mail", + "preferences-mail", + _("Mail Preferences"), + em_mailer_prefs_new (), + 300); + + e_preferences_window_add_page ( + E_PREFERENCES_WINDOW (preferences_window), + "composer", + "preferences-composer", + _("Composer Preferences"), + em_composer_prefs_new (), + 400); + + e_preferences_window_add_page ( + E_PREFERENCES_WINDOW (preferences_window), + "system-network-proxy", + "preferences-system-network-proxy", + _("Network Preferences"), + em_network_prefs_new (), + 500); +} + static gboolean -mail_module_handle_uri (EShellModule *shell_module, - const gchar *uri) +mail_shell_module_handle_uri (EShellModule *shell_module, + const gchar *uri) { /* FIXME */ return FALSE; } static void -mail_module_window_created (EShellModule *shell_module, - EShellWindow *shell_window) +mail_shell_module_window_created (EShellModule *shell_module, + EShellWindow *shell_window) { EShell *shell; const gchar *module_name; @@ -489,17 +534,18 @@ e_shell_module_init (GTypeModule *type_module) g_signal_connect_swapped ( shell, "handle-uri", - G_CALLBACK (mail_module_handle_uri), shell_module); + G_CALLBACK (mail_shell_module_handle_uri), shell_module); g_signal_connect_swapped ( shell, "window-created", - G_CALLBACK (mail_module_window_created), shell_module); + G_CALLBACK (mail_shell_module_window_created), shell_module); mail_config_init (); mail_msg_init (); mail_shell_module_init_local_store (shell_module); mail_shell_module_load_accounts (shell_module); + mail_shell_module_init_preferences (); } /******************************** Public API *********************************/ @@ -597,3 +643,10 @@ fail: return NULL; } + +void +e_mail_shell_module_remove_store_by_uri (EShellModule *shell_module, + const gchar *uri) +{ + /* FIXME */ +} diff --git a/mail/e-mail-shell-module.h b/mail/e-mail-shell-module.h index fb1cd3885d..b15c8ed8c8 100644 --- a/mail/e-mail-shell-module.h +++ b/mail/e-mail-shell-module.h @@ -66,6 +66,9 @@ CamelStore * e_mail_shell_module_load_store_by_uri (EShellModule *shell_module, const gchar *uri, const gchar *name); +void e_mail_shell_module_remove_store_by_uri + (EShellModule *shell_module, + const gchar *uri); G_END_DECLS diff --git a/mail/em-account-prefs.c b/mail/em-account-prefs.c index 56bb4ce1df..e27c7d3ee3 100644 --- a/mail/em-account-prefs.c +++ b/mail/em-account-prefs.c @@ -28,7 +28,6 @@ #include <glib/gi18n.h> -#include "mail-component.h" #include "mail-config.h" #include "mail-ops.h" #include "mail-send-recv.h" @@ -38,8 +37,8 @@ #include "e-util/e-util-private.h" #include "em-account-prefs.h" - #include "em-account-editor.h" +#include "e-mail-shell-module.h" static void em_account_prefs_class_init (EMAccountPrefsClass *class); static void em_account_prefs_init (EMAccountPrefs *prefs); @@ -239,7 +238,8 @@ account_delete_clicked (GtkButton *button, gpointer user_data) /* remove it from the folder-tree in the shell */ if (account->enabled && account->source && account->source->url) - mail_component_remove_store_by_uri (mail_component_peek (), account->source->url); + e_mail_shell_module_remove_store_by_uri ( + mail_shell_module, account->source->url); /* remove all the proxies account has created*/ if (has_proxies) @@ -292,17 +292,16 @@ account_default_clicked (GtkButton *button, gpointer user_data) static void account_able_changed(EAccount *account) { - MailComponent *component = mail_component_peek (); - /* FIXME: do this directly by listening to the mail accounts changed events in the relevant components */ if (account->source->url) { if (account->enabled) - mail_component_load_store_by_uri (component, - account->source->url, - account->name); + e_mail_shell_module_load_store_by_uri ( + mail_shell_module, + account->source->url, account->name); else - mail_component_remove_store_by_uri (component, account->source->url); + e_mail_shell_module_remove_store_by_uri ( + mail_shell_module, account->source->url); } mail_config_write (); @@ -565,13 +564,12 @@ em_account_prefs_construct (EMAccountPrefs *prefs) } GtkWidget * -em_account_prefs_new (GNOME_Evolution_Shell shell) +em_account_prefs_new (void) { EMAccountPrefs *new; new = (EMAccountPrefs *) g_object_new (em_account_prefs_get_type (), NULL); em_account_prefs_construct (new); - new->shell = shell; return (GtkWidget *) new; } diff --git a/mail/em-account-prefs.h b/mail/em-account-prefs.h index c63b9f562e..c3932aefc9 100644 --- a/mail/em-account-prefs.h +++ b/mail/em-account-prefs.h @@ -21,29 +21,33 @@ * */ -#ifndef __EM_ACCOUNT_PREFS_H__ -#define __EM_ACCOUNT_PREFS_H__ +#ifndef EM_ACCOUNT_PREFS_H +#define EM_ACCOUNT_PREFS_H #include <gtk/gtk.h> #include <glade/glade.h> - #include <table/e-table.h> -#include "evolution-config-control.h" - -#include <shell/Evolution.h> - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - - -#define EM_ACCOUNT_PREFS_TYPE (em_account_prefs_get_type ()) -#define EM_ACCOUNT_PREFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EM_ACCOUNT_PREFS_TYPE, EMAccountPrefs)) -#define EM_ACCOUNT_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EM_ACCOUNT_PREFS_TYPE, EMAccountPrefsClass)) -#define EM_IS_ACCOUNT_PREFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EM_ACCOUNT_PREFS_TYPE)) -#define EM_IS_ACCOUNT_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EM_ACCOUNT_PREFS_TYPE)) +/* Standard GObject macros */ +#define EM_TYPE_ACCOUNT_PREFS \ + (em_account_prefs_get_type ()) +#define EM_ACCOUNT_PREFS(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), EM_TYPE_ACCOUNT_PREFS, EMAccountPrefs)) +#define EM_ACCOUNT_PREFS_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), EM_TYPE_ACCOUNT_PREFS, EMAccountPrefsClass)) +#define EM_IS_ACCOUNT_PREFS(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), EM_TYPE_ACCOUNT_PREFS)) +#define EM_IS_ACCOUNT_PREFS_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), EM_TYPE_ACCOUNT_PREFS)) +#define EM_ACCOUNT_PREFS_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), EM_TYPE_ACCOUNT_PREFS, EMAccountPrefsClass)) + +G_BEGIN_DECLS typedef struct _EMAccountPrefs EMAccountPrefs; typedef struct _EMAccountPrefsClass EMAccountPrefsClass; @@ -51,8 +55,6 @@ typedef struct _EMAccountPrefsClass EMAccountPrefsClass; struct _EMAccountPrefs { GtkVBox parent_object; - GNOME_Evolution_Shell shell; - GladeXML *gui; GtkWidget *druid; @@ -71,21 +73,11 @@ struct _EMAccountPrefs { struct _EMAccountPrefsClass { GtkVBoxClass parent_class; - - /* signals */ - }; +GType em_account_prefs_get_type (void); +GtkWidget * em_account_prefs_new (void); -GType em_account_prefs_get_type (void); - -GtkWidget *em_account_prefs_new (GNOME_Evolution_Shell shell); - -/* needed by global config */ -#define EM_ACCOUNT_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_AccountPrefs_ConfigControl:" BASE_VERSION - -#ifdef __cplusplus -} -#endif +G_END_DECLS -#endif /* __EM_ACCOUNT_PREFS_H__ */ +#endif /* EM_ACCOUNT_PREFS_H */ diff --git a/mail/em-mailer-prefs.h b/mail/em-mailer-prefs.h index 63c85af65e..4073725dda 100644 --- a/mail/em-mailer-prefs.h +++ b/mail/em-mailer-prefs.h @@ -20,35 +20,33 @@ * */ -#ifndef __EM_MAILER_PREFS_H__ -#define __EM_MAILER_PREFS_H__ - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ +#ifndef EM_MAILER_PREFS_H +#define EM_MAILER_PREFS_H #include <gtk/gtk.h> -#include <shell/Evolution.h> - -struct _ESignature; -struct _GtkToggleButton; -struct _GtkOptionMenu; -struct _GdkPixbuf; -struct _GtkWidget; -struct _GladeXML; -struct _GtkFileChooserbutton; -struct _GtkFontButton; -struct _GConfClient; -struct _GtkButton; -struct _GtkTreeView; -struct _GtkWindow; - -#define EM_MAILER_PREFS_TYPE (em_mailer_prefs_get_type ()) -#define EM_MAILER_PREFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EM_MAILER_PREFS_TYPE, EMMailerPrefs)) -#define EM_MAILER_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EM_MAILER_PREFS_TYPE, EMMailerPrefsClass)) -#define EM_IS_MAILER_PREFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EM_MAILER_PREFS_TYPE)) -#define EM_IS_MAILER_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EM_MAILER_PREFS_TYPE)) +#include <glade/glade.h> +#include <gconf/gconf-client.h> + +/* Standard GObject macros */ +#define EM_TYPE_MAILER_PREFS \ + (em_mailer_prefs_get_type ()) +#define EM_MAILER_PREFS(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), EM_TYPE_MAILER_PREFS, EMMailerPrefs)) +#define EM_MAILER_PREFS_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), EM_TYPE_MAILER_PREFS, EMMailerPrefsClass)) +#define EM_IS_MAILER_PREFS(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), EM_TYPE_MAILER_PREFS)) +#define EM_IS_MAILER_PREFS_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), EM_TYPE_MAILER_PREFS)) +#define EM_MAILER_PREFS_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), EM_TYPE_MAILER_PREFS)) + +G_BEGIN_DECLS typedef struct _EMMailerPrefs EMMailerPrefs; typedef struct _EMMailerPrefsClass EMMailerPrefsClass; @@ -63,103 +61,94 @@ struct _EMMailerPrefsHeader { struct _EMMailerPrefs { GtkVBox parent_object; - GNOME_Evolution_Shell shell; - - struct _GladeXML *gui; - struct _GConfClient *gconf; + GladeXML *gui; + GConfClient *gconf; /* General tab */ /* Message Display */ - struct _GtkToggleButton *timeout_toggle; - struct _GtkSpinButton *timeout; - struct _GtkToggleButton *address_toggle; - struct _GtkSpinButton *address_count; - struct _GtkToggleButton *mlimit_toggle; - struct _GtkSpinButton *mlimit_count; - struct _GtkOptionMenu *charset; - struct _GtkToggleButton *citation_highlight; - struct _GtkColorButton *citation_color; - struct _GtkToggleButton *enable_search_folders; - struct _GtkToggleButton *magic_spacebar; + GtkToggleButton *timeout_toggle; + GtkSpinButton *timeout; + GtkToggleButton *address_toggle; + GtkSpinButton *address_count; + GtkToggleButton *mlimit_toggle; + GtkSpinButton *mlimit_count; + GtkOptionMenu *charset; + GtkToggleButton *citation_highlight; + GtkColorButton *citation_color; + GtkToggleButton *enable_search_folders; + GtkToggleButton *magic_spacebar; /* Deleting Mail */ - struct _GtkToggleButton *empty_trash; - struct _GtkOptionMenu *empty_trash_days; - struct _GtkToggleButton *confirm_expunge; + GtkToggleButton *empty_trash; + GtkOptionMenu *empty_trash_days; + GtkToggleButton *confirm_expunge; /* HTML Mail tab */ - struct _GtkFontButton *font_variable; - struct _GtkFontButton *font_fixed; - struct _GtkToggleButton *font_share; + GtkFontButton *font_variable; + GtkFontButton *font_fixed; + GtkToggleButton *font_share; /* Loading Images */ - struct _GtkToggleButton *images_always; - struct _GtkToggleButton *images_sometimes; - struct _GtkToggleButton *images_never; + GtkToggleButton *images_always; + GtkToggleButton *images_sometimes; + GtkToggleButton *images_never; - struct _GtkToggleButton *show_animated; - struct _GtkToggleButton *autodetect_links; - struct _GtkToggleButton *prompt_unwanted_html; + GtkToggleButton *show_animated; + GtkToggleButton *autodetect_links; + GtkToggleButton *prompt_unwanted_html; /* Labels and Colours tab */ - struct _GtkWidget *label_add; - struct _GtkWidget *label_edit; - struct _GtkWidget *label_remove; - struct _GtkWidget *label_tree; - struct _GtkListStore *label_list_store; + GtkWidget *label_add; + GtkWidget *label_edit; + GtkWidget *label_remove; + GtkWidget *label_tree; + GtkListStore *label_list_store; guint labels_change_notify_id; /* mail_config's notify id */ /* Headers tab */ - struct _GtkButton *add_header; - struct _GtkButton *remove_header; - struct _GtkEntry *entry_header; - struct _GtkTreeView *header_list; - struct _GtkListStore *header_list_store; - struct _GtkToggleButton *photo_show; - struct _GtkToggleButton *photo_local; + GtkButton *add_header; + GtkButton *remove_header; + GtkEntry *entry_header; + GtkTreeView *header_list; + GtkListStore *header_list_store; + GtkToggleButton *photo_show; + GtkToggleButton *photo_local; /* Junk prefs */ - struct _GtkToggleButton *check_incoming; - struct _GtkToggleButton *empty_junk; - struct _GtkOptionMenu *empty_junk_days; + GtkToggleButton *check_incoming; + GtkToggleButton *empty_junk; + GtkOptionMenu *empty_junk_days; - struct _GtkToggleButton *sa_local_tests_only; - struct _GtkToggleButton *sa_use_daemon; - struct _GtkComboBox *default_junk_plugin; - struct _GtkLabel *plugin_status; - struct _GtkImage *plugin_image; - - struct _GtkToggleButton *junk_header_check; - struct _GtkTreeView *junk_header_tree; - struct _GtkListStore *junk_header_list_store; - struct _GtkButton *junk_header_add; - struct _GtkButton *junk_header_remove; - struct _GtkToggleButton *junk_book_lookup; - struct _GtkToggleButton *junk_lookup_local_only; + GtkToggleButton *sa_local_tests_only; + GtkToggleButton *sa_use_daemon; + GtkComboBox *default_junk_plugin; + GtkLabel *plugin_status; + GtkImage *plugin_image; + + GtkToggleButton *junk_header_check; + GtkTreeView *junk_header_tree; + GtkListStore *junk_header_list_store; + GtkButton *junk_header_add; + GtkButton *junk_header_remove; + GtkToggleButton *junk_book_lookup; + GtkToggleButton *junk_lookup_local_only; }; struct _EMMailerPrefsClass { GtkVBoxClass parent_class; - - /* signals */ - }; -GType em_mailer_prefs_get_type (void); -GtkWidget * create_combo_text_widget (void); - -struct _GtkWidget *em_mailer_prefs_new (void); +GType em_mailer_prefs_get_type (void); +GtkWidget * create_combo_text_widget (void); -EMMailerPrefsHeader *em_mailer_prefs_header_from_xml(const char *xml); -char *em_mailer_prefs_header_to_xml(EMMailerPrefsHeader *header); -void em_mailer_prefs_header_free(EMMailerPrefsHeader *header); +GtkWidget * em_mailer_prefs_new (void); -/* needed by global config */ -#define EM_MAILER_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_MailerPrefs_ConfigControl:" BASE_VERSION +EMMailerPrefsHeader * + em_mailer_prefs_header_from_xml (const gchar *xml); +gchar * em_mailer_prefs_header_to_xml (EMMailerPrefsHeader *header); +void em_mailer_prefs_header_free (EMMailerPrefsHeader *header); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS -#endif /* __EM_MAILER_PREFS_H__ */ +#endif /* EM_MAILER_PREFS_H */ diff --git a/mail/em-network-prefs.h b/mail/em-network-prefs.h index de0951714f..41b4539608 100644 --- a/mail/em-network-prefs.h +++ b/mail/em-network-prefs.h @@ -20,30 +20,37 @@ * */ -#ifndef __EM_NETWORK_PREFS_H__ -#define __EM_NETWORK_PREFS_H__ - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ +#ifndef EM_NETWORK_PREFS_H +#define EM_NETWORK_PREFS_H #include <gtk/gtk.h> - -#define EM_NETWORK_PREFS_TYPE (em_network_prefs_get_type ()) -#define EM_NETWORK_PREFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EM_NETWORK_PREFS_TYPE, EMNetworkPrefs)) -#define EM_NETWORK_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EM_NETWORK_PREFS_TYPE, EMNetworkPrefsClass)) -#define EM_IS_NETWORK_PREFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EM_NETWORK_PREFS_TYPE)) -#define EM_IS_NETWORK_PREFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EM_NETWORK_PREFS_TYPE)) +#include <glade/glade.h> +#include <gconf/gconf-client.h> + +/* Standard GObject macros */ +#define EM_TYPE_NETWORK_PREFS \ + (em_network_prefs_get_type ()) +#define EM_NETWORK_PREFS(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), EM_TYPE_NETWORK_PREFS, EMNetworkPrefs)) +#define EM_NETWORK_PREFS_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), EM_TYPE_NETWORK_PREFS, EMNetworkPrefsClass)) +#define EM_IS_NETWORK_PREFS(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), EM_TYPE_NETWORK_PREFS)) +#define EM_IS_NETWORK_PREFS_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), EM_TYPE_NETWORK_PREFS)) +#define EM_NETWORK_PREFS_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), EM_TYPE_NETWORK_PREFS, EMNetworkPrefsClass)) + +G_BEGIN_DECLS typedef struct _EMNetworkPrefs EMNetworkPrefs; typedef struct _EMNetworkPrefsClass EMNetworkPrefsClass; -struct _GtkToggleButton; -struct _GtkEntry; -struct _GladeXML; -struct _GConfClient; - typedef enum { NETWORK_PROXY_SYS_SETTINGS, NETWORK_PROXY_DIRECT_CONNECTION, @@ -51,60 +58,50 @@ typedef enum { NETWORK_PROXY_AUTOCONFIG } NetworkConfigProxyType; - struct _EMNetworkPrefs { GtkVBox parent_object; - struct _GConfClient *gconf; + GConfClient *gconf; - struct _GladeXML *gui; + GladeXML *gui; /* Default Behavior */ - struct _GtkToggleButton *sys_proxy; - struct _GtkToggleButton *no_proxy; - struct _GtkToggleButton *manual_proxy; - struct _GtkToggleButton *auto_proxy; - struct _GtkToggleButton *use_auth; - - struct _GtkEntry *http_host; - struct _GtkEntry *https_host; - struct _GtkEntry *socks_host; - struct _GtkEntry *ignore_hosts; - struct _GtkEntry *auto_proxy_url; - struct _GtkEntry *auth_user; - struct _GtkEntry *auth_pwd; - - struct _GtkLabel *lbl_http_host; - struct _GtkLabel *lbl_http_port; - struct _GtkLabel *lbl_https_host; - struct _GtkLabel *lbl_https_port; - struct _GtkLabel *lbl_socks_host; - struct _GtkLabel *lbl_socks_port; - struct _GtkLabel *lbl_ignore_hosts; - struct _GtkLabel *lbl_auth_user; - struct _GtkLabel *lbl_auth_pwd; - - struct _GtkSpinButton *http_port; - struct _GtkSpinButton *https_port; - struct _GtkSpinButton *socks_port; + GtkToggleButton *sys_proxy; + GtkToggleButton *no_proxy; + GtkToggleButton *manual_proxy; + GtkToggleButton *auto_proxy; + GtkToggleButton *use_auth; + + GtkEntry *http_host; + GtkEntry *https_host; + GtkEntry *socks_host; + GtkEntry *ignore_hosts; + GtkEntry *auto_proxy_url; + GtkEntry *auth_user; + GtkEntry *auth_pwd; + + GtkLabel *lbl_http_host; + GtkLabel *lbl_http_port; + GtkLabel *lbl_https_host; + GtkLabel *lbl_https_port; + GtkLabel *lbl_socks_host; + GtkLabel *lbl_socks_port; + GtkLabel *lbl_ignore_hosts; + GtkLabel *lbl_auth_user; + GtkLabel *lbl_auth_pwd; + + GtkSpinButton *http_port; + GtkSpinButton *https_port; + GtkSpinButton *socks_port; }; struct _EMNetworkPrefsClass { GtkVBoxClass parent_class; - - /* signals */ - }; -GType em_network_prefs_get_type (void); - -struct _GtkWidget *em_network_prefs_new (void); - -/* needed by global config */ -#define EM_NETWORK_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_NetworkPrefs_ConfigControl:" BASE_VERSION +GType em_network_prefs_get_type (void); +GtkWidget * em_network_prefs_new (void); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS -#endif /* __EM_NETWORK_PREFS_H__ */ +#endif /* EM_NETWORK_PREFS_H */ diff --git a/mail/mail-config-factory.c b/mail/mail-config-factory.c deleted file mode 100644 index 74c05ec8fc..0000000000 --- a/mail/mail-config-factory.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> - -#include "em-account-prefs.h" -#include "em-composer-prefs.h" -#include "em-mailer-prefs.h" -#include "em-network-prefs.h" - -#include "mail-config-factory.h" - -#define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ConfigControlFactory:" BASE_VERSION - -BonoboObject * -mail_config_control_factory_cb (BonoboGenericFactory *factory, const char *component_id, void *user_data) -{ - GNOME_Evolution_Shell shell = (GNOME_Evolution_Shell) user_data; - EvolutionConfigControl *control; - GtkWidget *prefs = NULL; - - if (!strcmp (component_id, EM_ACCOUNT_PREFS_CONTROL_ID)) { - prefs = em_account_prefs_new (shell); - } else if (!strcmp (component_id, EM_MAILER_PREFS_CONTROL_ID)) { - prefs = em_mailer_prefs_new (); - } else if (!strcmp (component_id, EM_COMPOSER_PREFS_CONTROL_ID)) { - prefs = em_composer_prefs_new (); - } else if (!strcmp (component_id, EM_NETWORK_PREFS_CONTROL_ID)) { - prefs = em_network_prefs_new (); - } else { - g_return_val_if_reached(NULL); - } - - gtk_widget_show_all (prefs); - - control = evolution_config_control_new (prefs); - - return BONOBO_OBJECT (control); -} diff --git a/mail/mail-config-factory.h b/mail/mail-config-factory.h deleted file mode 100644 index f3a4b5fd29..0000000000 --- a/mail/mail-config-factory.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef __MAIL_CONFIG_FACTORY_H__ -#define __MAIL_CONFIG_FACTORY_H__ - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <bonobo/bonobo-generic-factory.h> -#include "evolution-config-control.h" - -#include <shell/Evolution.h> - -gboolean mail_config_register_factory (GNOME_Evolution_Shell shell); - -BonoboObject *mail_config_control_factory_cb (BonoboGenericFactory *factory, const char *component_id, void *user_data); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __MAIL_CONFIG_FACTORY_H__ */ diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index d1cebe78e1..b79417f7ea 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -63,7 +63,6 @@ shell_window_new_view (EShellWindow *shell_window, page_num, "shell-window", shell_window, NULL); /* Register the shell view. */ - g_debug ("Loaded view '%s' (page %d)", view_name, page_num); loaded_views = shell_window->priv->loaded_views; g_hash_table_insert (loaded_views, g_strdup (view_name), shell_view); diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c index 7ae9fdf596..1235ebbad8 100644 --- a/widgets/misc/e-preferences-window.c +++ b/widgets/misc/e-preferences-window.c @@ -358,6 +358,7 @@ e_preferences_window_add_page (EPreferencesWindow *window, g_hash_table_insert (index, g_strdup (page_name), reference); gtk_tree_path_free (path); + gtk_widget_show (widget); gtk_notebook_append_page (notebook, widget, NULL); if (page == 0) |