From 324d7ec0253e654699ad1cee2f519c4b54884ccb Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 20 May 2010 05:15:49 +0000 Subject: modify sensitivity of attach context menu. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2540 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 1 + src/compose.c | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 469a97c8..ebaa7e96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2010-05-20 * src/compose.c: added "Open" menu in the attach context menu. + attach_button_pressed(): modify sensitivity of attach context menu. 2010-05-11 diff --git a/src/compose.c b/src/compose.c index c7e61c34..813b5649 100644 --- a/src/compose.c +++ b/src/compose.c @@ -7097,10 +7097,24 @@ static gboolean attach_button_pressed(GtkWidget *widget, GdkEventButton *event, (event->button == 1 && event->type == GDK_2BUTTON_PRESS)) { compose_attach_property(compose); } else if (event->button == 3) { + GList *rows; + gboolean has_selection = FALSE; + + selection = gtk_tree_view_get_selection(treeview); + rows = gtk_tree_selection_get_selected_rows(selection, NULL); + if (rows) { + has_selection = TRUE; + g_list_free(rows); + } + if (path) + has_selection = TRUE; + menu_set_sensitive(compose->popupfactory, "/Open", has_selection); + menu_set_sensitive(compose->popupfactory, "/Add...", TRUE); + menu_set_sensitive(compose->popupfactory, "/Remove", has_selection); + menu_set_sensitive(compose->popupfactory, "/Properties...", has_selection); gtk_menu_popup(GTK_MENU(compose->popupmenu), NULL, NULL, NULL, NULL, event->button, event->time); - selection = gtk_tree_view_get_selection(treeview); if (path && gtk_tree_selection_path_is_selected(selection, path)) { gtk_tree_path_free(path); -- cgit v1.2.3