From d9fddc0cfa9066eb1b5ad3f4807b37426ae6ca88 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 5 Mar 2019 21:10:22 +0300 Subject: Popup: - wiping out checks for service presence; - code cleaning --- plugins/TrafficCounter/src/TrafficCounter.cpp | 5 +---- plugins/TrafficCounter/src/options.cpp | 14 ++++++-------- plugins/TrafficCounter/src/stdafx.h | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) (limited to 'plugins/TrafficCounter/src') diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index c79ab478d2..9fd318ab9b 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -30,7 +30,7 @@ HWND TrafficHwnd; CMPlugin g_plugin; -BOOL bPopupExists = FALSE, bVariablesExists = FALSE, bTooltipExists = FALSE; +BOOL bVariablesExists = FALSE, bTooltipExists = FALSE; static wchar_t wszDefaultFormat[] = _A2W("{I4}\x0D\x0A\x0A\ @@ -147,7 +147,6 @@ int TrafficCounterShutdown(WPARAM, LPARAM) int ModuleLoad(WPARAM, LPARAM) { - bPopupExists = ServiceExists(MS_POPUP_ADDPOPUPW); bVariablesExists = ServiceExists(MS_VARS_FORMATSTRING) && ServiceExists(MS_VARS_REGISTERTOKEN); bTooltipExists = ServiceExists("mToolTip/ShowTipW") || ServiceExists("mToolTip/ShowTip"); return 0; @@ -872,8 +871,6 @@ void Traffic_AddMainMenuItem(void) /*-------------------------------------------------------------------------------------------------------------------*/ void UpdateNotifyTimer(void) { - if (!bPopupExists) return; - if (Traffic_Notify_time_value && unOptions.NotifyByTime) SetTimer(TrafficHwnd, TIMER_NOTIFY_TICK, Traffic_Notify_time_value * 1000 * 60, nullptr); else diff --git a/plugins/TrafficCounter/src/options.cpp b/plugins/TrafficCounter/src/options.cpp index 796dc87623..c419323d75 100644 --- a/plugins/TrafficCounter/src/options.cpp +++ b/plugins/TrafficCounter/src/options.cpp @@ -359,13 +359,11 @@ int TrafficCounterOptInitialise(WPARAM wParam, LPARAM) g_plugin.addOptions(wParam, &odp); // Popups option page - if (bPopupExists) { - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TRAFFIC_POPUPS); - odp.szGroup.a = LPGEN("Popups"); - odp.szTitle.a = LPGEN("Traffic counter"); - odp.pfnDlgProc = DlgProcPopupsTraffic; - odp.flags = ODPF_BOLDGROUPS; - g_plugin.addOptions(wParam, &odp); - } + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TRAFFIC_POPUPS); + odp.szGroup.a = LPGEN("Popups"); + odp.szTitle.a = LPGEN("Traffic counter"); + odp.pfnDlgProc = DlgProcPopupsTraffic; + odp.flags = ODPF_BOLDGROUPS; + g_plugin.addOptions(wParam, &odp); return 0; } diff --git a/plugins/TrafficCounter/src/stdafx.h b/plugins/TrafficCounter/src/stdafx.h index 15037b21cd..01fc381ec8 100644 --- a/plugins/TrafficCounter/src/stdafx.h +++ b/plugins/TrafficCounter/src/stdafx.h @@ -165,7 +165,7 @@ extern char Traffic_AdditionSpace; extern wchar_t Traffic_CounterFormat[512]; extern wchar_t Traffic_TooltipFormat[512]; -extern BOOL bPopupExists, bVariablesExists, bTooltipExists; +extern BOOL bVariablesExists, bTooltipExists; extern BOOL UseKeyColor; extern COLORREF KeyColor; -- cgit v1.2.3