diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-05-20 05:15:49 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-05-20 05:15:49 +0000 |
commit | 324d7ec0253e654699ad1cee2f519c4b54884ccb (patch) | |
tree | 13aa94ddbbeec2613bbb8a443e7b645ef7ee9c73 /src | |
parent | 1c36fc23787fd60a798a7c584db399b7cb913bb8 (diff) |
modify sensitivity of attach context menu.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2540 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/compose.c | 16 |
1 files changed, 15 insertions, 1 deletions
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); |