diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/compose.c | 16 |
2 files changed, 16 insertions, 1 deletions
@@ -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); |