commit the part of the patches I've been using that were written by torford and gjmurphy
authorLee <ler762@users.sourceforge.net>
Sun, 2 Nov 2008 14:37:47 +0000 (14:37 +0000)
committerLee <ler762@users.sourceforge.net>
Sun, 2 Nov 2008 14:37:47 +0000 (14:37 +0000)
  [ 1824315 ] Minor code cleanup
  [ 1781135 ] Patch - Add clear log, select all, and Accelerators for w32
    http://sourceforge.net/tracker/?func=detail&atid=311118&aid=1781135&group_id=11118
The full patch adds control keys A(select all), C(copy) and D(delete all) to the
Privoxy log window menu.  Select all and copy work for me without the patch
(albeit without showing the accelerator keys on the menu), so the only part of the
patch I've been using for the last year or so has been the ctrl-d to delete
everything in the Privoxy log window.

w32.rc
w32log.c
w32res.h

diff --git a/w32.rc b/w32.rc
index 62a0dab..e5b20a4 100644 (file)
--- a/w32.rc
+++ b/w32.rc
  *
  * Revisions   :
  *    $Log: w32.rc,v $
  *
  * Revisions   :
  *    $Log: w32.rc,v $
+ *    Revision 1.20  2006/08/18 02:06:25  david__schmidt
+ *    Making icon go back to blue when idle.
+ *    See: bug #967648.
+ *
  *    Revision 1.19  2006/07/18 14:48:48  david__schmidt
  *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
  *    with what was really the latest development (the v_3_0_branch branch)
  *    Revision 1.19  2006/07/18 14:48:48  david__schmidt
  *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
  *    with what was really the latest development (the v_3_0_branch branch)
@@ -269,7 +273,7 @@ BEGIN
     END
     POPUP "&View"
     BEGIN
     END
     POPUP "&View"
     BEGIN
-        MENUITEM "&Clear Log",                  ID_VIEW_CLEARLOG
+        MENUITEM "&Clear Log\tCtrl+D",          ID_VIEW_CLEARLOG
         MENUITEM                                SEPARATOR
         MENUITEM "&Log Messages",               ID_VIEW_LOGMESSAGES, CHECKED
         MENUITEM "Message &Highlighting",       ID_VIEW_MESSAGEHIGHLIGHTING, CHECKED
         MENUITEM                                SEPARATOR
         MENUITEM "&Log Messages",               ID_VIEW_LOGMESSAGES, CHECKED
         MENUITEM "Message &Highlighting",       ID_VIEW_MESSAGEHIGHLIGHTING, CHECKED
@@ -318,6 +322,7 @@ END
 IDR_ACCELERATOR ACCELERATORS DISCARDABLE
 BEGIN
     "C",            ID_EDIT_COPY,           VIRTKEY, CONTROL, NOINVERT
 IDR_ACCELERATOR ACCELERATORS DISCARDABLE
 BEGIN
     "C",            ID_EDIT_COPY,           VIRTKEY, CONTROL, NOINVERT
+    "D",            ID_VIEW_CLEARLOG,       VIRTKEY, CONTROL, NOINVERT
 END
 
 #endif /* English (U.S.) resources */
 END
 
 #endif /* English (U.S.) resources */
