Patches item #1821902, was opened at 2007-10-29 02:42
Message generated for change (Comment added) made by ler762
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=311118&aid=1821902&group_id=11118
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: new feature
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Lee (ler762)
Assigned to: Gerry Murphy (gjmurphy)
Summary: Windows: tray icon changes when Privoxy toggled off
Initial Comment:
in response to feature request 1818869
Change the tray icon when Privoxy is toggled off
future enhancement: Privoxy still uses the green 'radar screen' icons when it's receiving traffic. If Privoxy is acting as a transparent proxy it'd probably be better if it used red activity icons so better indicate that it's not filtering traffic.
$diff -c w32.rc.old w32.rc
*** w32.rc.old Thu Aug 17 22:06:25 2006
--- w32.rc Sat Oct 27 12:51:38 2007
***************
*** 178,183 ****
--- 178,184 ----
IDI_ANIMATED7 ICON DISCARDABLE "icons/ico00007.ico"
IDI_ANIMATED8 ICON DISCARDABLE "icons/ico00008.ico"
IDI_IDLE ICON DISCARDABLE "icons/privoxy.ico"
+ IDI_OFF ICON DISCARDABLE "icons/off.ico"
#endif /* Neutral resources */
$diff -c w32.rc.old w32.rc
*** w32.rc.old Thu Aug 17 22:06:25 2006
--- w32.rc Sat Oct 27 12:51:38 2007
***************
*** 178,183 ****
--- 178,184 ----
IDI_ANIMATED7 ICON DISCARDABLE "icons/ico00007.ico"
IDI_ANIMATED8 ICON DISCARDABLE "icons/ico00008.ico"
IDI_IDLE ICON DISCARDABLE "icons/privoxy.ico"
+ IDI_OFF ICON DISCARDABLE "icons/off.ico"
#endif /* Neutral resources */
/source/privoxy/current
$diff -c w32log.c.old w32log.c
*** w32log.c.old Tue Jul 18 10:48:48 2006
--- w32log.c Sat Oct 27 14:44:25 2007
***************
*** 347,352 ****
--- 347,353 ----
static WNDPROC g_fnLogBox;
static HICON g_hiconAnim[ANIM_FRAMES];
static HICON g_hiconIdle;
+ static HICON g_hiconOff;
static int g_nAnimFrame;
static BOOL g_bClipPending = FALSE;
static int g_nRichEditVersion = 0;
***************
*** 364,369 ****
--- 365,371 ----
static void LogCreatePatternMatchingBuffers(void);
static void LogDestroyPatternMatchingBuffers(void);
static int LogPutStringNoMatch(const char *pszText, int style);
+ static void SetIdleIcon(void);
/*********************************************************************
***************
*** 383,388 ****
--- 385,391 ----
/* Load the icons */
g_hiconIdle = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_IDLE));
+ g_hiconOff = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_OFF));
for (i = 0; i < ANIM_FRAMES; i++)
{
g_hiconAnim[i] = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_ANIMATED1 + i));
***************
*** 425,430 ****
--- 428,434 ----
TrayDeleteIcon(g_hwndTray, 1);
DeleteObject(g_hiconApp);
DeleteObject(g_hiconIdle);
+ DeleteObject(g_hiconOff);
for (i = 0; i < ANIM_FRAMES; i++)
{
DeleteObject(g_hiconAnim[i]);
***************
*** 1139,1144 ****
--- 1143,1149 ----
{
log_error(LOG_LEVEL_INFO, "Now toggled OFF.");
}
+ SetIdleIcon();
break;
#endif /* def FEATURE_TOGGLE */
***************
*** 1251,1257 ****
case TIMER_ANIMSTOP_ID:
g_nAnimFrame = 0;
! TraySetIcon(g_hwndTray, 1, g_hiconIdle);
KillTimer(g_hwndLogFrame, TIMER_ANIM_ID);
KillTimer(g_hwndLogFrame, TIMER_ANIMSTOP_ID);
break;
--- 1256,1262 ----
case TIMER_ANIMSTOP_ID:
g_nAnimFrame = 0;
! SetIdleIcon();
KillTimer(g_hwndLogFrame, TIMER_ANIM_ID);
KillTimer(g_hwndLogFrame, TIMER_ANIMSTOP_ID);
break;
***************
*** 1271,1276 ****
--- 1276,1305 ----
}
+ /*********************************************************************
+ *
+ * Function : SetIdleIcon
+ *
+ * Description : Sets the tray icon to either idle or off
+ *
+ * Parameters : none
+ *
+ * Returns : N/A
+ *
+ *********************************************************************/
+ void SetIdleIcon()
+ {
+ #ifdef FEATURE_TOGGLE
+ if (!global_toggle_state)
+ {
+ TraySetIcon(g_hwndTray, 1, g_hiconOff);
+ /* log_error(LOG_LEVEL_INFO, "Privoxy OFF icon selected."); */
+ }
+ else
+ #endif /* def FEATURE_TOGGLE */
+ TraySetIcon(g_hwndTray, 1, g_hiconIdle);
+ }
+
/*********************************************************************
*
$diff -c w32res.h.old w32res.h
*** w32res.h.old Tue Jul 18 10:48:48 2006
--- w32res.h Sat Oct 27 13:01:57 2007
***************
*** 140,145 ****
--- 140,146 ----
#define IDI_ANIMATED6 206
#define IDI_ANIMATED7 207
#define IDI_ANIMATED8 208
+ #define IDI_OFF 209
#define ID_TOGGLE_SHOWWINDOW 4000
#define ID_HELP_ABOUT 4001
(attached file off.ico goes in the current/icons directory)
----------------------------------------------------------------------
>Comment By: Lee (ler762)
Date: 2008-12-23 21:00
Message:
Updated patch for current source code. Should I apply the patch to CVS?
File Added: toggle-tray-icon.txt
----------------------------------------------------------------------
Comment By: Lee (ler762)
Date: 2007-11-05 06:57
Message:
Logged In: YES
user_id=1924122
Originator: YES
Same patch as before, but this time shown as a unified diff.
See the attached zip file for possible icons. It's got the original
off.ico along with and two greyed out icons - one with a red circle+slash
and another with a red X.
Rename whichever icon you like to "off.ico", put it in the current/icons
directory & rebuild.
$diff -u w32.rc.old w32.rc
--- w32.rc.old 2006-08-17 22:06:25.000000000 -0400
+++ w32.rc 2007-10-27 12:51:38.751500000 -0400
@@ -178,6 +178,7 @@
IDI_ANIMATED7 ICON DISCARDABLE "icons/ico00007.ico"
IDI_ANIMATED8 ICON DISCARDABLE "icons/ico00008.ico"
IDI_IDLE ICON DISCARDABLE "icons/privoxy.ico"
+IDI_OFF ICON DISCARDABLE "icons/off.ico"
#endif /* Neutral resources */
$diff -u w32res.h.old w32res.h
--- w32res.h.old 2006-07-18 10:48:48.000000000 -0400
+++ w32res.h 2007-10-27 13:01:57.985875000 -0400
@@ -140,6 +140,7 @@
#define IDI_ANIMATED6 206
#define IDI_ANIMATED7 207
#define IDI_ANIMATED8 208
+#define IDI_OFF 209
#define ID_TOGGLE_SHOWWINDOW 4000
#define ID_HELP_ABOUT 4001
$diff -u w32log.c.old w32log.c
--- w32log.c.old 2006-07-18 10:48:48.000000000 -0400
+++ w32log.c 2007-10-27 14:44:25.235875000 -0400
@@ -347,6 +347,7 @@
static WNDPROC g_fnLogBox;
static HICON g_hiconAnim[ANIM_FRAMES];
static HICON g_hiconIdle;
+static HICON g_hiconOff;
static int g_nAnimFrame;
static BOOL g_bClipPending = FALSE;
static int g_nRichEditVersion = 0;
@@ -364,6 +365,7 @@
static void LogCreatePatternMatchingBuffers(void);
static void LogDestroyPatternMatchingBuffers(void);
static int LogPutStringNoMatch(const char *pszText, int style);
+static void SetIdleIcon(void);
/*********************************************************************
@@ -383,6 +385,7 @@
/* Load the icons */
g_hiconIdle = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_IDLE));
+ g_hiconOff = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_OFF));
for (i = 0; i < ANIM_FRAMES; i++)
{
g_hiconAnim[i] = LoadIcon(g_hInstance,
MAKEINTRESOURCE(IDI_ANIMATED1 + i));
@@ -425,6 +428,7 @@
TrayDeleteIcon(g_hwndTray, 1);
DeleteObject(g_hiconApp);
DeleteObject(g_hiconIdle);
+ DeleteObject(g_hiconOff);
for (i = 0; i < ANIM_FRAMES; i++)
{
DeleteObject(g_hiconAnim[i]);
@@ -1139,6 +1143,7 @@
{
log_error(LOG_LEVEL_INFO, "Now toggled OFF.");
}
+ SetIdleIcon();
break;
#endif /* def FEATURE_TOGGLE */
@@ -1251,7 +1256,7 @@
case TIMER_ANIMSTOP_ID:
g_nAnimFrame = 0;
- TraySetIcon(g_hwndTray, 1, g_hiconIdle);
+ SetIdleIcon();
KillTimer(g_hwndLogFrame, TIMER_ANIM_ID);
KillTimer(g_hwndLogFrame, TIMER_ANIMSTOP_ID);
break;
@@ -1271,6 +1276,30 @@
}
+/*********************************************************************
+ *
+ * Function : SetIdleIcon
+ *
+ * Description : Sets the tray icon to either idle or off
+ *
+ * Parameters : none
+ *
+ * Returns : N/A
+ *
+ *********************************************************************/
+void SetIdleIcon()
+{
+#ifdef FEATURE_TOGGLE
+ if (!global_toggle_state)
+ {
+ TraySetIcon(g_hwndTray, 1, g_hiconOff);
+ /* log_error(LOG_LEVEL_INFO, "Privoxy OFF icon selected.");
*/
+ }
+ else
+#endif /* def FEATURE_TOGGLE */
+ TraySetIcon(g_hwndTray, 1, g_hiconIdle);
+}
+
/*********************************************************************
*
File Added: privoxyIcons.zip
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=311118&aid=1821902&group_id=11118
|