From 42c98b0aec627beb51d50942ef1d1720b3860e8e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 27 Mar 2022 15:10:42 +0300 Subject: fixes #3058 (Group chats' popup options dialog moved from StdMsg to the core, its copy in Scriver removed) --- plugins/Scriver/src/chat_options.cpp | 84 ------------------------------------ plugins/Scriver/src/resource.h | 8 ---- 2 files changed, 92 deletions(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/chat_options.cpp b/plugins/Scriver/src/chat_options.cpp index adc391c014..6fef88c896 100644 --- a/plugins/Scriver/src/chat_options.cpp +++ b/plugins/Scriver/src/chat_options.cpp @@ -554,82 +554,6 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, return FALSE; } -static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uMsg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - - SendDlgItemMessage(hwndDlg, IDC_CHAT_BKG, CPM_SETCOLOUR, 0, g_Settings.crPUBkgColour); - SendDlgItemMessage(hwndDlg, IDC_CHAT_TEXT, CPM_SETCOLOUR, 0, g_Settings.crPUTextColour); - - if (g_Settings.iPopupStyle == 2) - CheckDlgButton(hwndDlg, IDC_CHAT_RADIO2, BST_CHECKED); - else if (g_Settings.iPopupStyle == 3) - CheckDlgButton(hwndDlg, IDC_CHAT_RADIO3, BST_CHECKED); - else - CheckDlgButton(hwndDlg, IDC_CHAT_RADIO1, BST_CHECKED); - - EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_BKG), IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) == BST_CHECKED ? TRUE : FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_TEXT), IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) == BST_CHECKED ? TRUE : FALSE); - - SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN1, UDM_SETRANGE, 0, MAKELONG(100, -1)); - SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN1, UDM_SETPOS, 0, MAKELONG(g_Settings.iPopupTimeout, 0)); - break; - - case WM_COMMAND: - if ((LOWORD(wParam) == IDC_CHAT_TIMEOUT) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) - return 0; - - if (lParam) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - - switch (LOWORD(wParam)) { - case IDC_CHAT_RADIO1: - case IDC_CHAT_RADIO2: - case IDC_CHAT_RADIO3: - EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_BKG), IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) == BST_CHECKED ? TRUE : FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_TEXT), IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) == BST_CHECKED ? TRUE : FALSE); - } - break; - - case WM_NOTIFY: - switch (((LPNMHDR)lParam)->idFrom) { - case 0: - switch (((LPNMHDR)lParam)->code) { - case PSN_APPLY: - int iLen; - if (IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO2) == BST_CHECKED) - iLen = 2; - else if (IsDlgButtonChecked(hwndDlg, IDC_CHAT_RADIO3) == BST_CHECKED) - iLen = 3; - else - iLen = 1; - - g_Settings.iPopupStyle = iLen; - db_set_b(0, CHAT_MODULE, "PopupStyle", (uint8_t)iLen); - - iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN1, UDM_GETPOS, 0, 0); - g_Settings.iPopupTimeout = iLen; - db_set_w(0, CHAT_MODULE, "PopupTimeout", (uint16_t)iLen); - - g_Settings.crPUBkgColour = SendDlgItemMessage(hwndDlg, IDC_CHAT_BKG, CPM_GETCOLOUR, 0, 0); - db_set_dw(0, CHAT_MODULE, "PopupColorBG", (uint32_t)SendDlgItemMessage(hwndDlg, IDC_CHAT_BKG, CPM_GETCOLOUR, 0, 0)); - g_Settings.crPUTextColour = SendDlgItemMessage(hwndDlg, IDC_CHAT_TEXT, CPM_GETCOLOUR, 0, 0); - db_set_dw(0, CHAT_MODULE, "PopupColorText", (uint32_t)SendDlgItemMessage(hwndDlg, IDC_CHAT_TEXT, CPM_GETCOLOUR, 0, 0)); - } - return TRUE; - } - break; - - case UM_CHECKSTATECHANGE: - PostMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0); - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - } - return FALSE; -} - void ChatOptInitialize(WPARAM wParam) { OPTIONSDIALOGPAGE odp = {}; @@ -647,12 +571,4 @@ void ChatOptInitialize(WPARAM wParam) odp.pfnDlgProc = DlgProcOptions2; odp.szTab.a = LPGEN("Log formatting"); g_plugin.addOptions(wParam, &odp); - - //////////////////////////////////////////////////////////////////////////////////////// - odp.position = 910000002; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPOPUP); - odp.szGroup.a = LPGEN("Popups"); - odp.szTitle.a = LPGEN("Messaging"); - odp.pfnDlgProc = DlgProcOptionsPopup; - g_plugin.addOptions(wParam, &odp); } diff --git a/plugins/Scriver/src/resource.h b/plugins/Scriver/src/resource.h index acb675f715..683af1cf41 100644 --- a/plugins/Scriver/src/resource.h +++ b/plugins/Scriver/src/resource.h @@ -38,7 +38,6 @@ #define IDD_OPTIONS1 402 #define IDD_OPTIONS2 403 #define IDD_FILTER 405 -#define IDD_OPTIONSPOPUP 406 #define IDI_BUNDERLINE 420 #define IDI_BBOLD 421 #define IDI_BITALICS 422 @@ -173,7 +172,6 @@ #define IDC_CHAT_CHECKBOXES 5021 #define IDC_CHAT_NICKROW 5024 #define IDC_CHAT_LOGLIMIT 5024 -#define IDC_CHAT_SPIN1 5028 #define IDC_CHAT_SPIN2 5029 #define IDC_CHAT_SPIN3 5030 #define IDC_CHAT_HIGHLIGHTWORDS 5040 @@ -185,12 +183,6 @@ #define IDC_CHAT_LIMIT 5050 #define IDC_CHAT_LOGTIMESTAMP 5051 #define IDC_CHAT_GROUP 5057 -#define IDC_CHAT_RADIO1 5061 -#define IDC_CHAT_RADIO2 5062 -#define IDC_CHAT_RADIO3 5063 -#define IDC_CHAT_TEXT 5064 -#define IDC_CHAT_BKG 5065 -#define IDC_CHAT_TIMEOUT 5067 #define IDC_CHAT_HIGHLIGHT 5068 #define IDC_CHAT_TEXTO 5069 #define IDC_CHAT_LOGGING 5069 -- cgit v1.2.3