index 732c0a3..6543fae 100644 (file)
--- a/w32log.c
+++ b/w32log.c
@@ -1,7 +1,7 @@
-const char w32log_rcs[] = "$Id: w32log.c,v 1.25.2.5 2003/04/04 12:48:51 oes Exp $";
+const char w32log_rcs[] = "$Id: w32log.c,v 1.27 2006/07/18 14:48:48 david__schmidt Exp $";
 /*********************************************************************
  *
 /*********************************************************************
  *
- * File        :  $Source: /cvsroot/ijbswa/current/Attic/w32log.c,v $
+ * File        :  $Source: /cvsroot/ijbswa/current/w32log.c,v $
  *
  * Purpose     :  Functions for creating and destroying the log window,
  *                ouputting strings, processing messages and so on.
  *
  * Purpose     :  Functions for creating and destroying the log window,
  *                ouputting strings, processing messages and so on.
@@ -32,6 +32,10 @@ const char w32log_rcs[] = "$Id: w32log.c,v 1.25.2.5 2003/04/04 12:48:51 oes Exp
  *
  * Revisions   :
  *    $Log: w32log.c,v $
  *
  * Revisions   :
  *    $Log: w32log.c,v $
+ *    Revision 1.27  2006/07/18 14:48:48  david__schmidt
+ *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
+ *    with what was really the latest development (the v_3_0_branch branch)
+ *
  *    Revision 1.25.2.5  2003/04/04 12:48:51  oes
  *    Fixed bug #711865:
  *     - Made tray menu correctly reflect initial window visibility state
  *    Revision 1.25.2.5  2003/04/04 12:48:51  oes
  *    Fixed bug #711865:
  *     - Made tray menu correctly reflect initial window visibility state
@@ -1294,8 +1298,16 @@ LRESULT CALLBACK LogRichEditProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
          pt.y = HIWORD(lParam);
          ClientToScreen(hwnd, &pt);
          OnLogRButtonUp(wParam, pt.x, pt.y);
          pt.y = HIWORD(lParam);
          ClientToScreen(hwnd, &pt);
          OnLogRButtonUp(wParam, pt.x, pt.y);
+         return 0;
+      }
+      case WM_CHAR:
+      {
+         if ((GetKeyState(VK_CONTROL) != 0) && (wParam == 4)) /* ctrl+d */
+         {
+             OnLogCommand(ID_VIEW_CLEARLOG);
+             return 0;
+         }
       }
       }
-      return 0;
    }
    return CallWindowProc(g_fnLogBox, hwnd, uMsg, wParam, lParam);
 
    }
    return CallWindowProc(g_fnLogBox, hwnd, uMsg, wParam, lParam);
 
@@ -1373,6 +1385,14 @@ LRESULT CALLBACK LogWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
                return 0;
          }
          break;
                return 0;
          }
          break;
+
+      case WM_CHAR:
+         if ((GetKeyState(VK_CONTROL) != 0) && (wParam == 4)) /* ctrl+d */
+         {
+             OnLogCommand(ID_VIEW_CLEARLOG);
+             return 0;
+         }
+         break;
    }
 
    return DefWindowProc(hwnd, uMsg, wParam, lParam);
    }
 
    return DefWindowProc(hwnd, uMsg, wParam, lParam);
index 843359a..ffe1b1b 100644 (file)
--- a/w32res.h
+++ b/w32res.h
@@ -1,9 +1,9 @@
 #ifndef W32RES_H_INCLUDED
 #define W32RES_H_INCLUDED
 #ifndef W32RES_H_INCLUDED
 #define W32RES_H_INCLUDED
-#define W32RES_H_VERSION "$Id: w32res.h,v 1.13.2.1 2002/08/21 17:59:06 oes Exp $"
+#define W32RES_H_VERSION "$Id: w32res.h,v 1.15 2006/07/18 14:48:48 david__schmidt Exp $"
 /*********************************************************************
  *
 /*********************************************************************
  *
- * File        :  $Source: /cvsroot/ijbswa/current/Attic/w32res.h,v $
+ * File        :  $Source: /cvsroot/ijbswa/current/w32res.h,v $
  *
  * Purpose     :  Identifiers for Windows GUI resources.
  *
  *
  * Purpose     :  Identifiers for Windows GUI resources.
  *
  *
  * Revisions   :
  *    $Log: w32res.h,v $
  *
  * Revisions   :
  *    $Log: w32res.h,v $
+ *    Revision 1.15  2006/07/18 14:48:48  david__schmidt
+ *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
+ *    with what was really the latest development (the v_3_0_branch branch)
+ *
  *    Revision 1.13.2.1  2002/08/21 17:59:06  oes
  *     - "Show Privoxy Window" now a toggle
  *     - Temp kludge to let user and default action file be edited through win32 GUI (FR 592080)
  *    Revision 1.13.2.1  2002/08/21 17:59:06  oes
  *     - "Show Privoxy Window" now a toggle
  *     - Temp kludge to let user and default action file be edited through win32 GUI (FR 592080)
 #define ID_TOOLS_EDITTRUST                5004
 #endif /* def FEATURE_TRUST */
 
 #define ID_TOOLS_EDITTRUST                5004
 #endif /* def FEATURE_TRUST */
 
-/*
- * The following symbols are declared in <afxres.h> in VC++.
- * However, mingw32 doesn't have that header.  Let's 
- * always declare them here, for consistency.
- * These are the VC++ values.
- */
-#define IDC_STATIC      (-1)
 #define ID_EDIT_COPY  30000
 
 
 #define ID_EDIT_COPY  30000