From 67fc09987e008aacbdd07b205a89bc6a5ef28b8a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 23 Jan 2025 16:10:33 +0300 Subject: old obsoleted code removed --- plugins/AutoShutdown/src/options.cpp | 12 +----------- plugins/AutoShutdown/src/resource.h | 1 - plugins/AutoShutdown/src/stdafx.h | 1 - plugins/AutoShutdown/src/watcher.cpp | 15 --------------- 4 files changed, 1 insertion(+), 28 deletions(-) (limited to 'plugins/AutoShutdown/src') diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp index 4dcf972a56..a005589ffd 100644 --- a/plugins/AutoShutdown/src/options.cpp +++ b/plugins/AutoShutdown/src/options.cpp @@ -42,15 +42,7 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam CheckDlgButton(hwndDlg, IDC_CHECK_SMARTOFFLINECHECK, g_plugin.getByte("SmartOfflineCheck", SETTING_SMARTOFFLINECHECK_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHECK_REMEMBERONRESTART, g_plugin.getByte("RememberOnRestart", SETTING_REMEMBERONRESTART_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHECK_SHOWCONFIRMDLG, g_plugin.getByte("ShowConfirmDlg", SETTING_SHOWCONFIRMDLG_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED); - { - BOOL enabled = ServiceIsTypeEnabled(SDSDT_SHUTDOWN, 0); - if (enabled) { - if (ServiceExists(MS_WEATHER_UPDATE)) { - EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_WEATHER), TRUE); - CheckDlgButton(hwndDlg, IDC_CHECK_WEATHER, g_plugin.getByte("WeatherShutdown", SETTING_WEATHERSHUTDOWN_DEFAULT) != 0 ? BST_CHECKED : BST_UNCHECKED); - } - } - } + SendMessage(hwndDlg, M_ENABLE_SUBCTLS, 0, 0); return TRUE; /* default focus */ @@ -89,8 +81,6 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam g_plugin.setWord("ConfirmDlgCountdown", (uint16_t)GetDlgItemInt(hwndDlg, IDC_EDIT_CONFIRMDLGCOUNTDOWN, nullptr, FALSE)); g_plugin.setByte("RememberOnRestart", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_REMEMBERONRESTART) != 0)); g_plugin.setByte("SmartOfflineCheck", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SMARTOFFLINECHECK) != 0)); - if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHECK_WEATHER))) - g_plugin.setByte("WeatherShutdown", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_CHECK_WEATHER) != 0)); return TRUE; } break; diff --git a/plugins/AutoShutdown/src/resource.h b/plugins/AutoShutdown/src/resource.h index 78a764d908..7a9f7d1baf 100644 --- a/plugins/AutoShutdown/src/resource.h +++ b/plugins/AutoShutdown/src/resource.h @@ -42,7 +42,6 @@ #define IDC_SPIN_CONFIRMDLGCOUNTDOWN 1032 #define IDC_CHECK_REMEMBERONRESTART 1033 #define IDC_CHECK_SMARTOFFLINECHECK 1034 -#define IDC_CHECK_WEATHER 1035 // Next default values for new objects // diff --git a/plugins/AutoShutdown/src/stdafx.h b/plugins/AutoShutdown/src/stdafx.h index 3ee6fd516b..88e6f526fe 100644 --- a/plugins/AutoShutdown/src/stdafx.h +++ b/plugins/AutoShutdown/src/stdafx.h @@ -58,7 +58,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include #include diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 57ee51f9f4..e91433c632 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -200,17 +200,6 @@ static BOOL CALLBACK CpuUsageWatcherProc(uint8_t nCpuUsage, LPARAM lParam) return TRUE; } -/************************* Weather Shutdown ***************************/ - -static int WeatherUpdated(WPARAM wParam, LPARAM lParam) -{ - char *pszProto = Proto_GetBaseAccountName(wParam); - if ((BOOL)lParam && pszProto != nullptr && Proto_GetStatus(pszProto) == ID_STATUS_INVISIBLE) - if (g_plugin.getByte("WeatherShutdown", SETTING_WEATHERSHUTDOWN_DEFAULT)) - ServiceShutdown(SDSDT_SHUTDOWN, TRUE); - return 0; -} - /************************* Services ***********************************/ INT_PTR ServiceStartWatcher(WPARAM, LPARAM lParam) @@ -282,10 +271,6 @@ INT_PTR ServiceIsWatcherEnabled(WPARAM, LPARAM) void WatcherModulesLoaded(void) { - /* Weather Shutdown */ - if (ServiceExists(MS_WEATHER_UPDATE)) - hHookWeatherUpdated = HookEvent(ME_WEATHER_UPDATED, WeatherUpdated); - /* restore watcher if it was running on last exit */ if (g_plugin.getByte("RememberOnRestart", 0) == SDROR_RUNNING) { g_plugin.setByte("RememberOnRestart", 1); -- cgit v1.2.3