diff options
author | George Hazan <ghazan@miranda.im> | 2023-01-31 14:29:13 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-01-31 14:29:13 +0300 |
commit | 910d2d08873ba04bd70f9a427beb55c31fd44a3f (patch) | |
tree | fd4639f1620210715088e8af55c568b245e91705 | |
parent | a46d8a9ee4cdcbf75aef4c508d9f03e5e4661dc1 (diff) |
fixes #3323 (Настройка статусов в ICQ и Telegram)
-rw-r--r-- | protocols/ICQ-WIM/src/options.cpp | 25 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/Telegram/src/options.cpp | 13 |
3 files changed, 19 insertions, 21 deletions
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<CIcqProto> 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<CTelegramProto>
+class CAdvOptionsDlg : public CProtoDlgBase<CTelegramProto>
{
CCtrlEdit edtDiff1, edtDiff2;
CCtrlSpin spin1, spin2;
CCtrlCombo cmbStatus1, cmbStatus2;
public:
- CIcqOptionsAdv(CTelegramProto *ppro) :
+ CAdvOptionsDlg(CTelegramProto *ppro) :
CProtoDlgBase<CTelegramProto>(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;
}
|