diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/summaryview.c | 26 | ||||
-rw-r--r-- | src/summaryview.h | 3 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/summaryview.c b/src/summaryview.c index 0cdf82c1..e1dc5b59 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -435,6 +435,9 @@ static GtkItemFactoryEntry summary_popup_entries[] = {N_("/---"), NULL, NULL, 0, "<Separator>"}, {N_("/_Delete"), NULL, summary_delete, 0, NULL}, {N_("/---"), NULL, NULL, 0, "<Separator>"}, + {N_("/Set as _junk mail"), NULL, summary_junk, 0, NULL}, + {N_("/Set as not j_unk mail"), NULL, summary_not_junk, 0, NULL}, + {N_("/---"), NULL, NULL, 0, "<Separator>"}, {N_("/Re-_edit"), NULL, summary_reedit, 0, NULL}, {N_("/---"), NULL, NULL, 0, "<Separator>"}, {N_("/Add sender to address boo_k..."), @@ -647,6 +650,15 @@ SummaryView *summary_create(void) summaryview->reedit_menuitem); summaryview->reedit_separator = GTK_WIDGET(child->next->data); + summaryview->junk_menuitem = + gtk_item_factory_get_widget(popupfactory, "/Set as junk mail"); + summaryview->nojunk_menuitem = + gtk_item_factory_get_widget(popupfactory, + "/Set as not junk mail"); + child = g_list_find(GTK_MENU_SHELL(popupmenu)->children, + summaryview->nojunk_menuitem); + summaryview->junk_separator = GTK_WIDGET(child->next->data); + gtk_widget_show_all(vbox); gtk_widget_hide(search_clear_btn); @@ -1179,6 +1191,20 @@ static void summary_set_menu_sensitive(SummaryView *summaryview) menu_set_sensitive(ifactory, "/Mark/Mark as read", TRUE); menu_set_sensitive(ifactory, "/Mark/Mark all read", TRUE); + if (prefs_common.enable_junk) { + gtk_widget_show(summaryview->junk_menuitem); + gtk_widget_show(summaryview->nojunk_menuitem); + gtk_widget_show(summaryview->junk_separator); + menu_set_sensitive(ifactory, "/Set as junk mail", TRUE); + menu_set_sensitive(ifactory, "/Set as not junk mail", TRUE); + } else { + gtk_widget_hide(summaryview->junk_menuitem); + gtk_widget_hide(summaryview->nojunk_menuitem); + gtk_widget_hide(summaryview->junk_separator); + menu_set_sensitive(ifactory, "/Set as junk mail", FALSE); + menu_set_sensitive(ifactory, "/Set as not junk mail", FALSE); + } + menu_set_sensitive(ifactory, "/Color label", TRUE); menu_set_sensitive(ifactory, "/Reply", sens); diff --git a/src/summaryview.h b/src/summaryview.h index 06e1f75d..aaeaa57e 100644 --- a/src/summaryview.h +++ b/src/summaryview.h @@ -88,6 +88,9 @@ struct _SummaryView GtkWidget *reedit_menuitem; GtkWidget *reedit_separator; + GtkWidget *junk_menuitem; + GtkWidget *nojunk_menuitem; + GtkWidget *junk_separator; GtkWidget *window; |