summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_opt.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-26 19:24:14 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-26 19:24:14 +0300
commit0fc0c03f8176b13f0596e90bb3832040cf46c9af (patch)
tree4454b334200c006c5ac5a61eb203bb81be01068b /protocols/JabberG/src/jabber_opt.cpp
parente5f16d2ad58fb8a5571c5c24603256adf506fd48 (diff)
WM_JABBER_REGDLG_UPDATE - unused message removed
Diffstat (limited to 'protocols/JabberG/src/jabber_opt.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_opt.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 4a273b5168..15cba2df5b 100755
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -257,7 +257,7 @@ public:
ShowWindow(GetDlgItem(m_hwnd, IDC_PROGRESS_REG), SW_SHOW);
- m_regInfo->reg_hwndDlg = m_hwnd;
+ m_regInfo->pDlg = this;
m_proto->ForkThread((CJabberProto::MyThreadFunc) & CJabberProto::ServerThread, m_regInfo);
m_btnOk.SetText(TranslateT("Cancel"));
@@ -265,28 +265,29 @@ public:
return false;
}
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ void OnDestroy() override
{
- switch (msg) {
- case WM_JABBER_REGDLG_UPDATE: // wParam=progress (0-100), lparam=status string
- if ((wchar_t*)lParam == nullptr)
- SetDlgItemTextW(m_hwnd, IDC_REG_STATUS, TranslateT("No message"));
- else
- SetDlgItemTextW(m_hwnd, IDC_REG_STATUS, (wchar_t*)lParam);
-
- SendDlgItemMessage(m_hwnd, IDC_PROGRESS_REG, PBM_SETPOS, wParam, 0);
- if (wParam >= 100)
- m_btnOk.SetText(TranslateT("Close"));
- else
- SetFocus(GetDlgItem(m_hwnd, IDC_PROGRESS_REG));
+ m_regInfo->pDlg = nullptr;
+ }
- return TRUE;
- }
+ void Update(int progress, const wchar_t *pwszText)
+ {
+ SetDlgItemTextW(m_hwnd, IDC_REG_STATUS, pwszText);
+ SendDlgItemMessageW(m_hwnd, IDC_PROGRESS_REG, PBM_SETPOS, progress, 0);
- return CSuper::DlgProc(msg, wParam, lParam);
+ if (progress >= 100)
+ m_btnOk.SetText(TranslateT("Close"));
+ else
+ SetFocus(GetDlgItem(m_hwnd, IDC_PROGRESS_REG));
}
};
+void JABBER_CONN_DATA::SetProgress(int progress, const wchar_t *pwszText)
+{
+ if (pDlg)
+ pDlg->Update(progress, pwszText);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// JabberOptDlgProc - main options dialog procedure