[Commits] [SCM] claws branch, master, updated. 3.17.4-36-g0a7716e39

paul at claws-mail.org paul at claws-mail.org
Tue Oct 1 16:22:17 CET 2019


The branch, master has been updated
       via  0a7716e39ce9e6d65dac86dd2310b1ec0ce18701 (commit)
      from  45d6fd932625173d36d25240067134f1f51205f9 (commit)

Summary of changes:
 src/gtk/menu.c    |  4 ++++
 src/mainwindow.c  |  4 ++++
 src/mainwindow.h  |  1 +
 src/summaryview.c | 14 ++++++++++++--
 4 files changed, 21 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 0a7716e39ce9e6d65dac86dd2310b1ec0ce18701
Author: Paul <paul at claws-mail.org>
Date:   Tue Oct 1 17:22:11 2019 +0100

    add 'Re-edit' to the message context menu in the Drafts folder

diff --git a/src/gtk/menu.c b/src/gtk/menu.c
index 050b109c4..558869d54 100644
--- a/src/gtk/menu.c
+++ b/src/gtk/menu.c
@@ -94,6 +94,10 @@ void cm_menu_set_sensitive_full(GtkUIManager *gui_manager, const gchar *menu, gb
 	}
 
 	gtk_widget_set_sensitive(widget, sensitive);
+
+	if (strcmp(menu, "Menus/SummaryViewPopup/Reedit") == 0)
+		(sensitive)? gtk_widget_show(widget) : gtk_widget_hide(widget);
+
 	g_free(path);
 }
 
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 60fa66d29..315ab7c00 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -3016,6 +3016,10 @@ SensitiveCondMask main_window_get_current_state(MainWindow *mainwin)
 	    && mainwin->summaryview->folder_item->stype != F_DRAFT)
 		UPDATE_STATE(M_NOT_DRAFT);
 
+	if (mainwin->summaryview->folder_item &&
+	    mainwin->summaryview->folder_item->stype == F_DRAFT)
+		UPDATE_STATE(M_DRAFT);
+
 	if (prefs_common.actions_list && g_slist_length(prefs_common.actions_list))
 		UPDATE_STATE(M_ACTIONS_EXIST);
 
diff --git a/src/mainwindow.h b/src/mainwindow.h
index ce0b30cac..0d1ffb14a 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -70,6 +70,7 @@ typedef enum
 	M_HAVE_RETRIEVABLE_ACCOUNT,
 	M_HAVE_ANY_RETRIEVABLE_ACCOUNT,
 	M_NOT_DRAFT,
+	M_DRAFT,
 
 /* reserved */
     M_MAX_RESERVED
diff --git a/src/summaryview.c b/src/summaryview.c
index 40cbe14ed..d10ef7888 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -420,12 +420,14 @@ GtkTargetEntry summary_drag_types[3] =
 	{"claws-mail/msg-path-list", 0, TARGET_MAIL_CM_PATH_LIST},
 };
 
+static void summary_reedit_cb(GtkAction *gaction, gpointer data);
 static void summary_reply_cb(GtkAction *gaction, gpointer data);
 
 /* Only submenus and specifically-handled menu entries here */
 static GtkActionEntry summary_popup_entries[] =
 {
 	{"SummaryViewPopup",                      NULL, "SummaryViewPopup", NULL, NULL, NULL },
+	{"SummaryViewPopup/Reedit",               NULL, N_("Re-edit"), NULL, NULL, G_CALLBACK(summary_reedit_cb) },
 	{"SummaryViewPopup/Reply",                NULL, N_("_Reply"), NULL, NULL, G_CALLBACK(summary_reply_cb) }, /* COMPOSE_REPLY */
 	{"SummaryViewPopup/ReplyTo",              NULL, N_("Repl_y to"), NULL, NULL, NULL },
 	{"SummaryViewPopup/ReplyTo/All",          NULL, N_("_All"), NULL, NULL, G_CALLBACK(summary_reply_cb) }, /* COMPOSE_REPLY_TO_ALL */
@@ -710,6 +712,7 @@ SummaryView *summary_create(MainWindow *mainwin)
 			G_N_ELEMENTS(summary_popup_entries), (gpointer)summaryview);
 
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus", "SummaryViewPopup", "SummaryViewPopup", GTK_UI_MANAGER_MENU)
+	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Reedit", "SummaryViewPopup/Reedit", GTK_UI_MANAGER_MENUITEM)
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Reply", "SummaryViewPopup/Reply", GTK_UI_MANAGER_MENUITEM)
 #ifndef GENERIC_UMPC
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "ReplyTo", "SummaryViewPopup/ReplyTo", GTK_UI_MANAGER_MENU)
@@ -1816,9 +1819,9 @@ void summary_set_menu_sensitive(SummaryView *summaryview)
 	gint i;
 
 #ifndef GENERIC_UMPC
-#define N_ENTRIES 39
+#define N_ENTRIES 40
 #else
-#define N_ENTRIES 28
+#define N_ENTRIES 29
 #endif
 	static struct {
 		const gchar *entry;
@@ -1831,6 +1834,7 @@ do { \
 	entry[i].entry = (const gchar *) entry_str; entry[i++].cond = main_window_get_mask(__VA_ARGS__, -1); \
 } while (0)
 
+	FILL_TABLE("Menus/SummaryViewPopup/Reedit", M_TARGET_EXIST, M_DRAFT);
 	FILL_TABLE("Menus/SummaryViewPopup/Reply", M_HAVE_ACCOUNT, M_TARGET_EXIST);
 #ifndef GENERIC_UMPC
 	FILL_TABLE("Menus/SummaryViewPopup/ReplyTo", M_HAVE_ACCOUNT, M_TARGET_EXIST);
@@ -8521,6 +8525,12 @@ void summaryview_unlock(SummaryView *summaryview, FolderItem *item)
 	gtk_widget_set_sensitive(summaryview->ctree, TRUE);
 }
 
+static void summary_reedit_cb(GtkAction *gaction, gpointer data)
+{
+	SummaryView *summaryview = (SummaryView *)data;
+	summary_reedit(summaryview);
+}
+
 #define DO_ACTION(name, act)	{ if (!strcmp(a_name, name)) action = act; }
 static void summary_reply_cb(GtkAction *gaction, gpointer data)
 {

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list