[Commits] [SCM] claws branch, master, updated. 3.9.0-182-g8528776

miras at claws-mail.org miras at claws-mail.org
Sat Apr 13 12:12:00 CEST 2013


The branch master of project "claws" (Claws Mail) has been updated
       via  8528776ec96ecb6abbfc1c5a1fcc923fd89fcf4d (commit)
      from  baeee394b3f7fff7e8a5f3a0556f9d0dafd987fb (commit)


- Log -----------------------------------------------------------------
commit 8528776ec96ecb6abbfc1c5a1fcc923fd89fcf4d
Author: Michael Rasmussen <mir at datanom.net>
Date:   Sat Apr 13 12:06:56 2013 +0200

    If 'Don't popup error dialog on receive error' is checked do not show
    alert_panel but write virus message to statusbar instead.

diff --git a/src/plugins/clamd/clamav_plugin.c b/src/plugins/clamd/clamav_plugin.c
index 03a8017..4f184e3 100644
--- a/src/plugins/clamd/clamav_plugin.c
+++ b/src/plugins/clamd/clamav_plugin.c
@@ -38,6 +38,8 @@
 #include "prefs.h"
 #include "prefs_gtk.h"
 #include "alertpanel.h"
+#include "prefs_common.h"
+#include "statusbar.h"
 
 #include "clamav_plugin.h"
 #include "clamd-plugin.h"
@@ -84,6 +86,7 @@ static gboolean scan_func(GNode *node, gpointer data)
 	response buf;
 	int max;
 	struct stat info;
+	gchar* msg;
 
 	outfile = procmime_get_tmp_file_name(mimeinfo);
 	if (procmime_get_part(outfile, mimeinfo) < 0)
@@ -107,8 +110,17 @@ static gboolean scan_func(GNode *node, gpointer data)
 						alertpanel_warning(_("Scanning\nClamd does not respond to ping.\nIs clamd running?"));
 						break;
 					case VIRUS: 
-						g_warning("Detected %s virus.\n", clamd_get_virus_name(buf.msg));
-						alertpanel_warning(_("Detected %s virus."), clamd_get_virus_name(buf.msg));
+						msg = g_strconcat(_("Detected %s virus."),
+							clamd_get_virus_name(buf.msg), NULL);
+						g_warning("%s\n", msg);
+						debug_print("no_recv: %d\n", prefs_common.no_recv_err_panel);
+						if (prefs_common.no_recv_err_panel) {
+						    statusbar_print_all("%s", msg);
+						}
+						else {
+						    alertpanel_warning("%s\n", msg);
+						}
+						g_free(msg);
 						break;
 					case SCAN_ERROR:
 						debug_print("Error: %s\n", buf.msg);
@@ -126,7 +138,7 @@ static gboolean scan_func(GNode *node, gpointer data)
 		}
 		g_unlink(outfile);
 	}
-
+	
 	return (result->status == OK) ? FALSE : TRUE;
 }
 

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

Summary of changes:
 src/plugins/clamd/clamav_plugin.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list