diff options
-rw-r--r-- | calendar/ChangeLog | 16 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.c | 19 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.h | 1 | ||||
-rw-r--r-- | calendar/gui/e-tasks.c | 21 | ||||
-rw-r--r-- | calendar/gui/e-tasks.h | 7 | ||||
-rw-r--r-- | calendar/gui/tasks-control.c | 18 |
6 files changed, 79 insertions, 3 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 65f7caab76..3b856c3df5 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,21 @@ 2002-01-03 JP Rosevear <jpr@ximian.com> + * gui/tasks-control.c (tasks_control_complete_cmd): new verb + callback + (sensitize_commands): set sensitivity of mark complete command + + * gui/e-tasks.h: new proto + + * gui/e-tasks.c (e_tasks_complete_selected): mark selected tasks + in the table as complete + + * gui/e-calendar-table.h: new proto + + * gui/e-calendar-table.c (e_calendar_table_complete_selected): + mark selected rows as complete + +2002-01-03 JP Rosevear <jpr@ximian.com> + * gui/tasks-control.c (confirm_expunge): only need one warning message now diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index d475f4a603..e3bbe7673e 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -101,6 +101,7 @@ static void invisible_destroyed (GtkWidget *invisible, ECalendarTable *cal_table); static struct tm e_calendar_table_get_current_time (ECellDateEdit *ecde, gpointer data); +static void mark_row_complete_cb (int model_row, gpointer data); /* The icons to represent the task. */ @@ -637,6 +638,24 @@ e_calendar_table_get_table (ECalendarTable *cal_table) return e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable)); } +/** + * e_calendar_table_complete_selected: + * @cal_table: A calendar table + * + * Marks the selected items as completed + **/ +void +e_calendar_table_complete_selected (ECalendarTable *cal_table) +{ + ETable *etable; + + g_return_if_fail (cal_table != NULL); + g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table)); + + etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable)); + e_table_selected_row_foreach (etable, mark_row_complete_cb, cal_table); +} + /* Used from e_table_selected_row_foreach(); puts the selected row number in an * int pointed to by the closure data. */ diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h index c39a79b545..fab3afd85d 100644 --- a/calendar/gui/e-calendar-table.h +++ b/calendar/gui/e-calendar-table.h @@ -79,6 +79,7 @@ CalendarModel *e_calendar_table_get_model (ECalendarTable *cal_table); ETable *e_calendar_table_get_table (ECalendarTable *cal_table); +void e_calendar_table_complete_selected (ECalendarTable *cal_table); void e_calendar_table_delete_selected (ECalendarTable *cal_table); /* Clipboard related functions */ diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 54e8ea3c45..3edb4da7c8 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -497,6 +497,27 @@ e_tasks_new_task (ETasks *tasks) } /** + * 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); + e_calendar_table_complete_selected (cal_table); +} + +/** * e_tasks_delete_selected: * @tasks: A tasks control widget. * diff --git a/calendar/gui/e-tasks.h b/calendar/gui/e-tasks.h index f199a6f251..102369b682 100644 --- a/calendar/gui/e-tasks.h +++ b/calendar/gui/e-tasks.h @@ -65,9 +65,10 @@ gboolean e_tasks_open (ETasks *tasks, CalClient *e_tasks_get_cal_client (ETasks *tasks); -void e_tasks_new_task (ETasks *tasks); -void e_tasks_delete_selected (ETasks *tasks); -void e_tasks_delete_completed(ETasks *tasks); +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_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic); diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c index 4631b35467..0edc2723e7 100644 --- a/calendar/gui/tasks-control.c +++ b/calendar/gui/tasks-control.c @@ -79,6 +79,9 @@ static void tasks_control_paste_cmd (BonoboUIComponent *uic, 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_expunge_cmd (BonoboUIComponent *uic, gpointer data, const char *path); @@ -227,6 +230,9 @@ sensitize_commands (ETasks *tasks, BonoboControl *control, int n_selected) bonobo_ui_component_set_prop (uic, "/commands/TasksDelete", "sensitive", n_selected == 0 ? "0" : "1", NULL); + bonobo_ui_component_set_prop (uic, "/commands/TasksMarkComplete", "sensitive", + n_selected == 0 ? "0" : "1", + NULL); } /* Callback used when the selection in the table changes */ @@ -246,6 +252,7 @@ static BonoboUIVerb verbs [] = { 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 ("TasksExpunge", tasks_control_expunge_cmd), BONOBO_UI_VERB ("TasksSettings", tasks_control_settings_cmd), @@ -396,6 +403,17 @@ tasks_control_delete_cmd (BonoboUIComponent *uic, e_tasks_delete_selected (tasks); } +static void +tasks_control_complete_cmd (BonoboUIComponent *uic, + gpointer data, + const char *path) +{ + ETasks *tasks; + + tasks = E_TASKS (data); + e_tasks_complete_selected (tasks); +} + static gboolean confirm_expunge (ETasks *tasks) { |