From a0a1cc96a89bdd57519485be7a7b09b4c5333498 Mon Sep 17 00:00:00 2001 From: hiro Date: Mon, 6 Feb 2006 02:48:47 +0000 Subject: update menu of separated message view when show_all_headers state changed. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@976 ee746299-78ed-0310-b773-934348b2243d --- src/messageview.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/messageview.c') diff --git a/src/messageview.c b/src/messageview.c index 4a7ef5be..109801a5 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -67,6 +67,8 @@ static GList *messageview_list = NULL; static void messageview_change_view_type(MessageView *messageview, MessageType type); +static void messageview_set_menu_state (MessageView *messageview); + static gint messageview_delete_cb (GtkWidget *widget, GdkEventAny *event, MessageView *messageview); @@ -423,6 +425,8 @@ MessageView *messageview_create_with_new_window(void) msgview->window = window; msgview->window_vbox = window_vbox; msgview->body_vbox = body_vbox; + msgview->menubar = menubar; + msgview->menu_locked = FALSE; msgview->visible = TRUE; messageview_init(msgview); @@ -503,6 +507,9 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo, procmime_mimeinfo_free_all(mimeinfo); } + if (messageview->new_window) + messageview_set_menu_state(messageview); + g_free(file); return 0; @@ -532,6 +539,20 @@ static void messageview_change_view_type(MessageView *messageview, messageview->type = type; } +static void messageview_set_menu_state(MessageView *messageview) +{ + GtkItemFactory *ifactory; + GtkWidget *menuitem; + + messageview->menu_locked = TRUE; + ifactory = gtk_item_factory_from_widget(messageview->menubar); + menuitem = gtk_item_factory_get_widget + (ifactory, "/View/Show all header"); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), + messageview->textview->show_all_headers); + messageview->menu_locked = FALSE; +} + void messageview_clear(MessageView *messageview) { procmsg_msginfo_free(messageview->msginfo); @@ -809,6 +830,8 @@ static void show_all_header_cb(gpointer data, guint action, GtkWidget *widget) MsgInfo *msginfo = messageview->msginfo; if (!msginfo) return; + if (messageview->menu_locked) return; + messageview->msginfo = NULL; messageview_show(messageview, msginfo, GTK_CHECK_MENU_ITEM(widget)->active); -- cgit v1.2.3