[Commits] [SCM] claws branch, master, updated. 3.17.0-75-gdca3763
Colin
colin at claws-mail.org
Wed Oct 3 09:16:00 CEST 2018
The branch, master has been updated
via dca37632f4c6775be95392cd802c58e3ea39c175 (commit)
from e0db6026a22b084f296c004f48ab86d3ab5a3e8e (commit)
Summary of changes:
src/mainwindow.c | 4 +++-
src/summaryview.c | 17 +++++++++++++++--
src/summaryview.h | 1 +
src/toolbar.c | 7 ++++++-
4 files changed, 25 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit dca37632f4c6775be95392cd802c58e3ea39c175
Author: Colin Leroy <colin at colino.net>
Date: Wed Oct 3 09:15:30 2018 +0200
Fix Reply from mainwindow menu and toolbar when mainwindow's
messageview is hidden.
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 930c71e..30376f0 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -4121,7 +4121,9 @@ static void main_window_reply_cb(GtkAction *gaction, gpointer data)
msginfo_list = summary_get_selection(mainwin->summaryview);
cm_return_if_fail(msginfo_list != NULL);
- if (summary_is_opened_message_selected(mainwin->summaryview)) {
+ if (!summary_has_opened_message(mainwin->summaryview)) {
+ compose_reply_from_messageview(NULL, msginfo_list, action);
+ } else if (summary_is_opened_message_selected(mainwin->summaryview)) {
compose_reply_from_messageview(msgview, msginfo_list, action);
} else {
compose_reply_from_messageview(msgview, NULL, action);
diff --git a/src/summaryview.c b/src/summaryview.c
index 522a126..8fe0484 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -8433,12 +8433,14 @@ static void summary_reply_cb(GtkAction *gaction, gpointer data)
gboolean summary_is_opened_message_selected(SummaryView *summaryview)
{
GList *sel = NULL;
-
+
cm_return_val_if_fail(summaryview != NULL, FALSE);
sel = GTK_CMCLIST(summaryview->ctree)->selection;
- cm_return_val_if_fail(sel != NULL, FALSE);
+ if (summaryview->displayed == NULL || sel == NULL) {
+ return FALSE;
+ }
for ( ; sel != NULL; sel = sel->next) {
if (summaryview->displayed == GTK_CMCTREE_NODE(sel->data)) {
@@ -8448,3 +8450,14 @@ gboolean summary_is_opened_message_selected(SummaryView *summaryview)
return FALSE;
}
+gboolean summary_has_opened_message(SummaryView *summaryview)
+{
+ GList *sel = NULL;
+
+ cm_return_val_if_fail(summaryview != NULL, FALSE);
+
+ sel = GTK_CMCLIST(summaryview->ctree)->selection;
+
+ return (summaryview->displayed != NULL);
+}
+
diff --git a/src/summaryview.h b/src/summaryview.h
index e00f133..5824761 100644
--- a/src/summaryview.h
+++ b/src/summaryview.h
@@ -336,4 +336,5 @@ void summary_update_unread(SummaryView *summaryview, FolderItem *removed_item);
gboolean summary_is_list(SummaryView *summaryview);
gboolean summaryview_search_root_progress(gpointer data, guint at, guint matched, guint total);
gboolean summary_is_opened_message_selected(SummaryView *summaryview);
+gboolean summary_has_opened_message(SummaryView *summaryview);
#endif /* __SUMMARY_H__ */
diff --git a/src/toolbar.c b/src/toolbar.c
index 9fcb7ea..4c16c47 100644
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -2967,6 +2967,7 @@ static void toolbar_reply(gpointer data, guint action)
MessageView *msgview;
GSList *msginfo_list = NULL;
gboolean msg_is_selected = FALSE;
+ gboolean msg_is_opened = FALSE;
cm_return_if_fail(toolbar_item != NULL);
@@ -2975,12 +2976,14 @@ static void toolbar_reply(gpointer data, guint action)
mainwin = (MainWindow*)toolbar_item->parent;
msginfo_list = summary_get_selection(mainwin->summaryview);
msgview = (MessageView*)mainwin->messageview;
+ msg_is_opened = summary_has_opened_message(mainwin->summaryview);
msg_is_selected = summary_is_opened_message_selected(mainwin->summaryview);
break;
case TOOLBAR_MSGVIEW:
msgview = (MessageView*)toolbar_item->parent;
cm_return_if_fail(msgview != NULL);
msginfo_list = g_slist_append(msginfo_list, msgview->msginfo);
+ msg_is_opened = TRUE;
msg_is_selected = TRUE;
break;
default:
@@ -2989,7 +2992,9 @@ static void toolbar_reply(gpointer data, guint action)
cm_return_if_fail(msgview != NULL);
cm_return_if_fail(msginfo_list != NULL);
- if (msg_is_selected) {
+ if (!msg_is_opened) {
+ compose_reply_from_messageview(NULL, msginfo_list, action);
+ } else if (msg_is_selected) {
compose_reply_from_messageview(msgview, msginfo_list, action);
} else {
compose_reply_from_messageview(msgview, NULL, action);
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list