From 336826411c27cfe02a98f3cdd0b92d8e3ae0eae0 Mon Sep 17 00:00:00 2001
From: Lee <ler762@users.sourceforge.net>
Date: Sat, 14 Aug 2010 23:28:52 +0000
Subject: [PATCH] Feature Requests 3040263 :: Add "user.filter" to "Edit" menu
 - add an "Edit User Filters" menu item to the Privoxy Windows systray icon
 and   change the "Edit Filters" menu item to "Edit Default Filters"

---
 loadcfg.c |  7 ++++---
 w32.rc    |  6 ++++--
 w32log.c  | 16 +++++++++++-----
 w32log.h  |  5 +++--
 4 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/loadcfg.c b/loadcfg.c
index 5ced6c90..ff90b078 100644
--- a/loadcfg.c
+++ b/loadcfg.c
@@ -1,4 +1,4 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.109 2010/01/10 13:53:48 ler762 Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.110 2010/07/21 14:29:59 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@ -1479,8 +1479,9 @@ struct configuration_spec * load_config(void)
 #if defined(_WIN32) && !defined (_WIN_CONSOLE)
 
    g_default_actions_file = config->actions_file[1]; /* FIXME Hope this is default.action */
-   g_user_actions_file = config->actions_file[2]; /* FIXME Hope this is user.action */
-   g_re_filterfile    = config->re_filterfile[0]; /* FIXME Hope this is default.filter */
+   g_user_actions_file  = config->actions_file[2];  /* FIXME Hope this is user.action */
+   g_default_filterfile = config->re_filterfile[0]; /* FIXME Hope this is default.filter */
+   g_user_filterfile    = config->re_filterfile[1]; /* FIXME Hope this is user.filter */
 
 #ifdef FEATURE_TRUST
    g_trustfile        = config->trustfile;
diff --git a/w32.rc b/w32.rc
index b622f14b..ec7ff263 100644
--- a/w32.rc
+++ b/w32.rc
@@ -141,7 +141,8 @@ BEGIN
             MENUITEM "&Main Configuration",           ID_TOOLS_EDITCONFIG
             MENUITEM "&Default Actions",              ID_TOOLS_EDITDEFAULTACTIONS
             MENUITEM "&User Actions",                 ID_TOOLS_EDITUSERACTIONS
-            MENUITEM "&Filters",                      ID_TOOLS_EDITFILTERS
+            MENUITEM "Default &Filters",              ID_TOOLS_EDITDEFAULTFILTERS
+            MENUITEM "U&ser Filters",                 ID_TOOLS_EDITUSERFILTERS
 #ifdef FEATURE_TRUST
             MENUITEM "&Trust list",                   ID_TOOLS_EDITTRUST
 #endif /* def FEATURE_TRUST */
@@ -182,7 +183,8 @@ BEGIN
         MENUITEM "Edit Main &Configuration",      ID_TOOLS_EDITCONFIG
         MENUITEM "Edit &Default Actions",         ID_TOOLS_EDITDEFAULTACTIONS
         MENUITEM "Edit &User Actions",            ID_TOOLS_EDITUSERACTIONS
-        MENUITEM "Edit &Filters",                 ID_TOOLS_EDITFILTERS
+        MENUITEM "Edit Default &Filters",         ID_TOOLS_EDITDEFAULTFILTERS
+        MENUITEM "Edit U&ser Filters",            ID_TOOLS_EDITUSERFILTERS
 #ifdef FEATURE_TRUST
         MENUITEM "Edit &Trust list",              ID_TOOLS_EDITTRUST
 #endif /* def FEATURE_TRUST */
diff --git a/w32log.c b/w32log.c
index 8d5b3004..60943384 100644
--- a/w32log.c
+++ b/w32log.c
@@ -1,4 +1,4 @@
-const char w32log_rcs[] = "$Id: w32log.c,v 1.36 2009/11/08 18:09:52 ler762 Exp $";
+const char w32log_rcs[] = "$Id: w32log.c,v 1.37 2010/06/13 12:31:04 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/w32log.c,v $
@@ -135,7 +135,8 @@ int g_nFontSize = DEFAULT_LOG_FONT_SIZE;
 
 const char * g_default_actions_file = NULL;
 const char * g_user_actions_file = NULL;
-const char * g_re_filterfile = NULL;
+const char * g_default_filterfile = NULL;
+const char * g_user_filterfile = NULL;
 #ifdef FEATURE_TRUST
 const char * g_trustfile = NULL;
 #endif /* def FEATURE_TRUST */
@@ -970,8 +971,12 @@ void OnLogCommand(int nCommand)
          EditFile(g_user_actions_file);
          break;
 
-      case ID_TOOLS_EDITFILTERS:
-         EditFile(g_re_filterfile);
+      case ID_TOOLS_EDITDEFAULTFILTERS:
+         EditFile(g_default_filterfile);
+         break;
+
+      case ID_TOOLS_EDITUSERFILTERS:
+         EditFile(g_user_filterfile);
          break;
 
 #ifdef FEATURE_TRUST
@@ -1026,7 +1031,8 @@ void OnLogInitMenu(HMENU hmenu)
    /* Only enable editors if there is a file to edit */
    EnableMenuItem(hmenu, ID_TOOLS_EDITDEFAULTACTIONS, MF_BYCOMMAND | (g_default_actions_file ? MF_ENABLED : MF_GRAYED));
    EnableMenuItem(hmenu, ID_TOOLS_EDITUSERACTIONS, MF_BYCOMMAND | (g_user_actions_file ? MF_ENABLED : MF_GRAYED));
-   EnableMenuItem(hmenu, ID_TOOLS_EDITFILTERS, MF_BYCOMMAND | (g_re_filterfile ? MF_ENABLED : MF_GRAYED));
+   EnableMenuItem(hmenu, ID_TOOLS_EDITDEFAULTFILTERS, MF_BYCOMMAND | (g_default_filterfile ? MF_ENABLED : MF_GRAYED));
+   EnableMenuItem(hmenu, ID_TOOLS_EDITUSERFILTERS, MF_BYCOMMAND | (g_user_filterfile ? MF_ENABLED : MF_GRAYED));
 #ifdef FEATURE_TRUST
    EnableMenuItem(hmenu, ID_TOOLS_EDITTRUST, MF_BYCOMMAND | (g_trustfile ? MF_ENABLED : MF_GRAYED));
 #endif /* def FEATURE_TRUST */
diff --git a/w32log.h b/w32log.h
index 5b695440..9e2357c9 100644
--- a/w32log.h
+++ b/w32log.h
@@ -1,6 +1,6 @@
 #ifndef W32LOG_H_INCLUDED
 #define W32LOG_H_INCLUDED
-#define W32LOG_H_VERSION "$Id: w32log.h,v 1.13 2009/03/07 17:58:02 fabiankeil Exp $"
+#define W32LOG_H_VERSION "$Id: w32log.h,v 1.14 2009/05/16 13:27:20 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/w32log.h,v $
@@ -73,7 +73,8 @@ extern int g_nFontSize;
 
 extern const char * g_default_actions_file;
 extern const char * g_user_actions_file;
-extern const char * g_re_filterfile;
+extern const char * g_default_filterfile;
+extern const char * g_user_filterfile;
 #ifdef FEATURE_TRUST
 extern const char * g_trustfile;
 #endif /* def FEATURE_TRUST */
-- 
2.49.0