[Commits] [SCM] claws branch, master, updated. 3.16.0-137-g5a69a47

wwp at claws-mail.org wwp at claws-mail.org
Mon Apr 23 18:51:38 CEST 2018


The branch, master has been updated
       via  5a69a47415c5c3573edbae60a9cc009550ff08c7 (commit)
      from  2a197d0dc60019f54b6431a7cb726a133c0465da (commit)

Summary of changes:
 src/common/log.c    |   12 ++++++++++++
 src/common/log.h    |    1 +
 src/gtk/logwindow.c |   13 ++++++++-----
 src/gtk/logwindow.h |    1 +
 4 files changed, 22 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit 5a69a47415c5c3573edbae60a9cc009550ff08c7
Author: wwp <wwp at free.fr>
Date:   Mon Apr 23 18:50:40 2018 +0200

    Don't add "Go to last error" to filtering log window's context menu.

diff --git a/src/common/log.c b/src/common/log.c
index 103e9f1..8b21061 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -64,6 +64,12 @@ static gchar *log_filename[LOG_INSTANCE_MAX] = {
 	NULL
 };
 
+/* read-only */
+static gchar *log_error_capability[LOG_INSTANCE_MAX] = {
+	TRUE,
+	FALSE
+};
+
 typedef struct _LogInstanceData LogInstanceData;
 
 struct _LogInstanceData {
@@ -178,6 +184,12 @@ void get_log_prefs(LogInstance instance, int** logwin_width, int** logwin_height
 		*logwin_height = log_instances[instance].prefs_logwin_height;
 }
 
+gboolean get_log_error_capability(LogInstance instance)
+{
+	return log_error_capability[instance];
+
+}
+
 void log_print(LogInstance instance, const gchar *format, ...)
 {
 	va_list args;
diff --git a/src/common/log.h b/src/common/log.h
index f6819f9..c48343b 100644
--- a/src/common/log.h
+++ b/src/common/log.h
@@ -67,6 +67,7 @@ void set_log_title(LogInstance instance, gchar *title);
 gchar *get_log_title(LogInstance instance);
 void set_log_prefs(LogInstance instance, int* logwin_width, int* logwin_height);
 void get_log_prefs(LogInstance instance, int** logwin_width, int** logwin_height);
+gboolean get_log_error_capability(LogInstance instance);
 void log_print		(LogInstance instance, const gchar *format, ...) G_GNUC_PRINTF(2, 3);
 void log_message	(LogInstance instance, const gchar *format, ...) G_GNUC_PRINTF(2, 3);
 void log_warning	(LogInstance instance, const gchar *format, ...) G_GNUC_PRINTF(2, 3);
diff --git a/src/gtk/logwindow.c b/src/gtk/logwindow.c
index 56b151f..47ff1c8 100644
--- a/src/gtk/logwindow.c
+++ b/src/gtk/logwindow.c
@@ -146,6 +146,7 @@ LogWindow *log_window_create(LogInstance instance)
 	logwin->scrolledwin = scrolledwin;
 	logwin->text = text;
 	logwin->hook_id = hooks_register_hook(get_log_hook(instance), log_window_append, logwin);
+	logwin->has_error_capability = get_log_error_capability(instance);
 
 	return logwin;
 }
@@ -448,11 +449,13 @@ static void log_window_popup_menu_extend(GtkTextView *textview,
 	gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), menuitem);
 	gtk_widget_show(menuitem);
 
-	menuitem = gtk_menu_item_new_with_mnemonic(_("_Go to last error"));
-	g_signal_connect(G_OBJECT(menuitem), "activate",
-			 G_CALLBACK(log_window_go_to_last_error), logwin);
-	gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), menuitem);
-	gtk_widget_show(menuitem);
+	if (logwin->has_error_capability) {
+		menuitem = gtk_menu_item_new_with_mnemonic(_("_Go to last error"));
+		g_signal_connect(G_OBJECT(menuitem), "activate",
+				 G_CALLBACK(log_window_go_to_last_error), logwin);
+		gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), menuitem);
+		gtk_widget_show(menuitem);
+	}
 
 	menuitem = gtk_menu_item_new_with_mnemonic(_("Clear _Log"));
 	g_signal_connect(G_OBJECT(menuitem), "activate",
diff --git a/src/gtk/logwindow.h b/src/gtk/logwindow.h
index 75a7def..f47cb2f 100644
--- a/src/gtk/logwindow.h
+++ b/src/gtk/logwindow.h
@@ -51,6 +51,7 @@ struct _LogWindow
 	gboolean hidden;
 	gboolean never_shown;
 	gboolean has_error;
+	gboolean has_error_capability;
 };
 
 LogWindow *log_window_create(LogInstance instance);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list