diff options
author | George Hazan <ghazan@miranda.im> | 2019-07-23 21:26:21 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-07-23 21:26:21 +0300 |
commit | cc7ce9ae393ea6a72ce2f9af5a4ce6db85079d89 (patch) | |
tree | 762d5ba54360c5708b074b3a5384d02f33400f21 | |
parent | 3447d7f8d3d7d6d9da1dce8af7d6d4323e070aae (diff) |
code cleaning
-rw-r--r-- | protocols/ConnectionNotify/src/ConnectionNotify.cpp | 10 | ||||
-rw-r--r-- | protocols/ConnectionNotify/src/options.cpp | 12 |
2 files changed, 9 insertions, 13 deletions
diff --git a/protocols/ConnectionNotify/src/ConnectionNotify.cpp b/protocols/ConnectionNotify/src/ConnectionNotify.cpp index a82c7830d5..f6fd89cb20 100644 --- a/protocols/ConnectionNotify/src/ConnectionNotify.cpp +++ b/protocols/ConnectionNotify/src/ConnectionNotify.cpp @@ -95,7 +95,7 @@ void saveSettingsConnections(CONNECTION *connHead) tmp = tmp->next; } g_plugin.iFiltersCount = i; - g_plugin.setDword("g_plugin.iFiltersCount", g_plugin.iFiltersCount); + g_plugin.setDword("FiltersCount", g_plugin.iFiltersCount); } @@ -139,14 +139,14 @@ CONNECTION* LoadSettingsConnections() void LoadSettings() { g_plugin.iInterval = g_plugin.getDword("Interval", 500); - g_plugin.iInterval1 = g_plugin.getDword("PopupInterval", 0); - g_plugin.bResolveIp = g_plugin.getByte("ResolveIp", TRUE); + g_plugin.iInterval1 = g_plugin.getDword("PopupInterval"); + g_plugin.bResolveIp = g_plugin.getBool("ResolveIp", true); g_plugin.iDefaultAction = g_plugin.getByte("FilterDefaultAction", TRUE); - g_plugin.bSetColours = g_plugin.getByte("PopupSetColours", 0); + g_plugin.bSetColours = g_plugin.getBool("PopupSetColours"); g_plugin.BgColor = g_plugin.getDword("PopupBgColor", (DWORD)0xFFFFFF); g_plugin.FgColor = g_plugin.getDword("PopupFgColor", (DWORD)0x000000); - g_plugin.iFiltersCount = g_plugin.getDword("g_plugin.iFiltersCount", 0); + g_plugin.iFiltersCount = g_plugin.getDword("FiltersCount"); g_plugin.iStatusMask = g_plugin.getWord("StatusMask", 16); for (int i = 0; i < MAX_STATUS_COUNT; i++) { char buff[128]; diff --git a/protocols/ConnectionNotify/src/options.cpp b/protocols/ConnectionNotify/src/options.cpp index c06b7ee0e1..ea9a98fac4 100644 --- a/protocols/ConnectionNotify/src/options.cpp +++ b/protocols/ConnectionNotify/src/options.cpp @@ -205,7 +205,7 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar switch (LOWORD(wParam)) { case IDC_INTERVAL: g_plugin.iInterval = GetDlgItemInt(hwndDlg, IDC_INTERVAL, nullptr, FALSE); break; case IDC_INTERVAL1: g_plugin.iInterval1 = GetDlgItemInt(hwndDlg, IDC_INTERVAL1, nullptr, TRUE); break; - case IDC_RESOLVEIP: g_plugin.bResolveIp = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RESOLVEIP); break; + case IDC_RESOLVEIP: g_plugin.bResolveIp = 0 != IsDlgButtonChecked(hwndDlg, IDC_RESOLVEIP); break; case ID_CHK_DEFAULTACTION: g_plugin.iDefaultAction = (BYTE)IsDlgButtonChecked(hwndDlg, ID_CHK_DEFAULTACTION); break; case ID_ADD: { @@ -319,13 +319,9 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar break; case IDC_SETCOLOURS: - { - HWND hwnd = GetDlgItem(hwndDlg, IDC_BGCOLOR); - g_plugin.bSetColours = IsDlgButtonChecked(hwndDlg, IDC_SETCOLOURS); - EnableWindow(hwnd, g_plugin.bSetColours); - hwnd = GetDlgItem(hwndDlg, IDC_FGCOLOR); - EnableWindow(hwnd, g_plugin.bSetColours); - } + g_plugin.bSetColours = 0 != IsDlgButtonChecked(hwndDlg, IDC_SETCOLOURS); + EnableWindow(GetDlgItem(hwndDlg, IDC_BGCOLOR), g_plugin.bSetColours); + EnableWindow(GetDlgItem(hwndDlg, IDC_FGCOLOR), g_plugin.bSetColours); break; case IDC_BGCOLOR: |