From 910d2d08873ba04bd70f9a427beb55c31fd44a3f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 31 Jan 2023 14:29:13 +0300 Subject: =?UTF-8?q?fixes=20#3323=20(=D0=9D=D0=B0=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B9=D0=BA=D0=B0=20=D1=81=D1=82=D0=B0=D1=82=D1=83=D1=81=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=B2=20ICQ=20=D0=B8=20Telegram)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/ICQ-WIM/src/options.cpp | 25 ++++++++++++------------- protocols/ICQ-WIM/src/proto.h | 2 +- protocols/Telegram/src/options.cpp | 13 ++++++------- 3 files changed, 19 insertions(+), 21 deletions(-) (limited to 'protocols') diff --git a/protocols/ICQ-WIM/src/options.cpp b/protocols/ICQ-WIM/src/options.cpp index 2de6641efc..5f9d9ce5db 100644 --- a/protocols/ICQ-WIM/src/options.cpp +++ b/protocols/ICQ-WIM/src/options.cpp @@ -213,7 +213,7 @@ void CIcqProto::OnLoginViaPhone(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pRe ///////////////////////////////////////////////////////////////////////////////////////// -class CIcqOptionsDlg : public CIcqDlgBase +class COptionsDlg : public CIcqDlgBase { CCtrlEdit edtUin, edtPassword; CCtrlCheck chkHideChats, chkTrayIcon, chkLaunchMailbox, chkShowErrorPopups; @@ -221,7 +221,7 @@ class CIcqOptionsDlg : public CIcqDlgBase CMStringW wszOldPass; public: - CIcqOptionsDlg(CIcqProto *ppro, int iDlgID, bool bFullDlg) : + COptionsDlg(CIcqProto *ppro, int iDlgID, bool bFullDlg) : CIcqDlgBase(ppro, iDlgID), edtUin(this, IDC_UIN), btnCreate(this, IDC_REGISTER), @@ -231,7 +231,7 @@ public: chkLaunchMailbox(this, IDC_LAUNCH_MAILBOX), chkShowErrorPopups(this, IDC_SHOWERRORPOPUPS) { - btnCreate.OnClick = Callback(this, &CIcqOptionsDlg::onClick_Register); + btnCreate.OnClick = Callback(this, &COptionsDlg::onClick_Register); CreateLink(edtUin, ppro->m_szOwnId); if (bFullDlg) { @@ -240,7 +240,7 @@ public: CreateLink(chkLaunchMailbox, ppro->m_bLaunchMailbox); CreateLink(chkShowErrorPopups, ppro->m_bErrorPopups); - chkTrayIcon.OnChange = Callback(this, &CIcqOptionsDlg::onChange_Tray); + chkTrayIcon.OnChange = Callback(this, &COptionsDlg::onChange_Tray); } } @@ -296,14 +296,14 @@ public: ///////////////////////////////////////////////////////////////////////////////////////// // Advanced options -class CIcqOptionsAdv : public CIcqDlgBase +class CAdvOptionsDlg : public CIcqDlgBase { CCtrlEdit edtDiff1, edtDiff2; CCtrlSpin spin1, spin2; CCtrlCombo cmbStatus1, cmbStatus2; public: - CIcqOptionsAdv(CIcqProto *ppro) : + CAdvOptionsDlg(CIcqProto *ppro) : CIcqDlgBase(ppro, IDD_OPTIONS_ADV), spin1(this, IDC_SPIN1, 32000), spin2(this, IDC_SPIN2, 32000), @@ -312,8 +312,8 @@ public: cmbStatus1(this, IDC_STATUS1), cmbStatus2(this, IDC_STATUS2) { - edtDiff1.OnChange = Callback(this, &CIcqOptionsAdv::onChange_Timeout1); - edtDiff2.OnChange = Callback(this, &CIcqOptionsAdv::onChange_Timeout2); + edtDiff1.OnChange = Callback(this, &CAdvOptionsDlg::onChange_Timeout1); + edtDiff2.OnChange = Callback(this, &CAdvOptionsDlg::onChange_Timeout2); CreateLink(spin1, ppro->m_iTimeDiff1); CreateLink(spin2, ppro->m_iTimeDiff2); @@ -359,8 +359,7 @@ public: void onChange_Timeout2(CCtrlEdit*) { - bool bEnabled = edtDiff2.GetInt() != 0; - cmbStatus2.Enable(bEnabled); + cmbStatus2.Enable(edtDiff1.GetInt() != 0 && edtDiff2.GetInt() != 0); } }; @@ -369,7 +368,7 @@ public: INT_PTR CIcqProto::CreateAccMgrUI(WPARAM, LPARAM hwndParent) { - CIcqOptionsDlg *pDlg = new CIcqOptionsDlg(this, IDD_OPTIONS_ACCMGR, false); + COptionsDlg *pDlg = new COptionsDlg(this, IDD_OPTIONS_ACCMGR, false); pDlg->SetParent((HWND)hwndParent); pDlg->Create(); return (INT_PTR)pDlg->GetHwnd(); @@ -384,11 +383,11 @@ int CIcqProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.position = 1; odp.szTab.w = LPGENW("General"); - odp.pDialog = new CIcqOptionsDlg(this, IDD_OPTIONS_FULL, true); + odp.pDialog = new COptionsDlg(this, IDD_OPTIONS_FULL, true); g_plugin.addOptions(wParam, &odp); odp.szTab.w = LPGENW("Advanced"); - odp.pDialog = new CIcqOptionsAdv(this); + odp.pDialog = new CAdvOptionsDlg(this); g_plugin.addOptions(wParam, &odp); return 0; } diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index 20636cc4c6..240d702ba4 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -245,8 +245,8 @@ class CIcqProto : public PROTO friend struct CIcqRegistrationDlg; friend class CGroupchatInviteDlg; friend class CEditIgnoreListDlg; + friend class COptionsDlg; friend class CIcqEnterLoginDlg; - friend class CIcqOptionsDlg; friend class CGroupEditDlg; friend AsyncHttpRequest* operator <<(AsyncHttpRequest*, const AIMSID&); diff --git a/protocols/Telegram/src/options.cpp b/protocols/Telegram/src/options.cpp index af8c0c2545..9986ba7c45 100644 --- a/protocols/Telegram/src/options.cpp +++ b/protocols/Telegram/src/options.cpp @@ -60,14 +60,14 @@ public: ///////////////////////////////////////////////////////////////////////////////////////// // Advanced options -class CIcqOptionsAdv : public CProtoDlgBase +class CAdvOptionsDlg : public CProtoDlgBase { CCtrlEdit edtDiff1, edtDiff2; CCtrlSpin spin1, spin2; CCtrlCombo cmbStatus1, cmbStatus2; public: - CIcqOptionsAdv(CTelegramProto *ppro) : + CAdvOptionsDlg(CTelegramProto *ppro) : CProtoDlgBase(ppro, IDD_OPTIONS_ADV), spin1(this, IDC_SPIN1, 32000), spin2(this, IDC_SPIN2, 32000), @@ -76,8 +76,8 @@ public: cmbStatus1(this, IDC_STATUS1), cmbStatus2(this, IDC_STATUS2) { - edtDiff1.OnChange = Callback(this, &CIcqOptionsAdv::onChange_Timeout1); - edtDiff2.OnChange = Callback(this, &CIcqOptionsAdv::onChange_Timeout2); + edtDiff1.OnChange = Callback(this, &CAdvOptionsDlg::onChange_Timeout1); + edtDiff2.OnChange = Callback(this, &CAdvOptionsDlg::onChange_Timeout2); CreateLink(spin1, ppro->m_iTimeDiff1); CreateLink(spin2, ppro->m_iTimeDiff2); @@ -123,8 +123,7 @@ public: void onChange_Timeout2(CCtrlEdit *) { - bool bEnabled = edtDiff2.GetInt() != 0; - cmbStatus2.Enable(bEnabled); + cmbStatus2.Enable(edtDiff1.GetInt() != 0 && edtDiff2.GetInt() != 0); } }; @@ -152,7 +151,7 @@ int CTelegramProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.position = 2; odp.szTab.w = LPGENW("Advanced"); - odp.pDialog = new CIcqOptionsAdv(this); + odp.pDialog = new CAdvOptionsDlg(this); g_plugin.addOptions(wParam, &odp); return 0; } -- cgit v1.2.3