From 796937adcf48994f6bf9ded79bf220f02a097393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Thu, 5 May 2011 09:57:48 -0400 Subject: Bug 332497 - Add Edit -> Available Categories Opens a window to manage categories without having to edit a contact or appointment. Not available in the Mail shell view since it doesn't use categories. --- shell/e-shell-window-actions.c | 44 ++++++++++++++++++++++++++++++++++++++++++ ui/evolution-calendars.ui | 3 +++ ui/evolution-contacts.ui | 3 +++ ui/evolution-memos.ui | 3 +++ ui/evolution-tasks.ui | 3 +++ 5 files changed, 56 insertions(+) diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 928cab79c3..60792ba5b6 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -27,6 +27,7 @@ #include #include +#include #define EVOLUTION_COPYRIGHT \ "Copyright \xC2\xA9 1999 - 2008 Novell, Inc. and Others" @@ -892,6 +893,42 @@ action_page_setup_cb (GtkAction *action, e_print_run_page_setup_dialog (GTK_WINDOW (shell_window)); } +/** + * E_SHELL_WINDOW_ACTION_CATEGORIES + * @window: and #EShellWindow + * + * Activation of this action opens the Categories Editor dialog. + * + * Main menu item: Edit -> Available categories + **/ +static void +action_categories_cb (GtkAction *action, + EShellWindow *shell_window) +{ + GtkWidget *content_area; + GtkWidget *dialog; + GtkWidget *editor; + + editor = e_categories_editor_new (); + e_categories_editor_set_entry_visible ( + E_CATEGORIES_EDITOR (editor), FALSE); + + dialog = gtk_dialog_new_with_buttons ( + _("Categories Editor"), + GTK_WINDOW (shell_window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); + gtk_container_set_border_width (GTK_CONTAINER (dialog), 12); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_box_pack_start ( + GTK_BOX (content_area), GTK_WIDGET (editor), TRUE, TRUE, 6); + gtk_box_set_spacing (GTK_BOX (content_area), 12); + + gtk_dialog_run (GTK_DIALOG (dialog)); + + gtk_widget_destroy (dialog); +} + /** * E_SHELL_WINDOW_ACTION_PREFERENCES: * @window: an #EShellWindow @@ -1482,6 +1519,13 @@ static GtkActionEntry shell_entries[] = { N_("Paste the clipboard"), NULL }, /* Handled by EFocusTracker */ + { "categories", + NULL, + N_("Available Cate_gories"), + NULL, + N_("Manage available categories"), + G_CALLBACK (action_categories_cb) }, + { "preferences", GTK_STOCK_PREFERENCES, NULL, diff --git a/ui/evolution-calendars.ui b/ui/evolution-calendars.ui index 483446b5e0..496971bdba 100644 --- a/ui/evolution-calendars.ui +++ b/ui/evolution-calendars.ui @@ -18,6 +18,9 @@ + + + diff --git a/ui/evolution-contacts.ui b/ui/evolution-contacts.ui index 763e43c30d..0e0716d0ec 100644 --- a/ui/evolution-contacts.ui +++ b/ui/evolution-contacts.ui @@ -20,6 +20,9 @@ + + + diff --git a/ui/evolution-memos.ui b/ui/evolution-memos.ui index 54d173dbfb..430a30e48b 100644 --- a/ui/evolution-memos.ui +++ b/ui/evolution-memos.ui @@ -16,6 +16,9 @@ + + + diff --git a/ui/evolution-tasks.ui b/ui/evolution-tasks.ui index 62d9f023b7..49631c27ea 100644 --- a/ui/evolution-tasks.ui +++ b/ui/evolution-tasks.ui @@ -19,6 +19,9 @@ + + + -- cgit v1.2.3