diff options
Diffstat (limited to 'calendar/gui/tasks-control.c')
-rw-r--r-- | calendar/gui/tasks-control.c | 262 |
1 files changed, 0 insertions, 262 deletions
diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c index 7ee468e768..1be68ac35e 100644 --- a/calendar/gui/tasks-control.c +++ b/calendar/gui/tasks-control.c @@ -53,36 +53,15 @@ static void tasks_control_activate_cb (BonoboControl *control, gboolean activate, gpointer user_data); -static void tasks_control_open_task_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path); static void tasks_control_new_task_cmd (BonoboUIComponent *uic, gpointer data, const char *path); -static void tasks_control_cut_cmd (BonoboUIComponent *uic, - gpointer data, - const gchar *path); -static void tasks_control_copy_cmd (BonoboUIComponent *uic, - gpointer data, - const gchar *path); -static void tasks_control_paste_cmd (BonoboUIComponent *uic, - gpointer data, - const gchar *path); -static void tasks_control_delete_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path); static void tasks_control_complete_cmd (BonoboUIComponent *uic, gpointer data, const char *path); static void tasks_control_purge_cmd (BonoboUIComponent *uic, gpointer data, const char *path); -static void tasks_control_print_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path); -static void tasks_control_print_preview_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path); static void tasks_control_assign_cmd (BonoboUIComponent *uic, gpointer data, const char *path); @@ -91,68 +70,6 @@ static void tasks_control_forward_cmd (BonoboUIComponent *uic, gpointer data, const char *path); -static void tasks_control_view_preview (BonoboUIComponent *uic, - const char *path, - Bonobo_UIComponent_EventType type, - const char *state, - void *data); - -struct focus_changed_data { - BonoboControl *control; - ETasks *tasks; -}; - -static gboolean tasks_control_focus_changed (GtkWidget *widget, GdkEventFocus *event, struct focus_changed_data *fc_data); - -BonoboControl * -tasks_control_new (void) -{ - BonoboControl *control; - GtkWidget *tasks, *preview; - struct focus_changed_data *fc_data; - - tasks = e_tasks_new (); - if (!tasks) - return NULL; - gtk_widget_show (tasks); - - control = bonobo_control_new (tasks); - if (!control) { - gtk_widget_destroy (tasks); - g_message ("control_factory_fn(): could not create the control!"); - return NULL; - } - - g_signal_connect (control, "activate", G_CALLBACK (tasks_control_activate_cb), tasks); - - fc_data = g_new0 (struct focus_changed_data, 1); - fc_data->control = control; - fc_data->tasks = E_TASKS (tasks); - - preview = e_cal_component_preview_get_html (E_CAL_COMPONENT_PREVIEW (e_tasks_get_preview (fc_data->tasks))); - g_object_set_data_full (G_OBJECT (preview), "tasks-ctrl-fc-data", fc_data, g_free); - g_signal_connect (preview, "focus-in-event", G_CALLBACK (tasks_control_focus_changed), fc_data); - g_signal_connect (preview, "focus-out-event", G_CALLBACK (tasks_control_focus_changed), fc_data); - - return control; -} - - -static void -tasks_control_activate_cb (BonoboControl *control, - gboolean activate, - gpointer user_data) -{ - ETasks *tasks; - - tasks = E_TASKS (user_data); - - if (activate) - tasks_control_activate (control, tasks); - else - tasks_control_deactivate (control, tasks); -} - struct _tasks_sensitize_item { const gchar *command; guint32 enable; @@ -267,38 +184,14 @@ tasks_control_focus_changed (GtkWidget *widget, GdkEventFocus *event, struct foc } static BonoboUIVerb verbs [] = { - BONOBO_UI_VERB ("TasksOpenTask", tasks_control_open_task_cmd), BONOBO_UI_VERB ("TasksNewTask", tasks_control_new_task_cmd), - BONOBO_UI_VERB ("TasksCut", tasks_control_cut_cmd), - BONOBO_UI_VERB ("TasksCopy", tasks_control_copy_cmd), - BONOBO_UI_VERB ("TasksPaste", tasks_control_paste_cmd), - BONOBO_UI_VERB ("TasksDelete", tasks_control_delete_cmd), BONOBO_UI_VERB ("TasksMarkComplete", tasks_control_complete_cmd), BONOBO_UI_VERB ("TasksPurge", tasks_control_purge_cmd), - BONOBO_UI_VERB ("TasksPrint", tasks_control_print_cmd), - BONOBO_UI_VERB ("TasksPrintPreview", tasks_control_print_preview_cmd), BONOBO_UI_VERB ("TasksAssign", tasks_control_assign_cmd), BONOBO_UI_VERB ("TasksForward", tasks_control_forward_cmd), BONOBO_UI_VERB_END }; -static EPixmap pixmaps [] = { - E_PIXMAP ("/commands/TasksCopy", "edit-copy", GTK_ICON_SIZE_MENU), - E_PIXMAP ("/commands/TasksCut", "edit-cut", GTK_ICON_SIZE_MENU), - E_PIXMAP ("/commands/TasksDelete", "edit-delete", GTK_ICON_SIZE_MENU), - E_PIXMAP ("/commands/TasksForward", "mail-forward", GTK_ICON_SIZE_MENU), - E_PIXMAP ("/commands/TasksPaste", "edit-paste", GTK_ICON_SIZE_MENU), - E_PIXMAP ("/commands/TasksPrint", "document-print", GTK_ICON_SIZE_MENU), - E_PIXMAP ("/commands/TasksPrintPreview", "document-print-preview", GTK_ICON_SIZE_MENU), - - E_PIXMAP ("/Toolbar/Cut", "edit-cut", GTK_ICON_SIZE_LARGE_TOOLBAR), - E_PIXMAP ("/Toolbar/Copy", "edit-copy", GTK_ICON_SIZE_LARGE_TOOLBAR), - E_PIXMAP ("/Toolbar/Paste", "edit-paste", GTK_ICON_SIZE_LARGE_TOOLBAR), - E_PIXMAP ("/Toolbar/Print", "document-print", GTK_ICON_SIZE_LARGE_TOOLBAR), - E_PIXMAP ("/Toolbar/Delete", "edit-delete", GTK_ICON_SIZE_LARGE_TOOLBAR), - - E_PIXMAP_END -}; void tasks_control_activate (BonoboControl *control, ETasks *tasks) { @@ -332,8 +225,6 @@ tasks_control_activate (BonoboControl *control, ETasks *tasks) NULL); g_free (xmlfile); - e_pixmaps_update (uic, pixmaps); - e_tasks_setup_view_menus (tasks, uic); /* Signals from the tasks widget; also sensitize the menu items as appropriate */ @@ -375,16 +266,6 @@ tasks_control_deactivate (BonoboControl *control, ETasks *tasks) bonobo_ui_component_unset_container (uic, NULL); } -static void tasks_control_open_task_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path) -{ - ETasks *tasks; - - tasks = E_TASKS (data); - e_tasks_open_task (tasks); -} - static void tasks_control_new_task_cmd (BonoboUIComponent *uic, gpointer data, @@ -397,65 +278,6 @@ tasks_control_new_task_cmd (BonoboUIComponent *uic, } static void -tasks_control_cut_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path) -{ - ETasks *tasks; - ECalendarTable *cal_table; - - tasks = E_TASKS (data); - cal_table = e_tasks_get_calendar_table (tasks); - e_calendar_table_cut_clipboard (cal_table); -} - -static void -tasks_control_copy_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path) -{ - ETasks *tasks; - ECalendarTable *cal_table; - GtkWidget *preview; - - tasks = E_TASKS (data); - - - preview = e_cal_component_preview_get_html (E_CAL_COMPONENT_PREVIEW (e_tasks_get_preview (tasks))); - if (preview && GTK_WIDGET_VISIBLE (preview) && GTK_WIDGET_HAS_FOCUS (preview)) { - /* copy selected text in a preview when that's shown and focused */ - gtk_html_copy (GTK_HTML (preview)); - } else { - cal_table = e_tasks_get_calendar_table (tasks); - e_calendar_table_copy_clipboard (cal_table); - } -} - -static void -tasks_control_paste_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path) -{ - ETasks *tasks; - ECalendarTable *cal_table; - - tasks = E_TASKS (data); - cal_table = e_tasks_get_calendar_table (tasks); - e_calendar_table_paste_clipboard (cal_table); -} - -static void -tasks_control_delete_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path) -{ - ETasks *tasks; - - tasks = E_TASKS (data); - e_tasks_delete_selected (tasks); -} - -static void tasks_control_complete_cmd (BonoboUIComponent *uic, gpointer data, const char *path) @@ -511,87 +333,3 @@ tasks_control_purge_cmd (BonoboUIComponent *uic, if (confirm_purge (tasks)) e_tasks_delete_completed (tasks); } - -/* File/Print callback */ -static void -tasks_control_print_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path) -{ - ETasks *tasks = E_TASKS (data); - ETable *table; - - table = e_calendar_table_get_table ( - E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks))); - - print_table ( - table, _("Print Tasks"), _("Tasks"), - GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); -} - -static void -tasks_control_print_preview_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path) -{ - ETasks *tasks = E_TASKS (data); - ETable *table; - - table = e_calendar_table_get_table ( - E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks))); - - print_table ( - table, _("Print Tasks"), _("Tasks"), - GTK_PRINT_OPERATION_ACTION_PREVIEW); -} - -static void -tasks_control_assign_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path) -{ - ETasks *tasks; - ECalendarTable *cal_table; - ECalModelComponent *comp_data; - - tasks = E_TASKS (data); - cal_table = e_tasks_get_calendar_table (tasks); - comp_data = e_calendar_table_get_selected_comp (cal_table); - if (comp_data) - e_calendar_table_open_task (cal_table, comp_data->client, comp_data->icalcomp, TRUE); -} - -static void -tasks_control_forward_cmd (BonoboUIComponent *uic, - gpointer data, - const char *path) -{ - ETasks *tasks; - ECalendarTable *cal_table; - ECalModelComponent *comp_data; - - tasks = E_TASKS (data); - cal_table = e_tasks_get_calendar_table (tasks); - comp_data = e_calendar_table_get_selected_comp (cal_table); - if (comp_data) { - ECalComponent *comp; - comp = e_cal_component_new (); - e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); - itip_send_comp (E_CAL_COMPONENT_METHOD_PUBLISH, comp, comp_data->client, NULL, NULL, NULL, TRUE); - g_object_unref (comp); - } -} - -static void -tasks_control_view_preview (BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data) -{ - ETasks *tasks; - - if (type != Bonobo_UIComponent_STATE_CHANGED) - return; - - tasks = E_TASKS (data); - - calendar_config_set_preview_state (state[0] != '0'); - e_tasks_show_preview (tasks, state[0] != '0'); -} |