From 611fda70547f7a5258a1eaf52691cb05f8b3ec63 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 9 Jan 2010 16:17:23 -0500 Subject: Cleanup delete actions in shell views. --- modules/addressbook/e-book-shell-view-actions.c | 11 +- modules/addressbook/e-book-shell-view-private.h | 1 + modules/calendar/e-cal-shell-content.c | 133 +----------------------- modules/calendar/e-cal-shell-content.h | 4 - modules/calendar/e-cal-shell-view-actions.c | 44 ++++---- modules/calendar/e-cal-shell-view-actions.h | 4 - modules/calendar/e-cal-shell-view-memopad.c | 31 ------ modules/calendar/e-cal-shell-view-private.h | 3 +- modules/calendar/e-cal-shell-view-taskpad.c | 31 ------ modules/calendar/e-memo-shell-view-actions.c | 22 +--- modules/calendar/e-memo-shell-view-private.h | 3 +- modules/calendar/e-task-shell-view-actions.c | 22 +--- modules/calendar/e-task-shell-view-private.h | 3 +- 13 files changed, 41 insertions(+), 271 deletions(-) (limited to 'modules') diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 61434d4e52..e791f8e08d 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -337,7 +337,7 @@ action_contact_delete_cb (GtkAction *action, view = e_book_shell_content_get_current_view (book_shell_content); g_return_if_fail (view != NULL); - e_addressbook_view_delete_selection (view, TRUE); + e_selectable_delete_selection (E_SELECTABLE (view)); } static void @@ -661,7 +661,7 @@ static GtkActionEntry contact_entries[] = { { "address-book-delete", GTK_STOCK_DELETE, - N_("Del_ete Address Book"), + N_("D_elete Address Book"), NULL, N_("Delete the selected address book"), G_CALLBACK (action_address_book_delete_cb) }, @@ -803,10 +803,6 @@ static EPopupActionEntry contact_popup_entries[] = { NULL, "contact-copy" }, - { "contact-popup-delete", - NULL, - "contact-delete" }, - { "contact-popup-forward", NULL, "contact-forward" }, @@ -1042,9 +1038,6 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) /* Fine tuning. */ - action = ACTION (CONTACT_DELETE); - g_object_set (action, "short-label", _("Delete"), NULL); - g_signal_connect ( ACTION (GAL_SAVE_CUSTOM_VIEW), "activate", G_CALLBACK (action_gal_save_custom_view_cb), book_shell_view); diff --git a/modules/addressbook/e-book-shell-view-private.h b/modules/addressbook/e-book-shell-view-private.h index c0fb2f09df..97fe64e5c5 100644 --- a/modules/addressbook/e-book-shell-view-private.h +++ b/modules/addressbook/e-book-shell-view-private.h @@ -41,6 +41,7 @@ #include "shell/e-shell-sidebar.h" #include "shell/e-shell-utils.h" #include "misc/e-popup-action.h" +#include "misc/e-selectable.h" #include "addressbook/util/eab-book-util.h" #include "addressbook/gui/contact-editor/e-contact-editor.h" diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index 1ab680eec4..5213480cee 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -28,6 +28,7 @@ #include "e-util/gconf-bridge.h" #include "widgets/menus/gal-view-etable.h" #include "widgets/misc/e-paned.h" +#include "widgets/misc/e-selectable.h" #include "calendar/gui/calendar-config.h" #include "calendar/gui/calendar-view.h" @@ -139,81 +140,6 @@ cal_shell_content_notify_view_id_cb (ECalShellContent *cal_shell_content) cal_shell_content->priv->paned_binding_id = binding_id; } -static FocusLocation -cal_shell_content_get_focus_location (ECalShellContent *cal_shell_content) -{ - GnomeCalendar *calendar; - GnomeCalendarViewType view_type; - ECalendarView *calendar_view; - EMemoTable *memo_table; - ETaskTable *task_table; - ETable *table; - - /* XXX This function is silly. Certainly there are better ways - * of directing user input to the focused area than polling - * a bunch of widgets to see what's focused. */ - - calendar = GNOME_CALENDAR (cal_shell_content->priv->calendar); - view_type = gnome_calendar_get_view (calendar); - calendar_view = gnome_calendar_get_calendar_view (calendar, view_type); - - memo_table = E_MEMO_TABLE (cal_shell_content->priv->memo_table); - task_table = E_TASK_TABLE (cal_shell_content->priv->task_table); - - table = E_TABLE (memo_table); - if (gtk_widget_is_focus (GTK_WIDGET (table->table_canvas))) - return FOCUS_MEMO_TABLE; - - table = E_TABLE (task_table); - if (gtk_widget_is_focus (GTK_WIDGET (table->table_canvas))) - return FOCUS_TASK_TABLE; - - if (E_IS_DAY_VIEW (calendar_view)) { - EDayView *day_view = E_DAY_VIEW (calendar_view); - - if (gtk_widget_is_focus (day_view->top_canvas)) - return FOCUS_CALENDAR; - - if (GNOME_CANVAS (day_view->top_canvas)->focused_item != NULL) - return FOCUS_CALENDAR; - - if (gtk_widget_is_focus (day_view->main_canvas)) - return FOCUS_CALENDAR; - - if (GNOME_CANVAS (day_view->main_canvas)->focused_item != NULL) - return FOCUS_CALENDAR; - - if (gtk_widget_is_focus (GTK_WIDGET (day_view))) - return FOCUS_CALENDAR; - - } else if (E_IS_WEEK_VIEW (calendar_view)) { - EWeekView *week_view = E_WEEK_VIEW (calendar_view); - - if (gtk_widget_is_focus (week_view->main_canvas)) - return FOCUS_CALENDAR; - - if (GNOME_CANVAS (week_view->main_canvas)->focused_item != NULL) - return FOCUS_CALENDAR; - - if (gtk_widget_is_focus (GTK_WIDGET (week_view))) - return FOCUS_CALENDAR; - - } else if (E_IS_CAL_LIST_VIEW (calendar_view)) { - ECalListView *list_view = E_CAL_LIST_VIEW (calendar_view); - - if (gtk_widget_is_focus (GTK_WIDGET (list_view->table))) - return FOCUS_CALENDAR; - - if (gtk_widget_is_focus (GTK_WIDGET (list_view->table->table_canvas))) - return FOCUS_CALENDAR; - - if (gtk_widget_is_focus (GTK_WIDGET (list_view))) - return FOCUS_CALENDAR; - } - - return FOCUS_OTHER; -} - static void cal_shell_content_set_property (GObject *object, guint property_id, @@ -720,60 +646,3 @@ e_cal_shell_content_get_view_instance (ECalShellContent *cal_shell_content) return cal_shell_content->priv->view_instance; } - -void -e_cal_shell_content_delete_selection (ECalShellContent *cal_shell_content) -{ - GnomeCalendar *calendar; - EMemoTable *memo_table; - ETaskTable *task_table; - GnomeCalendarViewType view_type; - ECalendarView *calendar_view; - - g_return_if_fail (E_IS_CAL_SHELL_CONTENT (cal_shell_content)); - - calendar = e_cal_shell_content_get_calendar (cal_shell_content); - memo_table = e_cal_shell_content_get_memo_table (cal_shell_content); - task_table = e_cal_shell_content_get_task_table (cal_shell_content); - - view_type = gnome_calendar_get_view (calendar); - calendar_view = gnome_calendar_get_calendar_view (calendar, view_type); - - switch (cal_shell_content_get_focus_location (cal_shell_content)) { - case FOCUS_CALENDAR: - e_calendar_view_delete_selected_events (calendar_view); - break; - - case FOCUS_MEMO_TABLE: - e_memo_table_delete_selected (memo_table); - break; - - case FOCUS_TASK_TABLE: - e_task_table_delete_selected (task_table); - break; - - default: - g_return_if_reached (); - } -} - -void -e_cal_shell_content_delete_selected_occurrence (ECalShellContent *cal_shell_content) -{ - GnomeCalendar *calendar; - GnomeCalendarViewType view_type; - ECalendarView *calendar_view; - FocusLocation focus; - - g_return_if_fail (E_IS_CAL_SHELL_CONTENT (cal_shell_content)); - - focus = cal_shell_content_get_focus_location (cal_shell_content); - if (focus != FOCUS_CALENDAR) - return; - - calendar = e_cal_shell_content_get_calendar (cal_shell_content); - view_type = gnome_calendar_get_view (calendar); - calendar_view = gnome_calendar_get_calendar_view (calendar, view_type); - - e_calendar_view_delete_selected_occurrence (calendar_view); -} diff --git a/modules/calendar/e-cal-shell-content.h b/modules/calendar/e-cal-shell-content.h index 78c2199c50..92acbaa3c9 100644 --- a/modules/calendar/e-cal-shell-content.h +++ b/modules/calendar/e-cal-shell-content.h @@ -97,10 +97,6 @@ EShellSearchbar * GalViewInstance * e_cal_shell_content_get_view_instance (ECalShellContent *cal_shell_content); -void e_cal_shell_content_delete_selection - (ECalShellContent *cal_shell_content); -void e_cal_shell_content_delete_selected_occurrence - (ECalShellContent *cal_shell_content); G_END_DECLS diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index 0e361c5e2c..ca50b56cd9 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -659,9 +659,17 @@ action_event_delete_cb (GtkAction *action, ECalShellView *cal_shell_view) { ECalShellContent *cal_shell_content; + GnomeCalendar *calendar; + GnomeCalendarViewType view_type; + ECalendarView *calendar_view; cal_shell_content = cal_shell_view->priv->cal_shell_content; - e_cal_shell_content_delete_selection (cal_shell_content); + calendar = e_cal_shell_content_get_calendar (cal_shell_content); + + view_type = gnome_calendar_get_view (calendar); + calendar_view = gnome_calendar_get_calendar_view (calendar, view_type); + + e_selectable_delete_selection (E_SELECTABLE (calendar_view)); } static void @@ -669,20 +677,17 @@ action_event_delete_occurrence_cb (GtkAction *action, ECalShellView *cal_shell_view) { ECalShellContent *cal_shell_content; + GnomeCalendar *calendar; + GnomeCalendarViewType view_type; + ECalendarView *calendar_view; cal_shell_content = cal_shell_view->priv->cal_shell_content; - e_cal_shell_content_delete_selected_occurrence (cal_shell_content); -} + calendar = e_cal_shell_content_get_calendar (cal_shell_content); -static void -action_event_delete_occurrence_all_cb (GtkAction *action, - ECalShellView *cal_shell_view) -{ - ECalShellContent *cal_shell_content; + view_type = gnome_calendar_get_view (calendar); + calendar_view = gnome_calendar_get_calendar_view (calendar, view_type); - /* XXX Same as "event-delete". */ - cal_shell_content = cal_shell_view->priv->cal_shell_content; - e_cal_shell_content_delete_selection (cal_shell_content); + e_calendar_view_delete_selected_occurrence (calendar_view); } static void @@ -1236,9 +1241,9 @@ static GtkActionEntry calendar_entries[] = { { "calendar-delete", GTK_STOCK_DELETE, + N_("D_elete Calendar"), NULL, - NULL, - NULL, /* XXX Add a tooltip! */ + N_("Delete the selected calendar"), G_CALLBACK (action_calendar_delete_cb) }, { "calendar-go-back", @@ -1327,9 +1332,9 @@ static GtkActionEntry calendar_entries[] = { { "event-delete", GTK_STOCK_DELETE, - NULL, + N_("_Delete Appointment"), "d", - N_("Delete the appointment"), + N_("Delete selected appointments"), G_CALLBACK (action_event_delete_cb) }, { "event-delete-occurrence", @@ -1341,10 +1346,10 @@ static GtkActionEntry calendar_entries[] = { { "event-delete-occurrence-all", GTK_STOCK_DELETE, - N_("Delete _All Occurrences"), + N_("Delete All Occ_urrences"), NULL, N_("Delete all occurrences"), - G_CALLBACK (action_event_delete_occurrence_all_cb) }, + G_CALLBACK (action_event_delete_cb) }, { "event-all-day-new", "stock_new-24h-appointment", @@ -1451,7 +1456,7 @@ static EPopupActionEntry calendar_popup_entries[] = { "calendar-copy" }, { "calendar-popup-delete", - NULL, + N_("_Delete"), "calendar-delete" }, { "calendar-popup-go-today", @@ -1750,9 +1755,6 @@ e_cal_shell_view_actions_init (ECalShellView *cal_shell_view) action = ACTION (CALENDAR_VIEW_WORKWEEK); g_object_set (action, "is-important", TRUE, NULL); - action = ACTION (EVENT_DELETE); - g_object_set (action, "short-label", _("Delete"), NULL); - g_signal_connect ( ACTION (GAL_SAVE_CUSTOM_VIEW), "activate", G_CALLBACK (action_gal_save_custom_view_cb), cal_shell_view); diff --git a/modules/calendar/e-cal-shell-view-actions.h b/modules/calendar/e-cal-shell-view-actions.h index a1cb31398b..a69b82f645 100644 --- a/modules/calendar/e-cal-shell-view-actions.h +++ b/modules/calendar/e-cal-shell-view-actions.h @@ -91,8 +91,6 @@ E_SHELL_WINDOW_ACTION ((window), "event-occurrence-movable") /* Memo Pad Actions */ -#define E_SHELL_WINDOW_ACTION_CALENDAR_MEMOPAD_DELETE(window) \ - E_SHELL_WINDOW_ACTION ((window), "calendar-memopad-delete") #define E_SHELL_WINDOW_ACTION_CALENDAR_MEMOPAD_FORWARD(window) \ E_SHELL_WINDOW_ACTION ((window), "calendar-memopad-forward") #define E_SHELL_WINDOW_ACTION_CALENDAR_MEMOPAD_NEW(window) \ @@ -109,8 +107,6 @@ /* Task Pad Actions */ #define E_SHELL_WINDOW_ACTION_CALENDAR_TASKPAD_ASSIGN(window) \ E_SHELL_WINDOW_ACTION ((window), "calendar-taskpad-assign") -#define E_SHELL_WINDOW_ACTION_CALENDAR_TASKPAD_DELETE(window) \ - E_SHELL_WINDOW_ACTION ((window), "calendar-taskpad-delete") #define E_SHELL_WINDOW_ACTION_CALENDAR_TASKPAD_FORWARD(window) \ E_SHELL_WINDOW_ACTION ((window), "calendar-taskpad-forward") #define E_SHELL_WINDOW_ACTION_CALENDAR_TASKPAD_MARK_COMPLETE(window) \ diff --git a/modules/calendar/e-cal-shell-view-memopad.c b/modules/calendar/e-cal-shell-view-memopad.c index e34dac9adb..61ef73d1a4 100644 --- a/modules/calendar/e-cal-shell-view-memopad.c +++ b/modules/calendar/e-cal-shell-view-memopad.c @@ -23,23 +23,6 @@ /* Much of this file is based on e-memo-shell-view-actions.c. */ -static void -action_calendar_memopad_delete_cb (GtkAction *action, - ECalShellView *cal_shell_view) -{ - ECalShellContent *cal_shell_content; - EMemoTable *memo_table; - - cal_shell_content = cal_shell_view->priv->cal_shell_content; - memo_table = e_cal_shell_content_get_memo_table (cal_shell_content); - - e_cal_shell_view_memopad_set_status_message ( - cal_shell_view, _("Deleting selected memos..."), -1.0); - e_memo_table_delete_selected (memo_table); - e_cal_shell_view_memopad_set_status_message ( - cal_shell_view, NULL, -1.0); -} - static void action_calendar_memopad_forward_cb (GtkAction *action, ECalShellView *cal_shell_view) @@ -255,13 +238,6 @@ action_calendar_memopad_save_as_cb (GtkAction *action, static GtkActionEntry calendar_memopad_entries[] = { - { "calendar-memopad-delete", - GTK_STOCK_DELETE, - N_("_Delete Memo"), - NULL, - N_("Delete selected memos"), - G_CALLBACK (action_calendar_memopad_delete_cb) }, - { "calendar-memopad-forward", "mail-forward", N_("_Forward as iCalendar..."), @@ -340,7 +316,6 @@ e_cal_shell_view_memopad_actions_update (ECalShellView *cal_shell_view) EMemoTable *memo_table; GtkAction *action; GSList *list, *iter; - const gchar *label; gboolean editable = TRUE; gboolean has_url = FALSE; gboolean sensitive; @@ -369,12 +344,6 @@ e_cal_shell_view_memopad_actions_update (ECalShellView *cal_shell_view) } g_slist_free (list); - action = ACTION (CALENDAR_MEMOPAD_DELETE); - sensitive = (n_selected > 0) && editable; - gtk_action_set_sensitive (action, sensitive); - label = ngettext ("Delete Memo", "Delete Memos", n_selected); - g_object_set (action, "label", label, NULL); - action = ACTION (CALENDAR_MEMOPAD_FORWARD); sensitive = (n_selected == 1); gtk_action_set_sensitive (action, sensitive); diff --git a/modules/calendar/e-cal-shell-view-private.h b/modules/calendar/e-cal-shell-view-private.h index 1f9dc17f87..c69ffc7605 100644 --- a/modules/calendar/e-cal-shell-view-private.h +++ b/modules/calendar/e-cal-shell-view-private.h @@ -37,7 +37,8 @@ #include "e-util/e-file-utils.h" #include "e-util/e-util.h" #include "shell/e-shell-utils.h" -#include "widgets/misc/e-popup-action.h" +#include "misc/e-popup-action.h" +#include "misc/e-selectable.h" #include "calendar/common/authentication.h" #include "calendar/gui/calendar-config.h" diff --git a/modules/calendar/e-cal-shell-view-taskpad.c b/modules/calendar/e-cal-shell-view-taskpad.c index 67a355a9bd..c7269bcfd1 100644 --- a/modules/calendar/e-cal-shell-view-taskpad.c +++ b/modules/calendar/e-cal-shell-view-taskpad.c @@ -46,23 +46,6 @@ action_calendar_taskpad_assign_cb (GtkAction *action, /* FIXME Need to actually assign the task. */ } -static void -action_calendar_taskpad_delete_cb (GtkAction *action, - ECalShellView *cal_shell_view) -{ - ECalShellContent *cal_shell_content; - ETaskTable *task_table; - - cal_shell_content = cal_shell_view->priv->cal_shell_content; - task_table = e_cal_shell_content_get_task_table (cal_shell_content); - - e_cal_shell_view_taskpad_set_status_message ( - cal_shell_view, _("Deleting selected tasks..."), -1.0); - e_task_table_delete_selected (task_table); - e_cal_shell_view_taskpad_set_status_message ( - cal_shell_view, NULL, -1.0); -} - static void action_calendar_taskpad_forward_cb (GtkAction *action, ECalShellView *cal_shell_view) @@ -329,13 +312,6 @@ static GtkActionEntry calendar_taskpad_entries[] = { NULL, /* XXX Add a tooltip! */ G_CALLBACK (action_calendar_taskpad_assign_cb) }, - { "calendar-taskpad-delete", - GTK_STOCK_DELETE, - N_("_Delete Task"), - NULL, - N_("Delete selected tasks"), - G_CALLBACK (action_calendar_taskpad_delete_cb) }, - { "calendar-taskpad-forward", "mail-forward", N_("_Forward as iCalendar..."), @@ -428,7 +404,6 @@ e_cal_shell_view_taskpad_actions_update (ECalShellView *cal_shell_view) ETaskTable *task_table; GtkAction *action; GSList *list, *iter; - const gchar *label; gboolean assignable = TRUE; gboolean editable = TRUE; gboolean has_url = FALSE; @@ -480,12 +455,6 @@ e_cal_shell_view_taskpad_actions_update (ECalShellView *cal_shell_view) sensitive = (n_selected == 1) && editable && assignable; gtk_action_set_sensitive (action, sensitive); - action = ACTION (CALENDAR_TASKPAD_DELETE); - sensitive = (n_selected > 0) && editable; - gtk_action_set_sensitive (action, sensitive); - label = ngettext ("Delete Task", "Delete Tasks", n_selected); - g_object_set (action, "label", label, NULL); - action = ACTION (CALENDAR_TASKPAD_FORWARD); sensitive = (n_selected == 1); gtk_action_set_sensitive (action, sensitive); diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index 7891a5add2..1c0a7ef9ef 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -47,19 +47,12 @@ action_memo_delete_cb (GtkAction *action, EMemoShellView *memo_shell_view) { EMemoShellContent *memo_shell_content; - ECalComponentPreview *memo_preview; EMemoTable *memo_table; memo_shell_content = memo_shell_view->priv->memo_shell_content; memo_table = e_memo_shell_content_get_memo_table (memo_shell_content); - memo_preview = e_memo_shell_content_get_memo_preview (memo_shell_content); - - e_memo_shell_view_set_status_message ( - memo_shell_view, _("Deleting selected memos..."), -1.0); - e_memo_table_delete_selected (memo_table); - e_memo_shell_view_set_status_message (memo_shell_view, NULL, -1.0); - e_cal_component_preview_clear (memo_preview); + e_selectable_delete_selection (E_SELECTABLE (memo_table)); } static void @@ -587,9 +580,9 @@ static GtkActionEntry memo_entries[] = { { "memo-list-delete", GTK_STOCK_DELETE, - N_("_Delete"), + N_("D_elete Memo List"), NULL, - NULL, /* XXX Add a tooltip! */ + N_("Delete the selected memo list"), G_CALLBACK (action_memo_list_delete_cb) }, { "memo-list-new", @@ -665,7 +658,7 @@ static EPopupActionEntry memo_popup_entries[] = { "memo-list-copy" }, { "memo-list-popup-delete", - NULL, + N_("_Delete"), "memo-list-delete" }, { "memo-list-popup-properties", @@ -684,10 +677,6 @@ static EPopupActionEntry memo_popup_entries[] = { NULL, "memo-list-select-one" }, - { "memo-popup-delete", - NULL, - "memo-delete" }, - { "memo-popup-forward", NULL, "memo-forward" }, @@ -919,9 +908,6 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) /* Fine tuning. */ - action = ACTION (MEMO_DELETE); - g_object_set (action, "short-label", _("Delete"), NULL); - g_signal_connect ( ACTION (GAL_SAVE_CUSTOM_VIEW), "activate", G_CALLBACK (action_gal_save_custom_view_cb), memo_shell_view); diff --git a/modules/calendar/e-memo-shell-view-private.h b/modules/calendar/e-memo-shell-view-private.h index ac50d209a4..06db399036 100644 --- a/modules/calendar/e-memo-shell-view-private.h +++ b/modules/calendar/e-memo-shell-view-private.h @@ -35,7 +35,8 @@ #include "e-util/e-util.h" #include "e-util/gconf-bridge.h" #include "shell/e-shell-utils.h" -#include "widgets/misc/e-popup-action.h" +#include "misc/e-popup-action.h" +#include "misc/e-selectable.h" #include "calendar/gui/comp-util.h" #include "calendar/gui/e-cal-component-preview.h" diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index 2b25f3373e..bd3d0627ff 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -78,19 +78,12 @@ action_task_delete_cb (GtkAction *action, ETaskShellView *task_shell_view) { ETaskShellContent *task_shell_content; - ECalComponentPreview *task_preview; ETaskTable *task_table; task_shell_content = task_shell_view->priv->task_shell_content; task_table = e_task_shell_content_get_task_table (task_shell_content); - task_preview = e_task_shell_content_get_task_preview (task_shell_content); - - e_task_shell_view_set_status_message ( - task_shell_view, _("Deleting selected tasks..."), -1.0); - e_task_table_delete_selected (task_table); - e_task_shell_view_set_status_message (task_shell_view, NULL, -1.0); - e_cal_component_preview_clear (task_preview); + e_selectable_delete_selection (E_SELECTABLE (task_table)); } static void @@ -711,9 +704,9 @@ static GtkActionEntry task_entries[] = { { "task-list-delete", GTK_STOCK_DELETE, - N_("_Delete"), + N_("D_elete Task List"), NULL, - NULL, /* XXX Add a tooltip! */ + N_("Delete the selected task list"), G_CALLBACK (action_task_list_delete_cb) }, { "task-list-new", @@ -817,7 +810,7 @@ static EPopupActionEntry task_popup_entries[] = { "task-list-copy" }, { "task-list-popup-delete", - NULL, + N_("_Delete"), "task-list-delete" }, { "task-list-popup-properties", @@ -840,10 +833,6 @@ static EPopupActionEntry task_popup_entries[] = { NULL, "task-assign" }, - { "task-popup-delete", - NULL, - "task-delete" }, - { "task-popup-forward", NULL, "task-forward" }, @@ -1118,9 +1107,6 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) /* Fine tuning. */ - action = ACTION (TASK_DELETE); - g_object_set (action, "short-label", _("Delete"), NULL); - g_signal_connect ( ACTION (GAL_SAVE_CUSTOM_VIEW), "activate", G_CALLBACK (action_gal_save_custom_view_cb), task_shell_view); diff --git a/modules/calendar/e-task-shell-view-private.h b/modules/calendar/e-task-shell-view-private.h index a76403f721..5b0231e108 100644 --- a/modules/calendar/e-task-shell-view-private.h +++ b/modules/calendar/e-task-shell-view-private.h @@ -36,7 +36,8 @@ #include "e-util/e-util.h" #include "e-util/gconf-bridge.h" #include "shell/e-shell-utils.h" -#include "widgets/misc/e-popup-action.h" +#include "misc/e-popup-action.h" +#include "misc/e-selectable.h" #include "calendar/common/authentication.h" #include "calendar/gui/calendar-config.h" -- cgit v1.2.3