summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-11 17:09:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-11 17:09:17 +0300
commitb2c91edc9646daa331de71d589e4fec6bdef4945 (patch)
tree847a77d0686d26e25b126313fbaa8262c81f8d1a /protocols/JabberG
parentae081843e9663b3cb36b17309fbce1d2967315f1 (diff)
GUI change:
- methods OnInitDialog, OnApply & OnClose of CDlgBase now return true if successful. return of false prevents a dialog from being loaded or left respectively; - massive code cleaning considering the 'virtual' attribute of overridden methods; - also fixes #1476 (Don't close "Create new account" window if user not set account name)
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber_agent.cpp12
-rw-r--r--protocols/JabberG/src/jabber_bookmarks.cpp19
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp3
-rw-r--r--protocols/JabberG/src/jabber_console.cpp18
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp17
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp12
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp34
-rwxr-xr-xprotocols/JabberG/src/jabber_opt.cpp29
-rw-r--r--protocols/JabberG/src/jabber_opttree.cpp3
-rw-r--r--protocols/JabberG/src/jabber_opttree.h8
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp22
-rw-r--r--protocols/JabberG/src/jabber_svc.cpp3
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp16
13 files changed, 108 insertions, 88 deletions
diff --git a/protocols/JabberG/src/jabber_agent.cpp b/protocols/JabberG/src/jabber_agent.cpp
index 80f51ae354..ca2a996272 100644
--- a/protocols/JabberG/src/jabber_agent.cpp
+++ b/protocols/JabberG/src/jabber_agent.cpp
@@ -42,14 +42,15 @@ public:
m_ok.OnClick = Callback(this, &CAgentRegProgressDlg::OnOk);
}
- virtual void OnInitDialog()
+ bool OnInitDialog() override
{
m_proto->m_hwndRegProgress = m_hwnd;
SetWindowText(m_hwnd, TranslateT("Jabber Agent Registration"));
TranslateDialogDefault(m_hwnd);
+ return true;
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_JABBER_REGDLG_UPDATE) {
if ((wchar_t*)lParam == nullptr)
@@ -96,7 +97,7 @@ public:
m_submit.OnClick = Callback(this, &CAgentRegDlg::OnSubmit);
}
- virtual void OnInitDialog()
+ bool OnInitDialog() override
{
EnableWindow(GetParent(m_hwnd), FALSE);
m_proto->m_hwndAgentRegInput = m_hwnd;
@@ -112,9 +113,10 @@ public:
LONG_PTR frameExStyle = GetWindowLongPtr(GetDlgItem(m_hwnd, IDC_FRAME), GWL_EXSTYLE);
frameExStyle |= WS_EX_CONTROLPARENT;
SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_FRAME), GWL_EXSTYLE, frameExStyle);
+ return true;
}
- virtual void OnDestroy()
+ void OnDestroy() override
{
xmlDestroyNode(m_agentRegIqNode);
JabberFormDestroyUI(GetDlgItem(m_hwnd, IDC_FRAME));
@@ -123,7 +125,7 @@ public:
SetActiveWindow(GetParent(m_hwnd));
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
switch(msg) {
case WM_CTLCOLORSTATIC:
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp
index 1838665de4..6954dd9656 100644
--- a/protocols/JabberG/src/jabber_bookmarks.cpp
+++ b/protocols/JabberG/src/jabber_bookmarks.cpp
@@ -170,14 +170,14 @@ public:
void UpdateData();
protected:
- void OnInitDialog();
- void OnClose();
- void OnDestroy();
- int Resizer(UTILRESIZECONTROL *urc);
+ bool OnInitDialog() override;
+ bool OnClose() override;
+ void OnDestroy() override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
void OnProtoCheckOnline(WPARAM wParam, LPARAM lParam);
- void OnProtoRefresh(WPARAM wParam, LPARAM lParam);
+ void OnProtoRefresh(WPARAM, LPARAM);
void OpenBookmark();
private:
@@ -269,7 +269,7 @@ void CJabberDlgBookmarks::UpdateData()
<< XQUERY(JABBER_FEAT_PRIVATE_STORAGE) << XCHILDNS(L"storage", L"storage:bookmarks"));
}
-void CJabberDlgBookmarks::OnInitDialog()
+bool CJabberDlgBookmarks::OnInitDialog()
{
CSuper::OnInitDialog();
@@ -294,9 +294,10 @@ void CJabberDlgBookmarks::OnInitDialog()
m_lvBookmarks.AddGroup(1, TranslateT("Links"));
Utils_RestoreWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "bookmarksWnd_");
+ return true;
}
-void CJabberDlgBookmarks::OnClose()
+bool CJabberDlgBookmarks::OnClose()
{
LVCOLUMN lvc = {0};
lvc.mask = LVCF_WIDTH;
@@ -309,7 +310,7 @@ void CJabberDlgBookmarks::OnClose()
Utils_SaveWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "bookmarksWnd_");
- CSuper::OnClose();
+ return CSuper::OnClose();
}
void CJabberDlgBookmarks::OnDestroy()
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 5e9654f1ad..7220bab19c 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -712,7 +712,7 @@ public:
mir_free(m_room);
}
- void OnInitDialog()
+ bool OnInitDialog() override
{
CSuper::OnInitDialog();
@@ -724,6 +724,7 @@ public:
SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT, 0);
ResetListOptions(&m_clc);
FilterList(&m_clc);
+ return true;
}
void OnCommand_AddJid(CCtrlButton*)
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 094b4555e0..43b43e4869 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -319,12 +319,13 @@ public:
CJabberDlgConsole(CJabberProto *proto);
protected:
- void OnInitDialog();
- void OnClose();
- void OnDestroy();
+ bool OnInitDialog() override;
+ bool OnClose() override;
+ void OnDestroy() override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+
void OnProtoRefresh(WPARAM wParam, LPARAM lParam);
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
- int Resizer(UTILRESIZECONTROL *urc);
};
CJabberDlgConsole::CJabberDlgConsole(CJabberProto *proto):
@@ -332,7 +333,7 @@ CJabberDlgConsole::CJabberDlgConsole(CJabberProto *proto):
{
}
-void CJabberDlgConsole::OnInitDialog()
+bool CJabberDlgConsole::OnInitDialog()
{
CSuper::OnInitDialog();
@@ -391,9 +392,10 @@ void CJabberDlgConsole::OnInitDialog()
EnableWindow(GetDlgItem(m_hwnd, IDC_BTN_FILTER_REFRESH), (m_proto->m_filterInfo.type == TFilterInfo::T_OFF) ? FALSE : TRUE);
Utils_RestoreWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "consoleWnd_");
+ return true;
}
-void CJabberDlgConsole::OnClose()
+bool CJabberDlgConsole::OnClose()
{
m_proto->setByte("consoleWnd_msg", m_proto->m_filterInfo.msg);
m_proto->setByte("consoleWnd_presence", m_proto->m_filterInfo.presence);
@@ -403,7 +405,7 @@ void CJabberDlgConsole::OnClose()
Utils_SaveWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "consoleWnd_");
DestroyWindow(m_hwnd);
- CSuper::OnClose();
+ return CSuper::OnClose();
}
void CJabberDlgConsole::OnDestroy()
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index d1fb73b739..a9a3dbb985 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -581,11 +581,11 @@ public:
CJabberDlgDiscovery(CJabberProto *proto, wchar_t *jid);
protected:
- void OnInitDialog();
- void OnClose();
- void OnDestroy();
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
- int Resizer(UTILRESIZECONTROL *urc);
+ bool OnInitDialog() override;
+ bool OnClose() override;
+ void OnDestroy() override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
private:
wchar_t *m_jid;
@@ -628,7 +628,7 @@ CJabberDlgDiscovery::CJabberDlgDiscovery(CJabberProto *proto, wchar_t *jid) :
m_lstDiscoTree.OnFilterChanged = Callback(this, &CJabberDlgDiscovery::lstDiscoTree_OnFilter);
}
-void CJabberDlgDiscovery::OnInitDialog()
+bool CJabberDlgDiscovery::OnInitDialog()
{
CSuper::OnInitDialog();
@@ -702,9 +702,10 @@ void CJabberDlgDiscovery::OnInitDialog()
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
Utils_RestoreWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "discoWnd_");
+ return true;
}
-void CJabberDlgDiscovery::OnClose()
+bool CJabberDlgDiscovery::OnClose()
{
m_proto->setByte("discoWnd_useTree", IsDlgButtonChecked(m_hwnd, IDC_BTN_VIEWTREE));
@@ -721,7 +722,7 @@ void CJabberDlgDiscovery::OnClose()
Utils_SaveWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "discoWnd_");
DestroyWindow(m_hwnd);
- CSuper::OnClose();
+ return CSuper::OnClose();
}
void CJabberDlgDiscovery::OnDestroy()
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 4deab1e08d..392d439f51 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -392,12 +392,12 @@ public:
protected:
wchar_t *m_jid;
- void OnInitDialog();
- void OnDestroy();
+ bool OnInitDialog() override;
+ void OnDestroy();
void OnBtnOk(CCtrlButton*);
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
};
CJabberDlgGcJoin::CJabberDlgGcJoin(CJabberProto *proto, wchar_t *jid) :
@@ -413,7 +413,7 @@ CJabberDlgGcJoin::~CJabberDlgGcJoin()
mir_free(m_jid);
}
-void CJabberDlgGcJoin::OnInitDialog()
+bool CJabberDlgGcJoin::OnInitDialog()
{
CSuper::OnInitDialog();
@@ -475,6 +475,7 @@ void CJabberDlgGcJoin::OnInitDialog()
SetDlgItemText(m_hwnd, IDC_RECENT1 + i, jid);
}
sttJoinDlgShowRecentItems(m_hwnd, i);
+ return true;
}
void CJabberDlgGcJoin::OnDestroy()
@@ -1147,7 +1148,7 @@ public:
m_accept.OnClick = Callback(this, &CGroupchatInviteAcceptDlg::OnCommand_Accept);
}
- void OnInitDialog()
+ bool OnInitDialog() override
{
CSuper::OnInitDialog();
@@ -1162,6 +1163,7 @@ public:
Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP));
SetFocus(GetDlgItem(m_hwnd, IDC_NICK));
+ return true;
}
void OnCommand_Accept(CCtrlButton*)
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index 7441b8f669..090709feb3 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -172,8 +172,8 @@ public:
CJabberDlgNoteItem(CJabberProto *proto, CNoteItem *pNote, TFnProcessNote fnProcess);
protected:
- void OnInitDialog();
- int Resizer(UTILRESIZECONTROL *urc);
+ bool OnInitDialog() override;
+ int Resizer(UTILRESIZECONTROL *urc);
private:
CNoteItem *m_pNote;
@@ -201,10 +201,11 @@ private:
EndDialog(m_hwnd, TRUE);
}
- void OnClose()
+ bool OnClose() override
{
- if (m_fnProcess) (m_proto->*m_fnProcess)(m_pNote, false);
- CSuper::OnClose();
+ if (m_fnProcess)
+ (m_proto->*m_fnProcess)(m_pNote, false);
+ return CSuper::OnClose();
}
};
@@ -233,7 +234,7 @@ CJabberDlgNoteItem::CJabberDlgNoteItem(CJabberProto *proto, CNoteItem *pNote, TF
m_btnOk.OnClick = Callback(this, &CJabberDlgNoteItem::btnOk_OnClick);
}
-void CJabberDlgNoteItem::OnInitDialog()
+bool CJabberDlgNoteItem::OnInitDialog()
{
CSuper::OnInitDialog();
Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_NOTES));
@@ -251,6 +252,7 @@ void CJabberDlgNoteItem::OnInitDialog()
m_txtTitle.SetText(m_pNote->GetTitle());
m_txtText.SetText(m_pNote->GetText());
m_txtTags.SetText(m_pNote->GetTagsStr());
+ return true;
}
int CJabberDlgNoteItem::Resizer(UTILRESIZECONTROL *urc)
@@ -440,8 +442,8 @@ public:
void UpdateData();
protected:
- void OnInitDialog();
- void OnClose();
+ bool OnInitDialog() override;
+ bool OnClose() override;
void OnDestroy();
int Resizer(UTILRESIZECONTROL *urc);
@@ -635,7 +637,7 @@ void CJabberDlgNotes::UpdateData()
EnableControls();
}
-void CJabberDlgNotes::OnInitDialog()
+bool CJabberDlgNotes::OnInitDialog()
{
CSuper::OnInitDialog();
Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_NOTES));
@@ -650,21 +652,19 @@ void CJabberDlgNotes::OnInitDialog()
m_lstNotes.SetFonts(m_hfntNormal, m_hfntSmall, m_hfntBold);
Utils_RestoreWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "notesWnd_");
+ return true;
}
-void CJabberDlgNotes::OnClose()
+bool CJabberDlgNotes::OnClose()
{
- if (m_proto->m_notes.IsModified()) {
- if (IDYES != MessageBox(m_hwnd, TranslateT("Notes are not saved, close this window without uploading data to server?"), TranslateT("Are you sure?"), MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2)) {
- m_lresult = TRUE;
- return;
- }
- }
+ if (m_proto->m_notes.IsModified())
+ if (IDYES != MessageBox(m_hwnd, TranslateT("Notes are not saved, close this window without uploading data to server?"), TranslateT("Are you sure?"), MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2))
+ return false;
Utils_SaveWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "notesWnd_");
DeleteObject(m_hfntSmall);
DeleteObject(m_hfntBold);
- CSuper::OnClose();
+ return CSuper::OnClose();
}
void CJabberDlgNotes::OnDestroy()
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 0044594f56..47f6f7f8f8 100755
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -240,14 +240,15 @@ public:
}
protected:
- void OnInitDialog()
+ bool OnInitDialog() override
{
wchar_t text[256];
mir_snwprintf(text, STR_FORMAT, TranslateT("Register"), m_regInfo->username, m_regInfo->server, m_regInfo->port);
SetDlgItemText(m_hwnd, IDC_REG_STATUS, text);
+ return true;
}
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
switch (msg) {
case WM_JABBER_REGDLG_UPDATE: // wParam=progress (0-100), lparam=status string
@@ -288,8 +289,6 @@ private:
m_btnOk.SetText(TranslateT("Cancel"));
m_bProcessStarted = true;
-
- m_lresult = TRUE;
}
};
@@ -419,7 +418,7 @@ public:
}
protected:
- void OnInitDialog()
+ bool OnInitDialog() override
{
CSuper::OnInitDialog();
@@ -475,9 +474,10 @@ protected:
chkUseDomainLogin_OnChange(&m_chkUseDomainLogin);
CheckRegistration();
+ return true;
}
- void OnApply()
+ bool OnApply() override
{
// clear saved password
m_proto->m_savedPassword = nullptr;
@@ -511,6 +511,7 @@ protected:
m_proto->SendPresence(m_proto->m_iStatus, true);
}
+ return true;
}
void OnChange(CCtrlBase*)
@@ -519,7 +520,7 @@ protected:
CheckRegistration();
}
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
switch (msg) {
case WM_ACTIVATE:
@@ -815,15 +816,16 @@ public:
m_otvOptions.AddOption(LPGENW("Security") L"/" LPGENW("Use OMEMO encryption for messages if possible (XEP-0384) (Basic support without GUI)"), m_proto->m_bUseOMEMO);
}
- void OnInitDialog()
+ bool OnInitDialog() override
{
CSuper::OnInitDialog();
chkDirect_OnChange(&m_chkDirect);
chkProxy_OnChange(&m_chkProxy);
+ return true;
}
- void OnApply()
+ bool OnApply() override
{
if (m_proto->m_bDisableFrame != m_oldFrameValue) {
m_proto->InitInfoFrame(); // create or destroy a frame
@@ -855,6 +857,7 @@ public:
m_proto->m_omemo.deinit();
m_proto->m_clientCapsManager.UpdateFeatHash();
m_proto->SendPresence(m_proto->m_iStatus, true);
+ return true;
}
void chkDirect_OnChange(CCtrlData *)
@@ -1570,7 +1573,7 @@ public:
protected:
enum { ACC_PUBLIC, ACC_TLS, ACC_SSL, ACC_GTALK, ACC_HIPCHAT, ACC_LJTALK, ACC_LOL_EN, ACC_LOL_EW, ACC_LOL_OC, ACC_LOL_US, ACC_OK, ACC_SMS };
- void OnInitDialog()
+ bool OnInitDialog() override
{
CSuper::OnInitDialog();
@@ -1703,9 +1706,10 @@ protected:
chkUseDomainLogin_OnChange(&m_chkUseDomainLogin);
CheckRegistration();
+ return true;
}
- void OnApply()
+ bool OnApply() override
{
// clear saved password
m_proto->m_savedPassword = nullptr;
@@ -1806,6 +1810,7 @@ protected:
m_proto->SendPresence(m_proto->m_iStatus, true);
}
+ return true;
}
void OnChange(CCtrlBase*)
@@ -1814,7 +1819,7 @@ protected:
CheckRegistration();
}
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
switch (msg) {
case WM_JABBER_REFRESH:
diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp
index d4b0bfca13..3c442be1ad 100644
--- a/protocols/JabberG/src/jabber_opttree.cpp
+++ b/protocols/JabberG/src/jabber_opttree.cpp
@@ -171,7 +171,7 @@ void CCtrlTreeOpts::OnDestroy()
ImageList_Destroy(GetImageList(TVSIL_NORMAL));
}
-void CCtrlTreeOpts::OnApply()
+bool CCtrlTreeOpts::OnApply()
{
CCtrlTreeView::OnApply();
@@ -180,6 +180,7 @@ void CCtrlTreeOpts::OnApply()
GetItem(it->m_hItem, &tvi);
*it->m_option = ((tvi.iImage == IMG_CHECK) || (tvi.iImage == IMG_RCHECK)) ? 1 : 0;
}
+ return true;
}
void CCtrlTreeOpts::ProcessItemClick(HTREEITEM hti)
diff --git a/protocols/JabberG/src/jabber_opttree.h b/protocols/JabberG/src/jabber_opttree.h
index 9d2aa9e763..79d119158f 100644
--- a/protocols/JabberG/src/jabber_opttree.h
+++ b/protocols/JabberG/src/jabber_opttree.h
@@ -39,10 +39,10 @@ public:
void AddOption(wchar_t *szOption, CMOption<BYTE> &option);
- BOOL OnNotify(int idCtrl, NMHDR *pnmh);
- void OnDestroy();
- void OnInit();
- void OnApply();
+ BOOL OnNotify(int idCtrl, NMHDR *pnmh) override;
+ void OnDestroy() override;
+ void OnInit() override;
+ bool OnApply() override;
protected:
struct COptionsItem
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index f6645bf2e3..c7a7325a95 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -356,7 +356,7 @@ public:
m_btnCancel.OnClick = Callback(this, &CJabberDlgPrivacyRule::btnCancel_OnClick);
}
- virtual void OnInitDialog()
+ bool OnInitDialog() override
{
CSuper::OnInitDialog();
@@ -404,6 +404,7 @@ public:
if (m_pRule->GetValue() && (m_pRule->GetType() == Jid || m_pRule->GetType() == Group))
SetDlgItemText(m_hwnd, IDC_EDIT_VALUE, m_pRule->GetValue());
+ return true;
}
void cbType_OnChange(CCtrlData*)
@@ -566,8 +567,8 @@ protected:
static int idSimpleControls[];
static int idAdvancedControls[];
- void OnInitDialog();
- void OnClose();
+ bool OnInitDialog() override;
+ bool OnClose() override;
void OnDestroy();
void OnProtoRefresh(WPARAM, LPARAM);
int Resizer(UTILRESIZECONTROL *urc);
@@ -756,7 +757,7 @@ CJabberDlgPrivacyLists::CJabberDlgPrivacyLists(CJabberProto *proto):
m_clcClist.OnClick = Callback(this, &CJabberDlgPrivacyLists::clcClist_OnClick);
}
-void CJabberDlgPrivacyLists::OnInitDialog()
+bool CJabberDlgPrivacyLists::OnInitDialog()
{
CSuper::OnInitDialog();
@@ -833,15 +834,16 @@ void CJabberDlgPrivacyLists::OnInitDialog()
SetStatusText(TranslateT("Loading..."));
Utils_RestoreWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "plistsWnd_sz");
+ return true;
}
-void CJabberDlgPrivacyLists::OnClose()
+bool CJabberDlgPrivacyLists::OnClose()
{
- if (CanExit()) {
- DestroyWindow(m_hwnd);
- CSuper::OnClose();
- }
- else m_lresult = TRUE;
+ if (!CanExit())
+ return false;
+
+ DestroyWindow(m_hwnd);
+ return CSuper::OnClose();
}
void CJabberDlgPrivacyLists::OnDestroy()
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp
index 928ff04025..4dc4ed5ce1 100644
--- a/protocols/JabberG/src/jabber_svc.cpp
+++ b/protocols/JabberG/src/jabber_svc.cpp
@@ -579,7 +579,7 @@ public:
m_btnDeny.OnClick = Callback(this, &CJabberDlgHttpAuth::btnDeny_OnClick);
}
- void OnInitDialog()
+ bool OnInitDialog() override
{
CSuper::OnInitDialog();
@@ -589,6 +589,7 @@ public:
SetDlgItemText(m_hwnd, IDC_TXT_FROM, m_pParams->m_szFrom);
SetDlgItemText(m_hwnd, IDC_TXT_ID, m_pParams->m_szId);
SetDlgItemText(m_hwnd, IDC_TXT_METHOD, m_pParams->m_szMethod);
+ return true;
}
BOOL SendReply(BOOL bAuthorized)
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index 1825a3714d..5ff0f13e07 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -43,9 +43,9 @@ protected:
CCtrlButton m_btnOk;
CCtrlButton m_btnCancel;
- void OnInitDialog();
- int Resizer(UTILRESIZECONTROL *urc);
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
+ bool OnInitDialog() override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
void StopTimer();
@@ -61,7 +61,7 @@ CJabberDlgPepBase::CJabberDlgPepBase(CJabberProto *proto, int id) :
{
}
-void CJabberDlgPepBase::OnInitDialog()
+bool CJabberDlgPepBase::OnInitDialog()
{
CSuper::OnInitDialog();
@@ -70,6 +70,7 @@ void CJabberDlgPepBase::OnInitDialog()
wchar_t buf[128];
mir_snwprintf(buf, TranslateT("OK (%d)"), m_time);
m_btnOk.SetText(buf);
+ return true;
}
int CJabberDlgPepBase::Resizer(UTILRESIZECONTROL *urc)
@@ -132,8 +133,8 @@ protected:
CCtrlCombo m_cbModes;
CCtrlEdit m_txtDescription;
- void OnInitDialog();
- int Resizer(UTILRESIZECONTROL *urc);
+ bool OnInitDialog() override;
+ int Resizer(UTILRESIZECONTROL *urc);
UI_MESSAGE_MAP(CJabberDlgPepSimple, CSuper);
UI_MESSAGE(WM_MEASUREITEM, OnWmMeasureItem);
@@ -220,7 +221,7 @@ wchar_t* CJabberDlgPepSimple::GetStatusText()
return m_text;
}
-void CJabberDlgPepSimple::OnInitDialog()
+bool CJabberDlgPepSimple::OnInitDialog()
{
CSuper::OnInitDialog();
@@ -240,6 +241,7 @@ void CJabberDlgPepSimple::OnInitDialog()
if (m_activeText)
m_txtDescription.SetText(m_activeText);
+ return true;
}
int CJabberDlgPepSimple::Resizer(UTILRESIZECONTROL *urc)