2006-08-02 [colin] 2.4.0cvs18

* src/messageview.c
		Add Hide quotes menu
This commit is contained in:
Colin Leroy 2006-08-02 17:04:06 +00:00
parent 2c42dd3fec
commit 28da7dd0eb
4 changed files with 62 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2006-08-02 [colin] 2.4.0cvs18
* src/messageview.c
Add Hide quotes menu
2006-08-02 [colin] 2.4.0cvs17
* src/mainwindow.c

View file

@ -1709,3 +1709,4 @@
( cvs diff -u -r 1.25.2.16 -r 1.25.2.17 src/matcher_parser_parse.y; ) > 2.4.0cvs15.patchset
( cvs diff -u -r 1.274.2.130 -r 1.274.2.131 src/mainwindow.c; ) > 2.4.0cvs16.patchset
( cvs diff -u -r 1.274.2.131 -r 1.274.2.132 src/mainwindow.c; cvs diff -u -r 1.204.2.94 -r 1.204.2.95 src/prefs_common.c; cvs diff -u -r 1.96.2.129 -r 1.96.2.130 src/textview.c; cvs diff -u -r 1.12.2.11 -r 1.12.2.12 src/textview.h; cvs diff -u -r 1.4.2.34 -r 1.4.2.35 src/gtk/about.c; ) > 2.4.0cvs17.patchset
( cvs diff -u -r 1.94.2.91 -r 1.94.2.92 src/messageview.c; ) > 2.4.0cvs18.patchset

View file

@ -11,7 +11,7 @@ MINOR_VERSION=4
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=17
EXTRA_VERSION=18
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -120,6 +120,9 @@ static void view_source_cb (gpointer data,
static void show_all_header_cb (gpointer data,
guint action,
GtkWidget *widget);
static void hide_quotes_cb (gpointer data,
guint action,
GtkWidget *widget);
static void compose_cb (gpointer data,
guint action,
@ -274,6 +277,10 @@ static GtkItemFactoryEntry msgview_entries[] =
{N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_View/Mess_age source"), "<control>U", view_source_cb, 0, NULL},
{N_("/_View/Show all _headers"),"<control>H", show_all_header_cb, 0, "<ToggleItem>"},
{N_("/_View/Quotes"), NULL, NULL, 0, "<Branch>"},
{N_("/_View/Quotes/_Hide all"), "<control><shift>Q", hide_quotes_cb, 1, "<ToggleItem>"},
{N_("/_View/Quotes/Hide from level _2"),NULL, hide_quotes_cb, 2, "<ToggleItem>"},
{N_("/_View/Quotes/Hide from level _3"),NULL, hide_quotes_cb, 3, "<ToggleItem>"},
{N_("/_Message"), NULL, NULL, 0, "<Branch>"},
{N_("/_Message/Compose _new message"),
@ -1512,6 +1519,40 @@ static void show_all_header_cb(gpointer data, guint action, GtkWidget *widget)
main_window_set_menu_sensitive(messageview->mainwin);
}
#define SET_CHECK_MENU_ACTIVE(path, active) \
{ \
menuitem = gtk_item_factory_get_widget(ifactory, path); \
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), active); \
}
static void hide_quotes_cb(gpointer data, guint action, GtkWidget *widget)
{
MessageView *messageview = (MessageView *)data;
MsgInfo *msginfo = messageview->msginfo;
static gboolean updating_menu = FALSE;
GtkItemFactory *ifactory = gtk_item_factory_from_widget(messageview->menubar);
GtkWidget *menuitem;
if (updating_menu)
return;
prefs_common.hide_quotes =
GTK_CHECK_MENU_ITEM(widget)->active ? action : 0;
updating_menu=TRUE;
SET_CHECK_MENU_ACTIVE("/View/Quotes/Hide all", FALSE);
SET_CHECK_MENU_ACTIVE("/View/Quotes/Hide from level 2", FALSE);
SET_CHECK_MENU_ACTIVE("/View/Quotes/Hide from level 3", FALSE);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), prefs_common.hide_quotes > 0);
updating_menu=FALSE;
if (!msginfo) return;
messageview->msginfo = NULL;
messageview_show(messageview, msginfo,
messageview->all_headers);
procmsg_msginfo_free(msginfo);
main_window_set_menu_sensitive(messageview->mainwin);
}
#undef SET_CHECK_MENU_ACTIVE
static void compose_cb(gpointer data, guint action, GtkWidget *widget)
{
MessageView *messageview = (MessageView *)data;
@ -1626,6 +1667,20 @@ void messageview_set_menu_sensitive(MessageView *messageview)
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem),
messageview->mimeview->textview->show_all_headers);
if (prefs_common.hide_quotes) {
if (prefs_common.hide_quotes == 1)
menuitem = gtk_item_factory_get_widget(ifactory,
"/View/Quotes/Hide all");
if (prefs_common.hide_quotes == 2)
menuitem = gtk_item_factory_get_widget(ifactory,
"/View/Quotes/Hide from level 2");
if (prefs_common.hide_quotes == 3)
menuitem = gtk_item_factory_get_widget(ifactory,
"/View/Quotes/Hide from level 3");
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem),
TRUE);
}
}
}