[Commits] [SCM] claws branch, master, updated. 3.16.0-139-g6b9aa3d
wwp at claws-mail.org
wwp at claws-mail.org
Wed Apr 25 15:49:51 CEST 2018
The branch, master has been updated
via 6b9aa3dd1772f5aa5df322c8034c9f1e9ded81ab (commit)
from c09f3d7dba4e5d556152cc941dc3c8071068b933 (commit)
Summary of changes:
src/mainwindow.c | 12 ++++++++++++
src/mimeview.c | 9 ++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
- Log -----------------------------------------------------------------
commit 6b9aa3dd1772f5aa5df322c8034c9f1e9ded81ab
Author: wwp <wwp at free.fr>
Date: Wed Apr 25 15:48:12 2018 +0200
Fix sensitivity of the main window's 'View/Message part/View as text' entry
according to the selected mime part.
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 20bc40f..42de186 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -3362,6 +3362,18 @@ do { \
cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/Message/CheckSignature",
mimepart_selected && mainwin->messageview->mimeview->signed_part);
+ sensitive = TRUE;
+ if (mimepart_selected) {
+ MimeInfo *partinfo = messageview_get_selected_mime_part(mainwin->messageview);
+
+ if (partinfo && (partinfo->type == MIMETYPE_MESSAGE ||
+ partinfo->type == MIMETYPE_IMAGE ||
+ partinfo->type == MIMETYPE_MULTIPART)) {
+ sensitive = FALSE;
+ }
+ }
+ cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Part/AsText", sensitive);
+
main_window_menu_callback_unblock(mainwin);
}
diff --git a/src/mimeview.c b/src/mimeview.c
index a00c72f..9dd0f49 100644
--- a/src/mimeview.c
+++ b/src/mimeview.c
@@ -1397,6 +1397,7 @@ static void mimeview_selected(GtkTreeSelection *selection, MimeView *mimeview)
GtkTreeIter iter;
GtkTreePath *path;
MimeInfo *partinfo;
+ MainWindow *mainwin;
selection = gtk_tree_view_get_selection(ctree);
if (!gtk_tree_selection_get_selected(selection, &model, &iter))
@@ -1444,6 +1445,9 @@ static void mimeview_selected(GtkTreeSelection *selection, MimeView *mimeview)
break;
}
}
+ mainwin = mainwindow_get_mainwindow();
+ if (mainwin)
+ main_window_set_menu_sensitive(mainwin);
if (mimeview->siginfo && privacy_auto_check_signatures(mimeview->siginfo)
&& privacy_mimeinfo_get_sig_status(mimeview->siginfo) == SIGNATURE_UNCHECKED) {
@@ -1499,6 +1503,8 @@ static gboolean part_button_pressed(MimeView *mimeview, GdkEventButton *event,
mimeview_launch(mimeview, partinfo);
return TRUE;
} else if (event->button == 3) {
+ MainWindow *mainwin = mainwindow_get_mainwindow();
+
if (partinfo && (partinfo->type == MIMETYPE_MESSAGE ||
partinfo->type == MIMETYPE_IMAGE ||
partinfo->type == MIMETYPE_MULTIPART))
@@ -1513,7 +1519,8 @@ static gboolean part_button_pressed(MimeView *mimeview, GdkEventButton *event,
else
#endif
cm_menu_set_sensitive_full(mimeview->ui_manager, "Menus/MimeView/Open", TRUE);
-
+ if (mainwin)
+ main_window_set_menu_sensitive(mainwin);
g_object_set_data(G_OBJECT(mimeview->popupmenu),
"pop_partinfo", partinfo);
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list