diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-11 17:09:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-11 17:09:17 +0300 |
commit | b2c91edc9646daa331de71d589e4fec6bdef4945 (patch) | |
tree | 847a77d0686d26e25b126313fbaa8262c81f8d1a | |
parent | ae081843e9663b3cb36b17309fbce1d2967315f1 (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)
123 files changed, 1327 insertions, 1021 deletions
diff --git a/include/m_chat_int.h b/include/m_chat_int.h index 5ad09897a2..033d5d36da 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -405,10 +405,10 @@ class MIR_APP_EXPORT CSrmmBaseDialog : public CDlgBase protected:
CSrmmBaseDialog(CMPluginBase&, int idDialog, SESSION_INFO *si = nullptr);
- virtual void OnInitDialog() override;
- virtual void OnDestroy() override;
+ bool OnInitDialog() override;
+ void OnDestroy() override;
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
int NotifyEvent(int code);
bool ProcessHotkeys(int key, bool bShift, bool bCtrl, bool bAlt);
diff --git a/include/m_gui.h b/include/m_gui.h index bdabf4d323..98b09786ee 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -412,7 +412,6 @@ public: void SetCaption(const wchar_t *ptszCaption);
void NotifyChange(void); // sends a notification to a parent window
- __forceinline void Fail() { m_lresult = false; }
__forceinline HINSTANCE GetInst() const { return m_pPlugin.getInst(); }
__forceinline HWND GetHwnd() const { return m_hwnd; }
__forceinline void Hide() { Show(SW_HIDE); }
@@ -424,14 +423,13 @@ public: static CDlgBase* Find(HWND hwnd);
protected:
- HWND m_hwnd; // must be the first data item
- HWND m_hwndParent;
+ HWND m_hwnd = nullptr; // must be the first data item
+ HWND m_hwndParent = nullptr;
int m_idDialog;
- bool m_isModal;
- bool m_initialized;
- bool m_forceResizable;
- bool m_bExiting; // window received WM_CLOSE and gonna die soon
- LRESULT m_lresult;
+ bool m_isModal = false;
+ bool m_initialized = false;
+ bool m_forceResizable = false;
+ bool m_bExiting = false; // window received WM_CLOSE and gonna die soon
CMPluginBase &m_pPlugin;
@@ -440,17 +438,17 @@ protected: // override this handlers to provide custom functionality
// general messages
- virtual void OnInitDialog() { }
- virtual void OnClose() { }
- virtual void OnDestroy() { }
+ virtual bool OnInitDialog();
+ virtual bool OnApply();
+ virtual bool OnClose();
+ virtual void OnDestroy();
- virtual void OnTimer(CTimer*) {}
+ virtual void OnTimer(CTimer*);
// miranda-related stuff
virtual int Resizer(UTILRESIZECONTROL *urc);
- virtual void OnApply() {}
- virtual void OnReset() {}
- virtual void OnChange() {}
+ virtual void OnReset();
+ virtual void OnChange();
// main dialog procedure
virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
@@ -479,6 +477,7 @@ private: LIST<CCtrlBase> m_controls;
void NotifyControls(void (CCtrlBase::*fn)());
+ bool VerifyControls(bool (CCtrlBase::*fn)());
CTimer* FindTimer(int idEvent);
@@ -567,7 +566,7 @@ public: virtual void OnInit();
virtual void OnDestroy();
- virtual void OnApply();
+ virtual bool OnApply();
virtual void OnReset();
protected:
@@ -819,7 +818,7 @@ public: CCtrlCheck(CDlgBase *dlg, int ctrlId);
BOOL OnCommand(HWND /*hwndCtrl*/, WORD /*idCtrl*/, WORD /*idCode*/) override;
- void OnApply() override;
+ bool OnApply() override;
void OnReset() override;
int GetState();
@@ -839,7 +838,7 @@ public: CCtrlEdit(CDlgBase *dlg, int ctrlId);
BOOL OnCommand(HWND /*hwndCtrl*/, WORD /*idCtrl*/, WORD idCode) override;
- void OnApply() override;
+ bool OnApply() override;
void OnReset() override;
void SetMaxLength(unsigned int len);
@@ -882,7 +881,7 @@ class MIR_CORE_EXPORT CCtrlSpin : public CCtrlData public:
CCtrlSpin(CDlgBase *dlg, int ctrlId);
- void OnApply() override;
+ bool OnApply() override;
void OnReset() override;
WORD GetPosition();
@@ -942,7 +941,7 @@ public: BOOL OnCommand(HWND /*hwndCtrl*/, WORD /*idCtrl*/, WORD idCode) override;
void OnInit() override;
- void OnApply() override;
+ bool OnApply() override;
void OnReset() override;
// Control interface
@@ -1354,7 +1353,7 @@ protected: void OnInit() override;
void OnDestroy() override;
- void OnApply() override;
+ bool OnApply() override;
void OnReset() override;
LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex bcd629962d..1c9d529885 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib Binary files differindex ecd84ff58c..262b02be2b 100644 --- a/libs/win32/mir_core.lib +++ b/libs/win32/mir_core.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex b7c6951225..64bd2e8693 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib Binary files differindex d0f9ce3e66..c4aa6435b0 100644 --- a/libs/win64/mir_core.lib +++ b/libs/win64/mir_core.lib diff --git a/plugins/AuthState/src/options.h b/plugins/AuthState/src/options.h index 9621036a31..07b0a45af8 100644 --- a/plugins/AuthState/src/options.h +++ b/plugins/AuthState/src/options.h @@ -38,9 +38,10 @@ public: CreateLink(m_chkOnlyForRecent, Options.bIconsForRecentContacts);
}
- void OnApply() override
+ bool OnApply() override
{
for (auto &hContact : Contacts())
onExtraImageApplying((WPARAM)hContact, 0);
+ return true;
}
};
\ No newline at end of file diff --git a/plugins/CloudFile/src/oauth.cpp b/plugins/CloudFile/src/oauth.cpp index abda807772..e62629fcd8 100644 --- a/plugins/CloudFile/src/oauth.cpp +++ b/plugins/CloudFile/src/oauth.cpp @@ -11,13 +11,14 @@ COAuthDlg::COAuthDlg(CCloudService *service, const char *authUrl, CCloudService: m_ok.OnClick = Callback(this, &COAuthDlg::Ok_OnClick); } -void COAuthDlg::OnInitDialog() +bool COAuthDlg::OnInitDialog() { CCtrlLabel &ctrl = *(CCtrlLabel*)FindControl(IDC_AUTH_TEXT); ptrW format(ctrl.GetText()); wchar_t text[MAX_PATH]; mir_snwprintf(text, (const wchar_t*)format, m_service->GetUserName()); ctrl.SetText(text); + return true; } void COAuthDlg::Code_OnChange(CCtrlBase*) diff --git a/plugins/CloudFile/src/oauth.h b/plugins/CloudFile/src/oauth.h index 7c71cf005c..2b32ecbd9b 100644 --- a/plugins/CloudFile/src/oauth.h +++ b/plugins/CloudFile/src/oauth.h @@ -11,7 +11,7 @@ class COAuthDlg : public CDlgBase CCtrlButton m_ok; protected: - void OnInitDialog() override; + bool OnInitDialog() override; void Code_OnChange(CCtrlBase*); void Ok_OnClick(CCtrlButton*); diff --git a/plugins/CloudFile/src/options.cpp b/plugins/CloudFile/src/options.cpp index df6563b99c..ee3aaec11e 100644 --- a/plugins/CloudFile/src/options.cpp +++ b/plugins/CloudFile/src/options.cpp @@ -17,7 +17,7 @@ COptionsMainDlg::COptionsMainDlg() CreateLink(m_urlCopyToClipboard, "UrlCopyToClipboard", DBVT_BYTE, 0); } -void COptionsMainDlg::OnInitDialog() +bool COptionsMainDlg::OnInitDialog() { CDlgBase::OnInitDialog(); @@ -50,9 +50,10 @@ void COptionsMainDlg::OnInitDialog() m_doNothingOnConflict.SetState(TRUE); break; } + return true; } -void COptionsMainDlg::OnApply() +bool COptionsMainDlg::OnApply() { int iItem = m_defaultService.GetCurSel(); CCloudService *service = (CCloudService*)m_defaultService.GetItemData(iItem); @@ -67,6 +68,7 @@ void COptionsMainDlg::OnApply() db_set_b(NULL, MODULENAME, "ConflictStrategy", OnConflict::REPLACE); else db_unset(NULL, MODULENAME, "ConflictStrategy"); + return true; } ///////////////////////////////////////////////////////////////////////////////// @@ -96,11 +98,12 @@ CAccountManagerDlg::CAccountManagerDlg(CCloudService *service) m_revokeAccess.OnClick = Callback(this, &CAccountManagerDlg::RevokeAccess_OnClick); } -void CAccountManagerDlg::OnInitDialog() +bool CAccountManagerDlg::OnInitDialog() { ptrA token(m_proto->getStringA("TokenSecret")); m_requestAccess.Enable(!token); m_revokeAccess.Enable(token); + return true; } void CAccountManagerDlg::RequestAccess_OnClick(CCtrlButton*) diff --git a/plugins/CloudFile/src/options.h b/plugins/CloudFile/src/options.h index 30f6600f68..aaf1440def 100644 --- a/plugins/CloudFile/src/options.h +++ b/plugins/CloudFile/src/options.h @@ -15,8 +15,8 @@ private: CCtrlCheck m_urlCopyToClipboard; protected: - void OnInitDialog(); - void OnApply(); + bool OnInitDialog() override; + bool OnApply() override; public: COptionsMainDlg(); @@ -31,7 +31,7 @@ private: CCtrlButton m_revokeAccess; protected: - void OnInitDialog(); + bool OnInitDialog() override; void RequestAccess_OnClick(CCtrlButton*); void RevokeAccess_OnClick(CCtrlButton*); diff --git a/plugins/Db3x_mmap/src/ui.h b/plugins/Db3x_mmap/src/ui.h index 09e27961f8..83d7d3dbb4 100644 --- a/plugins/Db3x_mmap/src/ui.h +++ b/plugins/Db3x_mmap/src/ui.h @@ -19,7 +19,7 @@ public: m_combo.OnChange = Callback(this, &CSelectCryptoDialog::OnComboChanged);
}
- void OnInitDialog()
+ bool OnInitDialog() override
{
for (size_t i = 0; i < m_provscount; i++)
{
@@ -28,11 +28,13 @@ public: }
m_combo.SetCurSel(0);
SetDescr(m_provs[0]);
+ return true;
}
- void OnClose()
+ bool OnClose() override
{
m_selected = m_provs[ m_combo.GetItemData(m_combo.GetCurSel()) ];
+ return true;
}
void OnComboChanged(CCtrlCombo*)
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index 424c8961e1..a795f06e30 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -172,7 +172,7 @@ public: m_foldersPageLink.OnClick = Callback(this, &COptionsDlg::FoldersPageLink_OnClick);
}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
m_disable.SetState(options.backup_types == BT_DISABLED);
m_backupOnStart.SetState(options.backup_types & BT_START ? TRUE : FALSE);
@@ -220,9 +220,10 @@ public: }
SetDialogState();
+ return true;
}
- void OnApply() override
+ bool OnApply() override
{
BYTE backupTypes = BT_DISABLED;
@@ -256,7 +257,7 @@ public: wchar_t msg[512];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, err, 0, msg, 512, nullptr);
MessageBox(nullptr, msg, TranslateT("Error creating backup folder"), MB_OK | MB_ICONERROR);
- return;
+ return false;
}
wcsncpy_s(options.folder, folder, _TRUNCATE);
@@ -266,6 +267,7 @@ public: options.cloudfile_service = currentService >= 0
? (char*)m_cloudFileService.GetItemData(currentService)
: nullptr;
+ return true;
}
void OnTimer(CTimer*) override
diff --git a/plugins/Dbx_mdbx/src/ui.h b/plugins/Dbx_mdbx/src/ui.h index 29eed1c792..8ed9c0b1c3 100644 --- a/plugins/Dbx_mdbx/src/ui.h +++ b/plugins/Dbx_mdbx/src/ui.h @@ -17,20 +17,22 @@ class COptionsDialog : public CDlgBase CCtrlButton m_btnChangePass;
CDbxMDBX *m_db;
- void OnInitDialog()
+ bool OnInitDialog() override
{
m_chkStandart.SetState(!m_db->isEncrypted());
m_chkTotal.SetState(m_db->isEncrypted());
m_btnChangePass.SetTextA(Translate(m_db->GetMenuTitle()));
+ return true;
}
- void OnApply()
+ bool OnApply() override
{
SetCursor(LoadCursor(nullptr, IDC_WAIT));
m_db->EnableEncryption(m_chkTotal.GetState() != 0);
SetCursor(LoadCursor(nullptr, IDC_ARROW));
m_chkStandart.SetState(!m_db->isEncrypted());
m_chkTotal.SetState(m_db->isEncrypted());
+ return true;
}
void ChangePass(CCtrlButton*)
@@ -60,21 +62,22 @@ class CSelectCryptoDialog : public CDlgBase CRYPTO_PROVIDER *m_selected;
bool m_bTotalEncryption;
- void OnInitDialog()
+ bool OnInitDialog() override
{
- for (size_t i = 0; i < m_provscount; i++)
- {
+ for (size_t i = 0; i < m_provscount; i++) {
CRYPTO_PROVIDER *prov = m_provs[i];
m_combo.AddStringA(prov->pszName, i);
}
m_combo.SetCurSel(0);
m_descr.SetText(m_provs[0]->szDescr.w);
+ return true;
}
- void OnClose()
+ bool OnClose() override
{
- m_selected = m_provs[ m_combo.GetItemData(m_combo.GetCurSel()) ];
+ m_selected = m_provs[m_combo.GetItemData(m_combo.GetCurSel())];
m_bTotalEncryption = m_chkTotalCrypt.GetState() != 0;
+ return true;
}
void OnComboChanged(CCtrlCombo*)
@@ -121,10 +124,9 @@ class CEnterPasswordDialog : public CDlgBase DlgChangePassParam *m_param;
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
- if (msg == WM_TIMER)
- {
+ if (msg == WM_TIMER) {
UINT_PTR LangID = (UINT_PTR)GetKeyboardLayout(0);
char Lang[3] = { 0 };
GetLocaleInfoA(MAKELCID((LangID & 0xffffffff), SORT_DEFAULT), LOCALE_SABBREVLANGNAME, Lang, 2);
@@ -133,8 +135,7 @@ class CEnterPasswordDialog : public CDlgBase m_language.SetTextA(Lang);
return FALSE;
}
- else if (msg == WM_CTLCOLORSTATIC)
- {
+ else if (msg == WM_CTLCOLORSTATIC) {
if ((HWND)lParam == m_language.GetHwnd()) {
SetTextColor((HDC)wParam, GetSysColor(COLOR_HIGHLIGHTTEXT));
SetBkMode((HDC)wParam, TRANSPARENT);
@@ -144,38 +145,32 @@ class CEnterPasswordDialog : public CDlgBase return CDlgBase::DlgProc(msg, wParam, lParam);
}
- void OnInitDialog()
+ bool OnInitDialog() override
{
m_header.SendMsg(WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(iconList[0].defIconID)));
- if (m_param->wrongPass)
- {
- if (m_param->wrongPass > 2)
- {
+ if (m_param->wrongPass) {
+ if (m_param->wrongPass > 2) {
m_passwordEdit.Disable();
m_buttonOK.Disable();
m_header.SetText(TranslateT("Too many errors!"));
}
- else
- {
- m_header.SetText(TranslateT("Password is not correct!"));
- }
- }
- else
- {
- m_header.SetText(TranslateT("Please type in your password"));
+ else m_header.SetText(TranslateT("Password is not correct!"));
}
+ else m_header.SetText(TranslateT("Please type in your password"));
+
SetTimer(m_hwnd, 1, 200, nullptr);
+ return true;
}
- void OnOK(CCtrlButton*)
+ void OnDestroy() override
{
- m_passwordEdit.GetText(m_param->newPass, _countof(m_param->newPass));
- EndDialog(m_hwnd, -128);
+ KillTimer(m_hwnd, 1);
}
- void OnDestroy()
+ void OnOK(CCtrlButton*)
{
- KillTimer(m_hwnd, 1);
+ m_passwordEdit.GetText(m_param->newPass, _countof(m_param->newPass));
+ EndDialog(m_hwnd, -128);
}
public:
@@ -189,5 +184,4 @@ public: {
m_buttonOK.OnClick = Callback(this, &CEnterPasswordDialog::OnOK);
}
-
};
diff --git a/plugins/MirLua/src/Modules/m_options.cpp b/plugins/MirLua/src/Modules/m_options.cpp index f956885bb7..29383e89ad 100644 --- a/plugins/MirLua/src/Modules/m_options.cpp +++ b/plugins/MirLua/src/Modules/m_options.cpp @@ -14,7 +14,7 @@ public: { } - void OnInitDialog() override + bool OnInitDialog() override { if (m_onInitDialogRef) { @@ -22,9 +22,10 @@ public: lua_pushlightuserdata(L, m_hwnd); luaM_pcall(L, 1, 0); } + return true; } - void OnApply() override + bool OnApply() override { if (m_onApplyRef) { @@ -32,6 +33,7 @@ public: lua_pushlightuserdata(L, m_hwnd); luaM_pcall(L, 1, 0); } + return true; } void OnDestroy() override diff --git a/plugins/MirLua/src/options.cpp b/plugins/MirLua/src/options.cpp index f0a7827a93..f6b0f4cd51 100644 --- a/plugins/MirLua/src/options.cpp +++ b/plugins/MirLua/src/options.cpp @@ -17,8 +17,7 @@ CMLuaOptions::CMLuaOptions() static int ScriptStatusToIcon(ScriptStatus status)
{
- switch (status)
- {
+ switch (status) {
case ScriptStatus::None:
return -1;
case ScriptStatus::Loaded:
@@ -41,7 +40,7 @@ void CMLuaOptions::LoadScripts() }
}
-void CMLuaOptions::OnInitDialog()
+bool CMLuaOptions::OnInitDialog()
{
CDlgBase::OnInitDialog();
@@ -71,9 +70,10 @@ void CMLuaOptions::OnInitDialog() LoadScripts();
isScriptListInit = true;
+ return true;
}
-void CMLuaOptions::OnApply()
+bool CMLuaOptions::OnApply()
{
int count = m_scripts.GetItemCount();
for (int iItem = 0; iItem < count; iItem++) {
@@ -83,6 +83,7 @@ void CMLuaOptions::OnApply() else
script->Enable();
}
+ return true;
}
INT_PTR CMLuaOptions::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/MirLua/src/options.h b/plugins/MirLua/src/options.h index fa5c6dc823..9b540bc392 100644 --- a/plugins/MirLua/src/options.h +++ b/plugins/MirLua/src/options.h @@ -14,13 +14,13 @@ private: void LoadScripts();
protected:
- void OnInitDialog();
- void OnApply();
+ bool OnInitDialog() override;
+ bool OnApply() override;
void OnScriptListClick(CCtrlListView::TEventInfo *evt);
void OnReload(CCtrlBase*);
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
public:
CMLuaOptions();
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 23ff125f22..cc8f137211 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -50,7 +50,7 @@ public: check_JABBER_API.OnChange = Callback(this, &COptGpgMainDlg::onChange_JABBER_API); } - virtual void OnInitDialog() override + bool OnInitDialog() override { list_USERLIST.AddColumn(0, TranslateT("Contact"), 60); list_USERLIST.AddColumn(1, TranslateT("Key ID"), 50); @@ -131,9 +131,10 @@ public: //////////////// list_USERLIST.OnItemChanged = Callback(this, &COptGpgMainDlg::onItemChanged_USERLIST); + return true; } - virtual void OnApply() override + bool OnApply() override { db_set_b(NULL, MODULENAME, "bDebugLog", globals.bDebugLog = check_DEBUG_LOG.GetState()); @@ -148,6 +149,7 @@ public: } db_set_b(NULL, MODULENAME, "bAutoExchange", globals.bAutoExchange = check_AUTO_EXCHANGE.GetState()); db_set_ws(NULL, MODULENAME, "szLogFilePath", ptrW(edit_LOG_FILE_EDIT.GetText())); + return true; } void onClick_DELETE_KEY_BUTTON(CCtrlButton*) @@ -382,13 +384,14 @@ public: } - virtual void OnInitDialog() override + bool OnInitDialog() override { edit_BIN_PATH.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szGpgBinPath", L"gpg.exe"))); edit_HOME_DIR.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szHomePath", L"gpg"))); + return true; } - virtual void OnApply() override + bool OnApply() override { wchar_t tmp[8192]; db_set_ws(NULL, MODULENAME, "szGpgBinPath", edit_BIN_PATH.GetText()); @@ -396,6 +399,7 @@ public: while (tmp[mir_wstrlen(tmp) - 1] == '\\') tmp[mir_wstrlen(tmp) - 1] = '\0'; db_set_ws(NULL, MODULENAME, "szHomePath", tmp); + return true; } void onClick_SET_BIN_PATH(CCtrlButton*) @@ -473,7 +477,7 @@ public: edit_IN_OPEN_TAG(this, IDC_IN_OPEN_TAG), edit_IN_CLOSE_TAG(this, IDC_IN_CLOSE_TAG), edit_OUT_OPEN_TAG(this, IDC_OUT_OPEN_TAG), edit_OUT_CLOSE_TAG(this, IDC_OUT_CLOSE_TAG) {} - virtual void OnInitDialog() override + bool OnInitDialog() override { check_APPEND_TAGS.SetState(db_get_b(NULL, MODULENAME, "bAppendTags", 0)); check_STRIP_TAGS.SetState(db_get_b(NULL, MODULENAME, "bStripTags", 0)); @@ -481,9 +485,10 @@ public: edit_IN_CLOSE_TAG.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szInCloseTag", L"</GPGdec>"))); edit_OUT_OPEN_TAG.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szOutOpenTag", L"<GPGenc>"))); edit_OUT_CLOSE_TAG.SetText(ptrW(UniGetContactSettingUtf(NULL, MODULENAME, "szOutCloseTag", L"</GPGenc>"))); + return true; } - virtual void OnApply() override + bool OnApply() override { db_set_b(NULL, MODULENAME, "bAppendTags", globals.bAppendTags = check_APPEND_TAGS.GetState()); db_set_b(NULL, MODULENAME, "bStripTags", globals.bStripTags = check_STRIP_TAGS.GetState()); @@ -505,6 +510,7 @@ public: mir_free(globals.outclosetag); globals.outclosetag = tmp; } + return true; } }; @@ -522,15 +528,17 @@ public: btn_IMPORT.OnClick = Callback(this, &COptGpgAdvDlg::onClick_IMPORT); } - virtual void OnInitDialog() override + bool OnInitDialog() override { check_PRESCENSE_SUBSCRIPTION.SetState(db_get_b(NULL, MODULENAME, "bPresenceSigning", 0)); check_PRESCENSE_SUBSCRIPTION.Enable(globals.bJabberAPI); + return true; } - virtual void OnApply() override + bool OnApply() override { db_set_b(NULL, MODULENAME, "bPresenceSigning", globals.bPresenceSigning = check_PRESCENSE_SUBSCRIPTION.GetState()); + return true; } void onClick_EXPORT(CCtrlButton*) @@ -581,7 +589,7 @@ public: btn_IMPORT.OnClick = Callback(this, &CDlgLoadPubKeyDlg::onClick_IMPORT); } - virtual void OnInitDialog() override + bool OnInitDialog() override { hContact = user_data[1]; SetWindowPos(m_hwnd, nullptr, globals.load_key_rect.left, globals.load_key_rect.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); @@ -663,6 +671,7 @@ public: edit_PUBLIC_KEY_EDIT.SetText(!str.empty() ? str.c_str() : L""); } edit_p_PubKeyEdit = &edit_PUBLIC_KEY_EDIT; + return true; } virtual void OnDestroy() override diff --git a/plugins/New_GPG/src/ui.cpp b/plugins/New_GPG/src/ui.cpp index 69216fcb5a..1ff5613792 100755 --- a/plugins/New_GPG/src/ui.cpp +++ b/plugins/New_GPG/src/ui.cpp @@ -17,29 +17,27 @@ #include "stdafx.h" -//HWND hwndFirstRun = nullptr, hwndSetDirs = nullptr, hwndNewKey = nullptr, hwndKeyGen = nullptr, hwndSelectExistingKey = nullptr; +///////////////////////////////////////////////////////////////////////////////////////// -CCtrlListView *list_hwndList_g = nullptr; - - -void CDlgEncryptedFileMsgBox::OnInitDialog() +bool CDlgEncryptedFileMsgBox::OnInitDialog() { globals.bDecryptFiles = false; + return true; } -CDlgEncryptedFileMsgBox::CDlgEncryptedFileMsgBox() : CDlgBase(g_plugin, IDD_ENCRYPTED_FILE_MSG_BOX), -chk_REMEMBER(this, IDC_REMEMBER), -btn_IGNORE(this, IDC_IGNORE), btn_DECRYPT(this, IDC_DECRYPT) +CDlgEncryptedFileMsgBox::CDlgEncryptedFileMsgBox() : + CDlgBase(g_plugin, IDD_ENCRYPTED_FILE_MSG_BOX), + chk_REMEMBER(this, IDC_REMEMBER), + btn_IGNORE(this, IDC_IGNORE), + btn_DECRYPT(this, IDC_DECRYPT) { btn_IGNORE.OnClick = Callback(this, &CDlgEncryptedFileMsgBox::onClick_IGNORE); btn_DECRYPT.OnClick = Callback(this, &CDlgEncryptedFileMsgBox::onClick_DECRYPT); } - void CDlgEncryptedFileMsgBox::onClick_IGNORE(CCtrlButton*) { - if (chk_REMEMBER.GetState()) - { + if (chk_REMEMBER.GetState()) { db_set_b(NULL, MODULENAME, "bSameAction", 1); globals.bSameAction = true; } @@ -49,8 +47,7 @@ void CDlgEncryptedFileMsgBox::onClick_IGNORE(CCtrlButton*) void CDlgEncryptedFileMsgBox::onClick_DECRYPT(CCtrlButton*) { globals.bDecryptFiles = true; - if (chk_REMEMBER.GetState()) - { + if (chk_REMEMBER.GetState()) { db_set_b(NULL, MODULENAME, "bFileTransfers", 1); globals.bFileTransfers = true; db_set_b(NULL, MODULENAME, "bSameAction", 0); @@ -59,19 +56,26 @@ void CDlgEncryptedFileMsgBox::onClick_DECRYPT(CCtrlButton*) this->Close(); } +///////////////////////////////////////////////////////////////////////////////////////// - -CDlgExportKeysMsgBox::CDlgExportKeysMsgBox() : CDlgBase(g_plugin, IDD_EXPORT_TYPE), -btn_OK(this, IDC_OK), btn_CANCEL(this, IDC_CANCEL), -chk_PUBLIC(this, IDC_PUBLIC), chk_PRIVATE(this, IDC_PRIVATE), chk_ALL(this, IDC_ALL) +CDlgExportKeysMsgBox::CDlgExportKeysMsgBox() : + CDlgBase(g_plugin, IDD_EXPORT_TYPE), + btn_OK(this, IDC_OK), + btn_CANCEL(this, IDC_CANCEL), + chk_PUBLIC(this, IDC_PUBLIC), + chk_PRIVATE(this, IDC_PRIVATE), + chk_ALL(this, IDC_ALL) { btn_OK.OnClick = Callback(this, &CDlgExportKeysMsgBox::onClick_OK); btn_CANCEL.OnClick = Callback(this, &CDlgExportKeysMsgBox::onClick_CANCEL); } -void CDlgExportKeysMsgBox::OnInitDialog() + +bool CDlgExportKeysMsgBox::OnInitDialog() { chk_PUBLIC.SetState(1); + return true; } + void CDlgExportKeysMsgBox::onClick_OK(CCtrlButton*) { if (chk_PUBLIC.GetState()) @@ -87,11 +91,14 @@ void CDlgExportKeysMsgBox::onClick_CANCEL(CCtrlButton*) this->Close(); } +///////////////////////////////////////////////////////////////////////////////////////// - -CDlgChangePasswdMsgBox::CDlgChangePasswdMsgBox() : CDlgBase(g_plugin, IDD_CHANGE_PASSWD), -btn_OK(this, ID_OK), -edit_NEW_PASSWD1(this, IDC_NEW_PASSWD1), edit_NEW_PASSWD2(this, IDC_NEW_PASSWD2), edit_OLD_PASSWD(this, IDC_OLD_PASSWD) +CDlgChangePasswdMsgBox::CDlgChangePasswdMsgBox() : + CDlgBase(g_plugin, IDD_CHANGE_PASSWD), + btn_OK(this, ID_OK), + edit_NEW_PASSWD1(this, IDC_NEW_PASSWD1), + edit_NEW_PASSWD2(this, IDC_NEW_PASSWD2), + edit_OLD_PASSWD(this, IDC_OLD_PASSWD) { btn_OK.OnClick = Callback(this, &CDlgChangePasswdMsgBox::onClick_OK); } @@ -100,8 +107,7 @@ void CDlgChangePasswdMsgBox::onClick_OK(CCtrlButton*) { //TODO: show some prgress { - if (mir_wstrcmp(edit_NEW_PASSWD1.GetText(), edit_NEW_PASSWD2.GetText())) - { + if (mir_wstrcmp(edit_NEW_PASSWD1.GetText(), edit_NEW_PASSWD2.GetText())) { MessageBox(m_hwnd, TranslateT("New passwords do not match"), TranslateT("Error"), MB_OK); return; } @@ -158,18 +164,25 @@ void CDlgChangePasswdMsgBox::onClick_OK(CCtrlButton*) this->Close(); } - - -CDlgFirstRun::CDlgFirstRun() : CDlgBase(g_plugin, IDD_FIRST_RUN), -list_KEY_LIST(this, IDC_KEY_LIST), -btn_COPY_PUBKEY(this, IDC_COPY_PUBKEY), btn_EXPORT_PRIVATE(this, IDC_EXPORT_PRIVATE), btn_CHANGE_PASSWD(this, IDC_CHANGE_PASSWD), btn_GENERATE_RANDOM(this, IDC_GENERATE_RANDOM), -btn_GENERATE_KEY(this, IDC_GENERATE_KEY), btn_OTHER(this, IDC_OTHER), btn_DELETE_KEY(this, IDC_DELETE_KEY), btn_OK(this, ID_OK), -edit_KEY_PASSWORD(this, IDC_KEY_PASSWORD), -combo_ACCOUNT(this, IDC_ACCOUNT), -lbl_KEY_ID(this, IDC_KEY_ID), lbl_GENERATING_KEY(this, IDC_GENERATING_KEY) +///////////////////////////////////////////////////////////////////////////////////////// + +CDlgFirstRun::CDlgFirstRun() : + CDlgBase(g_plugin, IDD_FIRST_RUN), + list_KEY_LIST(this, IDC_KEY_LIST), + btn_COPY_PUBKEY(this, IDC_COPY_PUBKEY), + btn_EXPORT_PRIVATE(this, IDC_EXPORT_PRIVATE), + btn_CHANGE_PASSWD(this, IDC_CHANGE_PASSWD), + btn_GENERATE_RANDOM(this, IDC_GENERATE_RANDOM), + btn_GENERATE_KEY(this, IDC_GENERATE_KEY), + btn_OTHER(this, IDC_OTHER), + btn_DELETE_KEY(this, IDC_DELETE_KEY), + btn_OK(this, ID_OK), + edit_KEY_PASSWORD(this, IDC_KEY_PASSWORD), + combo_ACCOUNT(this, IDC_ACCOUNT), + lbl_KEY_ID(this, IDC_KEY_ID), + lbl_GENERATING_KEY(this, IDC_GENERATING_KEY) { fp[0] = 0; - list_hwndList_g = &list_KEY_LIST; btn_COPY_PUBKEY.OnClick = Callback(this, &CDlgFirstRun::onClick_COPY_PUBKEY); btn_EXPORT_PRIVATE.OnClick = Callback(this, &CDlgFirstRun::onClick_EXPORT_PRIVATE); @@ -181,7 +194,8 @@ lbl_KEY_ID(this, IDC_KEY_ID), lbl_GENERATING_KEY(this, IDC_GENERATING_KEY) btn_OK.OnClick = Callback(this, &CDlgFirstRun::onClick_OK); } -void CDlgFirstRun::OnInitDialog() + +bool CDlgFirstRun::OnInitDialog() { SetWindowPos(m_hwnd, nullptr, globals.firstrun_rect.left, globals.firstrun_rect.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); SetCaption(TranslateT("Set own key")); @@ -224,14 +238,15 @@ void CDlgFirstRun::OnInitDialog() combo_ACCOUNT.OnChange = Callback(this, &CDlgFirstRun::onChange_ACCOUNT); list_KEY_LIST.OnClick = Callback(this, &CDlgFirstRun::onChange_KEY_LIST); + return true; } + void CDlgFirstRun::onClick_COPY_PUBKEY(CCtrlButton*) { int i = list_KEY_LIST.GetSelectionMark(); if (i == -1) return; - if (OpenClipboard(m_hwnd)) - { + if (OpenClipboard(m_hwnd)) { list_KEY_LIST.GetItemText(i, 0, fp, _countof(fp)); string out; DWORD code; @@ -275,6 +290,7 @@ void CDlgFirstRun::onClick_COPY_PUBKEY(CCtrlButton*) CloseClipboard(); } } + void CDlgFirstRun::onClick_EXPORT_PRIVATE(CCtrlButton*) { { @@ -318,6 +334,7 @@ void CDlgFirstRun::onClick_EXPORT_PRIVATE(CCtrlButton*) file.close(); } } + void CDlgFirstRun::onClick_CHANGE_PASSWD(CCtrlButton*) { int i = list_KEY_LIST.GetSelectionMark(); @@ -349,6 +366,7 @@ void CDlgFirstRun::onClick_CHANGE_PASSWD(CCtrlButton*) } } + void CDlgFirstRun::onClick_GENERATE_RANDOM(CCtrlButton*) { lbl_GENERATING_KEY.SendMsg(WM_SETFONT, (WPARAM)globals.bold_font, TRUE); @@ -361,12 +379,14 @@ void CDlgFirstRun::onClick_GENERATE_RANDOM(CCtrlButton*) gpg_use_new_random_key(combo_ACCOUNT.GetTextA()); this->Close(); } + void CDlgFirstRun::onClick_GENERATE_KEY(CCtrlButton*) { CDlgKeyGen *d = new CDlgKeyGen; d->DoModal(); refresh_key_list(); } + void CDlgFirstRun::onClick_OTHER(CCtrlButton*) { void ShowLoadPublicKeyDialog(bool = false); @@ -375,6 +395,7 @@ void CDlgFirstRun::onClick_OTHER(CCtrlButton*) ShowLoadPublicKeyDialog(true); refresh_key_list(); } + void CDlgFirstRun::onClick_DELETE_KEY(CCtrlButton*) { int i = list_KEY_LIST.GetSelectionMark(); @@ -456,6 +477,7 @@ void CDlgFirstRun::onClick_DELETE_KEY(CCtrlButton*) } list_KEY_LIST.DeleteItem(i); } + void CDlgFirstRun::onClick_OK(CCtrlButton*) { { @@ -485,13 +507,11 @@ void CDlgFirstRun::onClick_OK(CCtrlButton*) params.out = &out; params.code = &code; params.result = &result; - if (!gpg_launcher(params)) - { + if (!gpg_launcher(params)) { delete[] name; return; } - if (result == pxNotFound) - { + if (result == pxNotFound) { delete[] name; return; } @@ -526,8 +546,7 @@ void CDlgFirstRun::onClick_OK(CCtrlButton*) mir_free(buf); } wchar_t *passwd = mir_wstrdup(edit_KEY_PASSWORD.GetText()); - if (passwd && passwd[0]) - { + if (passwd && passwd[0]) { string dbsetting = "szKey_"; char *keyid = mir_u2a(fp); dbsetting += keyid; @@ -543,6 +562,7 @@ void CDlgFirstRun::onClick_OK(CCtrlButton*) globals.gpg_keyexist = isGPGKeyExist(); DestroyWindow(m_hwnd); } + void CDlgFirstRun::onChange_ACCOUNT(CCtrlCombo*) { char *buf = mir_strdup(combo_ACCOUNT.GetTextA()); @@ -567,10 +587,10 @@ void CDlgFirstRun::onChange_ACCOUNT(CCtrlCombo*) if (buf) mir_free(buf); } + void CDlgFirstRun::onChange_KEY_LIST(CCtrlListView::TEventInfo *ev) //TODO: check if this work { - if (ev->nmlv) - { + if (ev->nmlv) { NMLISTVIEW *hdr = ev->nmlv; if (hdr->hdr.code == NM_CLICK) { @@ -581,6 +601,7 @@ void CDlgFirstRun::onChange_KEY_LIST(CCtrlListView::TEventInfo *ev) //TODO: chec } } } + void CDlgFirstRun::OnDestroy() { GetWindowRect(m_hwnd, &globals.firstrun_rect); @@ -588,7 +609,6 @@ void CDlgFirstRun::OnDestroy() db_set_dw(NULL, MODULENAME, "FirstrunWindowY", globals.firstrun_rect.top); } - void CDlgFirstRun::refresh_key_list() { list_KEY_LIST.DeleteAllItems(); @@ -732,19 +752,25 @@ void CDlgFirstRun::refresh_key_list() } } - - -CDlgGpgBinOpts::CDlgGpgBinOpts() : CDlgBase(g_plugin, IDD_BIN_PATH), -btn_SET_BIN_PATH(this, IDC_SET_BIN_PATH), btn_SET_HOME_DIR(this, IDC_SET_HOME_DIR), btn_OK(this, ID_OK), btn_GENERATE_RANDOM(this, IDC_GENERATE_RANDOM), -edit_BIN_PATH(this, IDC_BIN_PATH), edit_HOME_DIR(this, IDC_HOME_DIR), -chk_AUTO_EXCHANGE(this, IDC_AUTO_EXCHANGE) +///////////////////////////////////////////////////////////////////////////////////////// + +CDlgGpgBinOpts::CDlgGpgBinOpts() : + CDlgBase(g_plugin, IDD_BIN_PATH), + btn_SET_BIN_PATH(this, IDC_SET_BIN_PATH), + btn_SET_HOME_DIR(this, IDC_SET_HOME_DIR), + btn_OK(this, ID_OK), + btn_GENERATE_RANDOM(this, IDC_GENERATE_RANDOM), + edit_BIN_PATH(this, IDC_BIN_PATH), + edit_HOME_DIR(this, IDC_HOME_DIR), + chk_AUTO_EXCHANGE(this, IDC_AUTO_EXCHANGE) { btn_SET_BIN_PATH.OnClick = Callback(this, &CDlgGpgBinOpts::onClick_SET_BIN_PATH); btn_SET_HOME_DIR.OnClick = Callback(this, &CDlgGpgBinOpts::onClick_SET_HOME_DIR); btn_OK.OnClick = Callback(this, &CDlgGpgBinOpts::onClick_OK); btn_GENERATE_RANDOM.OnClick = Callback(this, &CDlgGpgBinOpts::onClick_GENERATE_RANDOM); } -void CDlgGpgBinOpts::OnInitDialog() + +bool CDlgGpgBinOpts::OnInitDialog() { CMStringW path; bool gpg_exists = false, lang_exists = false; @@ -832,7 +858,9 @@ void CDlgGpgBinOpts::OnInitDialog() if (gpg_exists && lang_exists && !bad_version) MessageBox(nullptr, TranslateT("Your GPG version is supported. The language file was found.\nGPG plugin should work fine.\nPress OK to continue."), TranslateT("Info"), MB_OK); chk_AUTO_EXCHANGE.Enable(); + return true; } + void CDlgGpgBinOpts::onClick_SET_BIN_PATH(CCtrlButton*) { GetFilePath(L"Choose gpg.exe", "szGpgBinPath", L"*.exe", L"EXE Executables"); @@ -840,13 +868,12 @@ void CDlgGpgBinOpts::onClick_SET_BIN_PATH(CCtrlButton*) edit_BIN_PATH.SetText(tmp); wchar_t mir_path[MAX_PATH]; PathToAbsoluteW(L"\\", mir_path); - if (tmp.Find(mir_path, 0) == 0) - { + if (tmp.Find(mir_path, 0) == 0) { CMStringW path = tmp.Mid(mir_wstrlen(mir_path)); edit_BIN_PATH.SetText(path); } - } + void CDlgGpgBinOpts::onClick_SET_HOME_DIR(CCtrlButton*) { GetFolderPath(L"Set home directory", "szHomePath"); @@ -863,8 +890,7 @@ void CDlgGpgBinOpts::onClick_SET_HOME_DIR(CCtrlButton*) } void CDlgGpgBinOpts::onClick_OK(CCtrlButton*) { - if (gpg_validate_paths(edit_BIN_PATH.GetText(), edit_HOME_DIR.GetText())) - { + if (gpg_validate_paths(edit_BIN_PATH.GetText(), edit_HOME_DIR.GetText())) { gpg_save_paths(edit_BIN_PATH.GetText(), edit_HOME_DIR.GetText()); globals.gpg_valid = true; db_set_b(NULL, MODULENAME, "FirstRun", 0); @@ -874,14 +900,13 @@ void CDlgGpgBinOpts::onClick_OK(CCtrlButton*) this->Close(); } } + void CDlgGpgBinOpts::onClick_GENERATE_RANDOM(CCtrlButton*) { - if (gpg_validate_paths(edit_BIN_PATH.GetText(), edit_HOME_DIR.GetText())) - { + if (gpg_validate_paths(edit_BIN_PATH.GetText(), edit_HOME_DIR.GetText())) { gpg_save_paths(edit_BIN_PATH.GetText(), edit_HOME_DIR.GetText()); globals.gpg_valid = true; - if (gpg_use_new_random_key()) - { + if (gpg_use_new_random_key()) { db_set_b(NULL, MODULENAME, "bAutoExchange", globals.bAutoExchange = chk_AUTO_EXCHANGE.GetState()); globals.gpg_valid = true; db_set_b(NULL, MODULENAME, "FirstRun", 0); @@ -889,24 +914,31 @@ void CDlgGpgBinOpts::onClick_GENERATE_RANDOM(CCtrlButton*) } } } + void CDlgGpgBinOpts::OnDestroy() { void InitCheck(); InitCheck(); } -CDlgNewKey::CDlgNewKey(MCONTACT _hContact, wstring _new_key) : CDlgBase(g_plugin, IDD_NEW_KEY), -lbl_KEY_FROM(this, IDC_KEY_FROM), lbl_MESSAGE(this, IDC_MESSAGE), -btn_IMPORT(this, ID_IMPORT), btn_IMPORT_AND_USE(this, IDC_IMPORT_AND_USE), btn_IGNORE_KEY(this, IDC_IGNORE_KEY) +///////////////////////////////////////////////////////////////////////////////////////// + +CDlgNewKey::CDlgNewKey(MCONTACT _hContact, wstring _new_key) : + CDlgBase(g_plugin, IDD_NEW_KEY), + lbl_KEY_FROM(this, IDC_KEY_FROM), + lbl_MESSAGE(this, IDC_MESSAGE), + btn_IMPORT(this, ID_IMPORT), + btn_IMPORT_AND_USE(this, IDC_IMPORT_AND_USE), + btn_IGNORE_KEY(this, IDC_IGNORE_KEY) { hContact = _hContact; new_key = _new_key; btn_IMPORT.OnClick = Callback(this, &CDlgNewKey::onClick_IMPORT); btn_IMPORT_AND_USE.OnClick = Callback(this, &CDlgNewKey::onClick_IMPORT_AND_USE); btn_IGNORE_KEY.OnClick = Callback(this, &CDlgNewKey::onClick_IGNORE_KEY); - } -void CDlgNewKey::OnInitDialog() + +bool CDlgNewKey::OnInitDialog() { //new_key_hcnt_mutex.unlock(); SetWindowPos(m_hwnd, nullptr, globals.new_key_rect.left, globals.new_key_rect.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); @@ -919,18 +951,22 @@ void CDlgNewKey::OnInitDialog() mir_snwprintf(tmp, 255 * sizeof(wchar_t), TranslateT("Received key from %s"), Clist_GetContactDisplayName(hContact)); lbl_KEY_FROM.SetText(tmp); mir_free(tmp); + return true; } + void CDlgNewKey::OnDestroy() { GetWindowRect(m_hwnd, &globals.new_key_rect); db_set_dw(NULL, MODULENAME, "NewKeyWindowX", globals.new_key_rect.left); db_set_dw(NULL, MODULENAME, "NewKeyWindowY", globals.new_key_rect.top); } + void CDlgNewKey::onClick_IMPORT(CCtrlButton*) { ImportKey(hContact, new_key); this->Close(); } + void CDlgNewKey::onClick_IMPORT_AND_USE(CCtrlButton*) { ImportKey(hContact, new_key); @@ -941,22 +977,31 @@ void CDlgNewKey::onClick_IMPORT_AND_USE(CCtrlButton*) setClistIcon(hContact); this->Close(); } + void CDlgNewKey::onClick_IGNORE_KEY(CCtrlButton*) { this->Close(); } -CDlgKeyGen::CDlgKeyGen() : CDlgBase(g_plugin, IDD_KEY_GEN), -combo_KEY_TYPE(this, IDC_KEY_TYPE), -edit_KEY_LENGTH(this, IDC_KEY_LENGTH), edit_KEY_PASSWD(this, IDC_KEY_PASSWD), edit_KEY_REAL_NAME(this, IDC_KEY_REAL_NAME), edit_KEY_EMAIL(this, IDC_KEY_EMAIL), edit_KEY_COMMENT(this, IDC_KEY_COMMENT), -edit_KEY_EXPIRE_DATE(this, IDC_KEY_EXPIRE_DATE), -lbl_GENERATING_TEXT(this, IDC_GENERATING_TEXT), -btn_OK(this, IDOK), btn_CANCEL(this, IDCANCEL) +///////////////////////////////////////////////////////////////////////////////////////// + +CDlgKeyGen::CDlgKeyGen() : + CDlgBase(g_plugin, IDD_KEY_GEN), + combo_KEY_TYPE(this, IDC_KEY_TYPE), + edit_KEY_LENGTH(this, IDC_KEY_LENGTH), + edit_KEY_PASSWD(this, IDC_KEY_PASSWD), + edit_KEY_REAL_NAME(this, IDC_KEY_REAL_NAME), + edit_KEY_EMAIL(this, IDC_KEY_EMAIL), + edit_KEY_COMMENT(this, IDC_KEY_COMMENT), + edit_KEY_EXPIRE_DATE(this, IDC_KEY_EXPIRE_DATE), + lbl_GENERATING_TEXT(this, IDC_GENERATING_TEXT), + btn_OK(this, IDOK), btn_CANCEL(this, IDCANCEL) { btn_OK.OnClick = Callback(this, &CDlgKeyGen::onClick_OK); btn_CANCEL.OnClick = Callback(this, &CDlgKeyGen::onClick_CANCEL); } -void CDlgKeyGen::OnInitDialog() + +bool CDlgKeyGen::OnInitDialog() { SetWindowPos(m_hwnd, nullptr, globals.key_gen_rect.left, globals.key_gen_rect.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); SetCaption(TranslateT("Key Generation dialog")); @@ -965,6 +1010,7 @@ void CDlgKeyGen::OnInitDialog() combo_KEY_TYPE.SelectString(L"RSA"); edit_KEY_EXPIRE_DATE.SetText(L"0"); edit_KEY_LENGTH.SetText(L"4096"); + return true; } void CDlgKeyGen::onClick_OK(CCtrlButton*) @@ -973,13 +1019,11 @@ void CDlgKeyGen::onClick_OK(CCtrlButton*) wstring path; { //data sanity checks wchar_t *tmp = mir_wstrdup(combo_KEY_TYPE.GetText()); - if (!tmp) - { + if (!tmp) { MessageBox(nullptr, TranslateT("You must set encryption algorithm first"), TranslateT("Error"), MB_OK); return; } - if (mir_wstrlen(tmp) < 3) - { + if (mir_wstrlen(tmp) < 3) { mir_free(tmp); tmp = nullptr; MessageBox(nullptr, TranslateT("You must set encryption algorithm first"), TranslateT("Error"), MB_OK); @@ -987,8 +1031,7 @@ void CDlgKeyGen::onClick_OK(CCtrlButton*) } mir_free(tmp); tmp = mir_wstrdup(edit_KEY_LENGTH.GetText()); - if (!tmp) - { + if (!tmp) { MessageBox(nullptr, TranslateT("Key length must be of length from 1024 to 4096 bits"), TranslateT("Error"), MB_OK); return; } @@ -999,8 +1042,7 @@ void CDlgKeyGen::onClick_OK(CCtrlButton*) return; } tmp = mir_wstrdup(edit_KEY_EXPIRE_DATE.GetText()); - if (!tmp) - { + if (!tmp) { MessageBox(nullptr, TranslateT("Invalid date"), TranslateT("Error"), MB_OK); return; } @@ -1011,8 +1053,7 @@ void CDlgKeyGen::onClick_OK(CCtrlButton*) } mir_free(tmp); tmp = mir_wstrdup(edit_KEY_REAL_NAME.GetText()); - if (!tmp) - { + if (!tmp) { MessageBox(nullptr, TranslateT("Name must contain at least 5 characters"), TranslateT("Error"), MB_OK); return; } @@ -1021,16 +1062,14 @@ void CDlgKeyGen::onClick_OK(CCtrlButton*) mir_free(tmp); return; } - else if (wcschr(tmp, '(') || wcschr(tmp, ')')) - { + else if (wcschr(tmp, '(') || wcschr(tmp, ')')) { MessageBox(nullptr, TranslateT("Name cannot contain '(' or ')'"), TranslateT("Error"), MB_OK); mir_free(tmp); return; } mir_free(tmp); tmp = mir_wstrdup(edit_KEY_EMAIL.GetText()); - if (!tmp) - { + if (!tmp) { MessageBox(nullptr, TranslateT("Invalid Email"), TranslateT("Error"), MB_OK); return; } @@ -1073,8 +1112,7 @@ void CDlgKeyGen::onClick_OK(CCtrlButton*) f << subkeytype; mir_free(subkeytype); f << "\n"; - if (edit_KEY_PASSWD.GetText()[0]) - { + if (edit_KEY_PASSWD.GetText()[0]) { f << "Passphrase: "; f << toUTF8(edit_KEY_PASSWD.GetText()).c_str(); f << "\n"; @@ -1082,8 +1120,7 @@ void CDlgKeyGen::onClick_OK(CCtrlButton*) f << "Name-Real: "; f << toUTF8(edit_KEY_REAL_NAME.GetText()).c_str(); f << "\n"; - if (edit_KEY_COMMENT.GetText()[0]) - { + if (edit_KEY_COMMENT.GetText()[0]) { f << "Name-Comment: "; f << toUTF8(edit_KEY_COMMENT.GetText()).c_str(); f << "\n"; @@ -1129,10 +1166,12 @@ void CDlgKeyGen::onClick_OK(CCtrlButton*) } this->Close(); } + void CDlgKeyGen::onClick_CANCEL(CCtrlButton*) { this->Close(); } + void CDlgKeyGen::OnDestroy() { GetWindowRect(m_hwnd, &globals.key_gen_rect); @@ -1140,20 +1179,24 @@ void CDlgKeyGen::OnDestroy() db_set_dw(NULL, MODULENAME, "KeyGenWindowY", globals.key_gen_rect.top); } -CDlgLoadExistingKey::CDlgLoadExistingKey() : CDlgBase(g_plugin, IDD_LOAD_EXISTING_KEY), -btn_OK(this, IDOK), btn_CANCEL(this, IDCANCEL), -list_EXISTING_KEY_LIST(this, IDC_EXISTING_KEY_LIST) +///////////////////////////////////////////////////////////////////////////////////////// + +CDlgLoadExistingKey::CDlgLoadExistingKey() : + CDlgBase(g_plugin, IDD_LOAD_EXISTING_KEY), + btn_OK(this, IDOK), + btn_CANCEL(this, IDCANCEL), + list_EXISTING_KEY_LIST(this, IDC_EXISTING_KEY_LIST) { id[0] = 0; btn_OK.OnClick = Callback(this, &CDlgLoadExistingKey::onClick_OK); btn_CANCEL.OnClick = Callback(this, &CDlgLoadExistingKey::onClick_CANCEL); } -void CDlgLoadExistingKey::OnInitDialog() + +bool CDlgLoadExistingKey::OnInitDialog() { SetWindowPos(m_hwnd, nullptr, globals.load_existing_key_rect.left, globals.load_existing_key_rect.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); - list_EXISTING_KEY_LIST.AddColumn(0, TranslateT("Key ID"), 50); list_EXISTING_KEY_LIST.AddColumn(1, TranslateT("Email"), 30); list_EXISTING_KEY_LIST.AddColumn(2, TranslateT("Name"), 250); @@ -1177,12 +1220,11 @@ void CDlgLoadExistingKey::OnInitDialog() params.code = &code; params.result = &result; if (!gpg_launcher(params)) - return; + return false; if (result == pxNotFound) - return; + return false; } - while (p != string::npos) - { + while (p != string::npos) { if ((p = out.find("pub ", p)) == string::npos) break; p += 5; @@ -1202,8 +1244,7 @@ void CDlgLoadExistingKey::OnInitDialog() p++; p2 = out.find("\n", p); string::size_type p3 = out.substr(p, p2 - p).find("["); - if (p3 != string::npos) - { + if (p3 != string::npos) { p3 += p; p2 = p3; p2--; @@ -1223,8 +1264,7 @@ void CDlgLoadExistingKey::OnInitDialog() p += mir_strlen("uid "); p2 = out.find("\n", p); p3 = out.substr(p, p2 - p).find("<"); - if (p3 != string::npos) - { + if (p3 != string::npos) { p3 += p; p2 = p3; p2--; @@ -1240,12 +1280,7 @@ void CDlgLoadExistingKey::OnInitDialog() tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()); list_EXISTING_KEY_LIST.SetItemText(row, 2, tmp); mir_free(tmp); - // p = out.find("sub ", p2) + 6; - // p = out.find(" ", p) + 1; - // p2 = out.find("\n", p); - // tmp = mir_wstrdup(toUTF16(out.substr(p,p2-p-1)).c_str()); - // ListView_SetItemText(hwndList, iRow, 3, tmp); - // mir_free(tmp); + list_EXISTING_KEY_LIST.SetColumnWidth(0, LVSCW_AUTOSIZE);// not sure about this list_EXISTING_KEY_LIST.SetColumnWidth(1, LVSCW_AUTOSIZE); list_EXISTING_KEY_LIST.SetColumnWidth(2, LVSCW_AUTOSIZE); @@ -1257,13 +1292,16 @@ void CDlgLoadExistingKey::OnInitDialog() } } list_EXISTING_KEY_LIST.OnClick = Callback(this, &CDlgLoadExistingKey::onChange_EXISTING_KEY_LIST); + return true; } + void CDlgLoadExistingKey::OnDestroy() { GetWindowRect(m_hwnd, &globals.load_existing_key_rect); db_set_dw(NULL, MODULENAME, "LoadExistingKeyWindowX", globals.load_existing_key_rect.left); db_set_dw(NULL, MODULENAME, "LoadExistingKeyWindowY", globals.load_existing_key_rect.top); } + void CDlgLoadExistingKey::onClick_OK(CCtrlButton*) { int i = list_EXISTING_KEY_LIST.GetSelectionMark(); @@ -1292,6 +1330,7 @@ void CDlgLoadExistingKey::onClick_OK(CCtrlButton*) while ((s = out.find("\r", s)) != string::npos) { out.erase(s, 1); } + std::string::size_type p1 = 0, p2 = 0; p1 = out.find("-----BEGIN PGP PUBLIC KEY BLOCK-----"); if (p1 != std::string::npos) { @@ -1304,12 +1343,10 @@ void CDlgLoadExistingKey::onClick_OK(CCtrlButton*) edit_p_PubKeyEdit->SetText(tmp); mir_free(tmp); } - else - MessageBox(nullptr, TranslateT("Failed to export public key."), TranslateT("Error"), MB_OK); + else MessageBox(nullptr, TranslateT("Failed to export public key."), TranslateT("Error"), MB_OK); } - else - MessageBox(nullptr, TranslateT("Failed to export public key."), TranslateT("Error"), MB_OK); - // SetDlgItemText(hPubKeyEdit, IDC_PUBLIC_KEY_EDIT, tmp); + else MessageBox(nullptr, TranslateT("Failed to export public key."), TranslateT("Error"), MB_OK); + this->Close(); } void CDlgLoadExistingKey::onClick_CANCEL(CCtrlButton*) @@ -1323,25 +1360,32 @@ void CDlgLoadExistingKey::onChange_EXISTING_KEY_LIST(CCtrlListView::TEventInfo * btn_OK.Enable(); } -CDlgImportKey::CDlgImportKey(MCONTACT _hContact) : CDlgBase(g_plugin, IDD_IMPORT_KEY), -combo_KEYSERVER(this, IDC_KEYSERVER), -btn_IMPORT(this, IDC_IMPORT) +///////////////////////////////////////////////////////////////////////////////////////// + +CDlgImportKey::CDlgImportKey(MCONTACT _hContact) : + CDlgBase(g_plugin, IDD_IMPORT_KEY), + combo_KEYSERVER(this, IDC_KEYSERVER), + btn_IMPORT(this, IDC_IMPORT) { hContact = _hContact; btn_IMPORT.OnClick = Callback(this, &CDlgImportKey::onClick_IMPORT); } -void CDlgImportKey::OnInitDialog() + +bool CDlgImportKey::OnInitDialog() { SetWindowPos(m_hwnd, nullptr, globals.import_key_rect.left, globals.import_key_rect.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); combo_KEYSERVER.AddString(L"subkeys.pgp.net"); combo_KEYSERVER.AddString(L"keys.gnupg.net"); + return true; } + void CDlgImportKey::OnDestroy() { GetWindowRect(m_hwnd, &globals.import_key_rect); db_set_dw(NULL, MODULENAME, "ImportKeyWindowX", globals.import_key_rect.left); db_set_dw(NULL, MODULENAME, "ImportKeyWindowY", globals.import_key_rect.top); } + void CDlgImportKey::onClick_IMPORT(CCtrlButton*) { string out; @@ -1360,31 +1404,36 @@ void CDlgImportKey::onClick_IMPORT(CCtrlButton*) MessageBoxA(nullptr, out.c_str(), "GPG output", MB_OK); } +///////////////////////////////////////////////////////////////////////////////////////// - -CDlgKeyPasswordMsgBox::CDlgKeyPasswordMsgBox(MCONTACT _hContact) : CDlgBase(g_plugin, IDD_KEY_PASSWD), -lbl_KEYID(this, IDC_KEYID), -edit_KEY_PASSWORD(this, IDC_KEY_PASSWORD), -chk_DEFAULT_PASSWORD(this, IDC_DEFAULT_PASSWORD), chk_SAVE_PASSWORD(this, IDC_SAVE_PASSWORD), -btn_OK(this, IDOK), btn_CANCEL(this, IDCANCEL) +CDlgKeyPasswordMsgBox::CDlgKeyPasswordMsgBox(MCONTACT _hContact) : + CDlgBase(g_plugin, IDD_KEY_PASSWD), + lbl_KEYID(this, IDC_KEYID), + edit_KEY_PASSWORD(this, IDC_KEY_PASSWORD), + chk_DEFAULT_PASSWORD(this, IDC_DEFAULT_PASSWORD), + chk_SAVE_PASSWORD(this, IDC_SAVE_PASSWORD), + btn_OK(this, IDOK), + btn_CANCEL(this, IDCANCEL) { hContact = _hContact; btn_OK.OnClick = Callback(this, &CDlgKeyPasswordMsgBox::onClick_OK); btn_CANCEL.OnClick = Callback(this, &CDlgKeyPasswordMsgBox::onClick_CANCEL); } -void CDlgKeyPasswordMsgBox::OnInitDialog() + +bool CDlgKeyPasswordMsgBox::OnInitDialog() { inkeyid = UniGetContactSettingUtf(hContact, MODULENAME, "InKeyID", ""); SetWindowPos(m_hwnd, nullptr, globals.key_password_rect.left, globals.key_password_rect.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); - { - string questionstr = "Please enter password for key with ID: "; - questionstr += inkeyid; - mir_free(inkeyid); - lbl_KEYID.SetTextA(questionstr.c_str()); - chk_DEFAULT_PASSWORD.Disable(); - } + + string questionstr = "Please enter password for key with ID: "; + questionstr += inkeyid; + mir_free(inkeyid); + lbl_KEYID.SetTextA(questionstr.c_str()); + chk_DEFAULT_PASSWORD.Disable(); + return true; } + void CDlgKeyPasswordMsgBox::OnDestroy() { mir_free(inkeyid); @@ -1392,6 +1441,7 @@ void CDlgKeyPasswordMsgBox::OnDestroy() db_set_dw(NULL, MODULENAME, "PasswordWindowX", globals.key_password_rect.left); db_set_dw(NULL, MODULENAME, "PasswordWindowY", globals.key_password_rect.top); } + void CDlgKeyPasswordMsgBox::onClick_OK(CCtrlButton*) { wchar_t *tmp = mir_wstrdup(edit_KEY_PASSWORD.GetText()); @@ -1415,9 +1465,9 @@ void CDlgKeyPasswordMsgBox::onClick_OK(CCtrlButton*) mir_free(inkeyid); DestroyWindow(m_hwnd); } + void CDlgKeyPasswordMsgBox::onClick_CANCEL(CCtrlButton*) { globals._terminate = true; DestroyWindow(m_hwnd); } - diff --git a/plugins/New_GPG/src/ui.h b/plugins/New_GPG/src/ui.h index ecd8b9e250..aa97b247d9 100755 --- a/plugins/New_GPG/src/ui.h +++ b/plugins/New_GPG/src/ui.h @@ -22,7 +22,7 @@ class CDlgEncryptedFileMsgBox : public CDlgBase { public: CDlgEncryptedFileMsgBox(); - virtual void OnInitDialog() override; + bool OnInitDialog() override; void onClick_IGNORE(CCtrlButton*); void onClick_DECRYPT(CCtrlButton*); @@ -35,7 +35,7 @@ class CDlgExportKeysMsgBox : public CDlgBase { public: CDlgExportKeysMsgBox(); - virtual void OnInitDialog() override; + bool OnInitDialog() override; void onClick_OK(CCtrlButton*); void onClick_CANCEL(CCtrlButton*); @@ -59,7 +59,7 @@ class CDlgFirstRun : public CDlgBase public: CDlgFirstRun(); - virtual void OnInitDialog() override; + bool OnInitDialog() override; void onClick_COPY_PUBKEY(CCtrlButton*); void onClick_EXPORT_PRIVATE(CCtrlButton*); void onClick_CHANGE_PASSWD(CCtrlButton*); @@ -86,7 +86,7 @@ class CDlgGpgBinOpts : public CDlgBase { public: CDlgGpgBinOpts(); - virtual void OnInitDialog() override; + bool OnInitDialog() override; void onClick_SET_BIN_PATH(CCtrlButton*); void onClick_SET_HOME_DIR(CCtrlButton*); void onClick_OK(CCtrlButton*); @@ -102,7 +102,7 @@ class CDlgNewKey : public CDlgBase { public: CDlgNewKey(MCONTACT hContact, wstring new_key); - virtual void OnInitDialog() override; + bool OnInitDialog() override; virtual void OnDestroy() override; void onClick_IMPORT(CCtrlButton*); void onClick_IMPORT_AND_USE(CCtrlButton*); @@ -118,7 +118,7 @@ class CDlgKeyGen : public CDlgBase //TODO: in modal mode window destroying on an { public: CDlgKeyGen(); - virtual void OnInitDialog() override; + bool OnInitDialog() override; void onClick_OK(CCtrlButton*); void onClick_CANCEL(CCtrlButton*); @@ -136,7 +136,7 @@ class CDlgLoadExistingKey : public CDlgBase { public: CDlgLoadExistingKey(); - virtual void OnInitDialog() override; + bool OnInitDialog() override; virtual void OnDestroy() override; void onClick_OK(CCtrlButton*); void onClick_CANCEL(CCtrlButton*); @@ -151,7 +151,7 @@ class CDlgImportKey : public CDlgBase { public: CDlgImportKey(MCONTACT hContact); - virtual void OnInitDialog() override; + bool OnInitDialog() override; virtual void OnDestroy() override; void onClick_IMPORT(CCtrlButton*); private: @@ -164,7 +164,7 @@ class CDlgKeyPasswordMsgBox : public CDlgBase //always modal { public: CDlgKeyPasswordMsgBox(MCONTACT _hContact); - virtual void OnInitDialog() override; + bool OnInitDialog() override; virtual void OnDestroy() override; void onClick_OK(CCtrlButton*); void onClick_CANCEL(CCtrlButton*); diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp index cc02d91bd9..04b70d4aa0 100644 --- a/plugins/NewsAggregator/Src/Authentication.cpp +++ b/plugins/NewsAggregator/Src/Authentication.cpp @@ -52,7 +52,7 @@ CAuthRequest::CAuthRequest(CFeedEditor *pDlg, MCONTACT hContact) m_ok.OnClick = Callback(this, &CAuthRequest::OnOk);
}
-void CAuthRequest::OnInitDialog()
+bool CAuthRequest::OnInitDialog()
{
if (m_pDlg) {
ptrW strfeedtitle(m_pDlg->m_feedtitle.GetText());
@@ -78,6 +78,7 @@ void CAuthRequest::OnInitDialog() }
}
}
+ return true;
}
void CAuthRequest::OnOk(CCtrlBase*)
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index f06e592de7..2413a64191 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -36,7 +36,7 @@ CExportFeed::CExportFeed() m_feedsexportlist.OnDblClick = Callback(this, &CExportFeed::OnFeedsExportList);
}
-void CExportFeed::OnInitDialog()
+bool CExportFeed::OnInitDialog()
{
Utils_RestoreWindowPositionNoSize(m_hwnd, NULL, MODULENAME, "ExportDlg");
for (auto &hContact : Contacts(MODULENAME)) {
@@ -53,6 +53,7 @@ void CExportFeed::OnInitDialog() m_addfeed.Disable();
m_addallfeeds.Disable();
}
+ return true;
}
void CExportFeed::OnAddFeed(CCtrlBase*)
@@ -243,13 +244,16 @@ void CExportFeed::OnOk(CCtrlBase*) }
}
-void CExportFeed::OnClose()
+bool CExportFeed::OnClose()
{
Utils_SaveWindowPosition(m_hwnd, NULL, MODULENAME, "ExportDlg");
if (pExportDialog)
pExportDialog = nullptr;
+ return true;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
CImportFeed::CImportFeed(CCtrlListView *m_feeds)
: CSuper(g_plugin, IDD_FEEDIMPORT),
m_importfile(this, IDC_IMPORTFILEPATH), m_browsefile(this, IDC_BROWSEIMPORTFILE),
@@ -270,7 +274,7 @@ CImportFeed::CImportFeed(CCtrlListView *m_feeds) m_feedsimportlist.OnDblClick = Callback(this, &CImportFeed::OnFeedsImportList);
}
-void CImportFeed::OnInitDialog()
+bool CImportFeed::OnInitDialog()
{
Utils_RestoreWindowPositionNoSize(m_hwnd, NULL, MODULENAME, "ImportDlg");
m_removefeed.Disable();
@@ -278,6 +282,7 @@ void CImportFeed::OnInitDialog() m_ok.Disable();
m_addfeed.Disable();
m_addallfeeds.Disable();
+ return true;
}
void CImportFeed::OnBrowseFile(CCtrlBase*)
@@ -653,13 +658,16 @@ void CImportFeed::OnOk(CCtrlBase*) }
}
-void CImportFeed::OnClose()
+bool CImportFeed::OnClose()
{
Utils_SaveWindowPosition(m_hwnd, NULL, MODULENAME, "ImportDlg");
if (pImportDialog)
pImportDialog = nullptr;
+ return true;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
CFeedEditor::CFeedEditor(int iItem, CCtrlListView *m_feeds, MCONTACT Contact)
: CSuper(g_plugin, IDD_ADDFEED),
m_feedtitle(this, IDC_FEEDTITLE), m_feedurl(this, IDC_FEEDURL),
@@ -678,7 +686,7 @@ CFeedEditor::CFeedEditor(int iItem, CCtrlListView *m_feeds, MCONTACT Contact) m_ok.OnClick = Callback(this, &CFeedEditor::OnOk);
}
-void CFeedEditor::OnInitDialog()
+bool CFeedEditor::OnInitDialog()
{
if (m_iItem == -1 && m_hContact == NULL)
SetWindowText(m_hwnd, TranslateT("Add Feed"));
@@ -764,6 +772,7 @@ void CFeedEditor::OnInitDialog() g_arFeeds.insert(this);
Utils_RestoreWindowPositionNoSize(m_hwnd, m_hContact, MODULENAME, "ChangeDlg");
}
+ return true;
}
void CFeedEditor::OnCheckFeed(CCtrlBase*)
@@ -858,12 +867,13 @@ void CFeedEditor::OnOk(CCtrlBase*) }
}
-void CFeedEditor::OnClose()
+bool CFeedEditor::OnClose()
{
g_arFeeds.remove(this);
Utils_SaveWindowPosition(m_hwnd, NULL, MODULENAME, m_iItem == -1 ? "AddDlg" : "ChangeDlg");
if (pAddFeedDialog == this)
pAddFeedDialog = nullptr;
+ return true;
}
void CFeedEditor::OnUseAuth(CCtrlBase*)
@@ -915,7 +925,7 @@ COptionsMain::COptionsMain() : }
-void COptionsMain::OnInitDialog()
+bool COptionsMain::OnInitDialog()
{
CDlgBase::OnInitDialog();
m_change.Disable();
@@ -924,9 +934,10 @@ void COptionsMain::OnInitDialog() m_feeds.AddColumn(0, TranslateT("Feed"), 160);
m_feeds.AddColumn(1, TranslateT("URL"), 276);
UpdateList();
+ return true;
}
-void COptionsMain::OnApply()
+bool COptionsMain::OnApply()
{
for (auto &hContact : Contacts(MODULENAME)) {
ptrW dbNick(db_get_wsa(hContact, MODULENAME, "Nick"));
@@ -943,6 +954,7 @@ void COptionsMain::OnApply() }
}
}
+ return true;
}
void COptionsMain::OnAddButtonClick(CCtrlBase*)
diff --git a/plugins/NewsAggregator/Src/Options.h b/plugins/NewsAggregator/Src/Options.h index 1e73f898b4..2389eb9bb9 100644 --- a/plugins/NewsAggregator/Src/Options.h +++ b/plugins/NewsAggregator/Src/Options.h @@ -13,8 +13,8 @@ private: CCtrlCheck m_checkonstartup; protected: - void OnInitDialog(); - void OnApply(); + bool OnInitDialog() override; + bool OnApply() override; void OnAddButtonClick(CCtrlBase*); void OnChangeButtonClick(CCtrlBase*); @@ -53,12 +53,13 @@ private: CCtrlButton m_ok; protected: - void OnInitDialog(); + bool OnInitDialog() override; + bool OnClose() override; + void OnCheckFeed(CCtrlBase*); void OnReset(CCtrlBase*); void OnHelp(CCtrlBase*); void OnOk(CCtrlBase*); - void OnClose(); void OnUseAuth(CCtrlBase*); public: @@ -89,14 +90,15 @@ private: CCtrlButton m_ok; protected: - void OnInitDialog(); + bool OnInitDialog() override; + bool OnClose() override; + void OnBrowseFile(CCtrlBase*); void OnAddFeed(CCtrlBase*); void OnRemoveFeed(CCtrlBase*); void OnAddAllFeeds(CCtrlBase*); void OnRemoveAllFeeds(CCtrlBase*); void OnOk(CCtrlBase*); - void OnClose(); void OnFeedsList(CCtrlBase*); void OnFeedsImportList(CCtrlBase*); @@ -119,14 +121,15 @@ private: CCtrlButton m_ok; protected: - void OnInitDialog(); + bool OnInitDialog() override; + bool OnClose() override; + void OnAddFeed(CCtrlBase*); void OnRemoveFeed(CCtrlBase*); void OnAddAllFeeds(CCtrlBase*); void OnRemoveAllFeeds(CCtrlBase*); void OnOk(CCtrlBase*); - void OnClose(); - + void OnFeedsList(CCtrlBase*); void OnFeedsExportList(CCtrlBase*); @@ -148,7 +151,8 @@ private: CCtrlButton m_ok; protected: - void OnInitDialog(); + bool OnInitDialog() override; + void OnOk(CCtrlBase*); public: diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index 079607028d..005c5e1114 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -207,7 +207,7 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) m_splitterY.OnChange = Callback(this, &CChatRoomDlg::OnSplitterY);
}
-void CChatRoomDlg::OnInitDialog()
+bool CChatRoomDlg::OnInitDialog()
{
CSuper::OnInitDialog();
m_si->pDlg = this;
@@ -263,6 +263,7 @@ void CChatRoomDlg::OnInitDialog() SendMessage(m_hwndParent, CM_ADDCHILD, (WPARAM)this, 0);
UpdateNickList();
NotifyEvent(MSG_WINDOW_EVT_OPEN);
+ return true;
}
void CChatRoomDlg::OnDestroy()
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index cda1cc92e1..96bf1e24fc 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -175,7 +175,7 @@ CSrmmWindow::CSrmmWindow(MCONTACT hContact, bool bIncoming) m_splitter.OnChange = Callback(this, &CSrmmWindow::onChanged_Splitter);
}
-void CSrmmWindow::OnInitDialog()
+bool CSrmmWindow::OnInitDialog()
{
CSuper::OnInitDialog();
@@ -371,6 +371,7 @@ void CSrmmWindow::OnInitDialog() SendMessage(m_hwnd, DM_SHOWMESSAGESENDING, 0, 0);
NotifyEvent(MSG_WINDOW_EVT_OPEN);
+ return true;
}
void CSrmmWindow::OnDestroy()
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 3989c80889..f79b71ebb4 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -272,7 +272,7 @@ public: chkSavePerContact.OnChange = Callback(this, &CMainOptionsDlg::onChange_SavePerContact);
}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
SetWindowLongPtr(m_tree.GetHwnd(), GWL_STYLE, (GetWindowLongPtr(m_tree.GetHwnd(), GWL_STYLE) & ~WS_BORDER) | TVS_NOHSCROLL | TVS_CHECKBOXES);
FillCheckBoxTree(statusValues, _countof(statusValues), db_get_dw(0, SRMM_MODULE, SRMSGSET_POPFLAGS, SRMSGDEFSET_POPFLAGS));
@@ -297,9 +297,10 @@ public: cmbSendMode.SetCurSel(g_dat.sendMode);
onChange_AutoPopup(0);
+ return true;
}
- void OnApply() override
+ bool OnApply() override
{
db_set_dw(0, SRMM_MODULE, SRMSGSET_POPFLAGS, MakeCheckBoxTreeFlags());
db_set_b(0, SRMM_MODULE, SRMSGSET_AUTOPOPUP, chkAutoPopup.GetState());
@@ -316,6 +317,7 @@ public: db_set_b(0, SRMM_MODULE, SRMSGSET_CASCADE, chkCascade.GetState());
db_set_b(0, SRMM_MODULE, SRMSGSET_HIDECONTAINERS, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_HIDECONTAINERS));
+ return true;
}
void onChange_AutoPopup(CCtrlCheck*)
@@ -358,7 +360,7 @@ public: chkSeparateChats.OnChange = Callback(this, &CTabsOptionsDlg::onChange_SeparateChats);
}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
CheckDlgButton(m_hwnd, IDC_USETABS, db_get_b(0, SRMM_MODULE, SRMSGSET_USETABS, SRMSGDEFSET_USETABS) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_ALWAYSSHOWTABS, !db_get_b(0, SRMM_MODULE, SRMSGSET_HIDEONETAB, SRMSGDEFSET_HIDEONETAB) ? BST_CHECKED : BST_UNCHECKED);
@@ -380,9 +382,10 @@ public: CheckDlgButton(m_hwnd, IDC_SEPARATECHATSCONTAINERS, db_get_b(0, SRMM_MODULE, SRMSGSET_SEPARATECHATSCONTAINERS, SRMSGDEFSET_SEPARATECHATSCONTAINERS) ? BST_CHECKED : BST_UNCHECKED);
onChange_UseTabs(0);
+ return true;
}
- void OnApply() override
+ bool OnApply() override
{
db_set_b(0, SRMM_MODULE, SRMSGSET_USETABS, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_USETABS));
db_set_b(0, SRMM_MODULE, SRMSGSET_TABSATBOTTOM, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TABSATBOTTOM));
@@ -398,6 +401,7 @@ public: db_set_b(0, SRMM_MODULE, SRMSGSET_SWITCHTOACTIVE, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SWITCHTOACTIVE));
db_set_b(0, SRMM_MODULE, SRMSGSET_TABCLOSEBUTTON, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_TABCLOSEBUTTON));
db_set_b(0, SRMM_MODULE, SRMSGSET_SEPARATECHATSCONTAINERS, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SEPARATECHATSCONTAINERS));
+ return true;
}
void onChange_UseTabs(CCtrlCheck*)
@@ -463,7 +467,7 @@ public: chkShowTitlebar.OnChange = Callback(this, &CLayoutOptionsDlg::onChange_ShowTitlebar);
}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
CheckDlgButton(m_hwnd, IDC_SHOWSTATUSBAR, db_get_b(0, SRMM_MODULE, SRMSGSET_SHOWSTATUSBAR, SRMSGDEFSET_SHOWSTATUSBAR) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_SHOWTITLEBAR, db_get_b(0, SRMM_MODULE, SRMSGSET_SHOWTITLEBAR, SRMSGDEFSET_SHOWTITLEBAR) ? BST_CHECKED : BST_UNCHECKED);
@@ -491,9 +495,10 @@ public: CheckDlgButton(m_hwnd, IDC_SHOWPROGRESS, db_get_b(0, SRMM_MODULE, SRMSGSET_SHOWPROGRESS, SRMSGDEFSET_SHOWPROGRESS) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_AVATARSUPPORT, g_dat.flags & SMF_AVATAR);
+ return true;
}
- void OnApply() override
+ bool OnApply() override
{
GetWindowText(GetDlgItem(m_hwnd, IDC_TITLEFORMAT), g_dat.wszTitleFormat, _countof(g_dat.wszTitleFormat));
db_set_ws(0, SRMM_MODULE, SRMSGSET_WINDOWTITLE, g_dat.wszTitleFormat);
@@ -513,6 +518,7 @@ public: db_set_w(0, SRMM_MODULE, SRMSGSET_AUTORESIZELINES, (WORD)SendDlgItemMessage(m_hwnd, IDC_INPUTLINESSPIN, UDM_GETPOS, 0, 0));
LoadInfobarFonts();
+ return true;
}
void onChange_Transparency(CCtrlCheck*)
@@ -607,7 +613,7 @@ public: chkIndentText.OnChange = Callback(this, &CLogOptionsDlg::onChange_IndentText);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
switch (db_get_b(0, SRMM_MODULE, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY)) {
case LOADHISTORY_UNREAD:
@@ -669,9 +675,10 @@ public: m_log.SetReadOnly(true);
OnChange();
+ return true;
}
- void OnApply() override
+ bool OnApply() override
{
if (IsDlgButtonChecked(m_hwnd, IDC_LOADCOUNT))
db_set_b(0, SRMM_MODULE, SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
@@ -698,6 +705,7 @@ public: FreeMsgLogIcons();
LoadMsgLogIcons();
+ return true;
}
void onClick_Fonts(CCtrlHyperlink*)
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index eb3754974f..a1b8704ff6 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -163,7 +163,7 @@ public: public:
CSrmmWindow(MCONTACT hContact, bool bIncoming);
- void OnInitDialog() override;
+ bool OnInitDialog() override;
void OnDestroy() override;
void ScrollToBottom() override;
@@ -207,7 +207,7 @@ class CChatRoomDlg : public CScriverWindow public:
CChatRoomDlg(SESSION_INFO *si);
- void OnInitDialog() override;
+ bool OnInitDialog() override;
void OnDestroy() override;
INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
@@ -284,7 +284,7 @@ class CErrorDlg : public CDlgBase CCtrlButton m_btnOk, m_btnCancel;
protected:
- void OnInitDialog() override;
+ bool OnInitDialog() override;
public:
CErrorDlg(const wchar_t *pwszDescr, HWND, MessageSendQueueItem*);
diff --git a/plugins/Scriver/src/msgtimedout.cpp b/plugins/Scriver/src/msgtimedout.cpp index 672b5ea81d..c003ab2913 100644 --- a/plugins/Scriver/src/msgtimedout.cpp +++ b/plugins/Scriver/src/msgtimedout.cpp @@ -43,7 +43,7 @@ CErrorDlg::CErrorDlg(const wchar_t *pwszDescr, HWND hWnd, MessageSendQueueItem * m_btnCancel.OnClick = Callback(this, &CErrorDlg::onCancel);
}
-void CErrorDlg::OnInitDialog()
+bool CErrorDlg::OnInitDialog()
{
ShowWindow(GetParent(m_hwndParent), SW_RESTORE);
@@ -59,6 +59,7 @@ void CErrorDlg::OnInitDialog() GetWindowRect(m_hwnd, &rc);
GetWindowRect(GetParent(m_hwndParent), &rcParent);
SetWindowPos(m_hwnd, HWND_TOP, rcParent.left + (rcParent.right - rcParent.left - rc.right + rc.left) / 2, rcParent.top + (rcParent.bottom - rcParent.top - rc.bottom + rc.top) / 2, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
+ return true;
}
void CErrorDlg::onOk(CCtrlButton*)
diff --git a/plugins/StartPosition/src/options.cpp b/plugins/StartPosition/src/options.cpp index cdc56bf45a..ac9991cbdb 100644 --- a/plugins/StartPosition/src/options.cpp +++ b/plugins/StartPosition/src/options.cpp @@ -49,7 +49,7 @@ COptionsDlg::COptionsDlg() : chkStartState.OnChange = Callback(this, &COptionsDlg::onCheck_StartState); } -void COptionsDlg::OnInitDialog() +bool COptionsDlg::OnInitDialog() { if (g_plugin.spOptions.clistState == ClistState::normal) chkStartNormal.SetState(true); @@ -71,9 +71,10 @@ void COptionsDlg::OnInitDialog() edtPositionBottom.Enable(chkPositionBottom.GetState()); edtPositionSide.Enable(chkPositionSide.GetState()); edtWidth.Enable(chkWidth.GetState()); + return true; } -void COptionsDlg::OnApply() +bool COptionsDlg::OnApply() { removeOldSettings(); @@ -86,6 +87,7 @@ void COptionsDlg::OnApply() g_plugin.spOptions.clistAlign = ClistAlign::right; else g_plugin.spOptions.clistAlign = ClistAlign::left; + return true; } void COptionsDlg::removeOldSettings() diff --git a/plugins/StartPosition/src/options.h b/plugins/StartPosition/src/options.h index 26e922cf11..f8d0abd5a4 100644 --- a/plugins/StartPosition/src/options.h +++ b/plugins/StartPosition/src/options.h @@ -79,8 +79,8 @@ class COptionsDlg : public CDlgBase public: COptionsDlg(); - void OnInitDialog() override; - void OnApply() override; + bool OnInitDialog() override; + bool OnApply() override; private: void removeOldSettings(); diff --git a/plugins/StatusManager/src/options.cpp b/plugins/StatusManager/src/options.cpp index 60b212d951..b2b28b0d81 100644 --- a/plugins/StatusManager/src/options.cpp +++ b/plugins/StatusManager/src/options.cpp @@ -24,7 +24,7 @@ public: CreateLink(m_enableAdvancedAutoAway, g_AAAEnabled); } - void OnApply() override + bool OnApply() override { bool bEnabled = m_enableKeepStatus.GetState(); if (bEnabled != g_KSEnabled) { @@ -49,6 +49,7 @@ public: else AdvancedAutoAwayUnload(); } + return true; } }; diff --git a/plugins/StatusManager/src/ss_options.cpp b/plugins/StatusManager/src/ss_options.cpp index 1a0ff8dbaf..833c6dd5f4 100644 --- a/plugins/StatusManager/src/ss_options.cpp +++ b/plugins/StatusManager/src/ss_options.cpp @@ -151,11 +151,12 @@ public: GetProfile(iProfileNo, ps); } - void OnInitDialog() override + bool OnInitDialog() override { char* cmdl = GetCMDL(ps); SetDlgItemTextA(m_hwnd, IDC_CMDL, cmdl); mir_free(cmdl); + return true; } void onClick_Copy(CCtrlButton*) @@ -320,7 +321,7 @@ public: chkSetWinLocation.OnChange = Callback(this, &CSSMainOptDlg::onChange_SetWinLocation); } - void OnInitDialog() override + bool OnInitDialog() override { CheckDlgButton(m_hwnd, IDC_SETPROFILE, db_get_b(0, SSMODULENAME, SETTING_SETPROFILE, 1) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(m_hwnd, IDC_OVERRIDE, db_get_b(0, SSMODULENAME, SETTING_OVERRIDE, 1) ? BST_CHECKED : BST_UNCHECKED); @@ -362,9 +363,10 @@ public: ReinitProfiles(); timer.Start(100); + return true; } - void OnApply() override + bool OnApply() override { bool bChecked = chkSetProfile.GetState(); db_set_b(0, SSMODULENAME, SETTING_SETPROFILE, bChecked); @@ -406,6 +408,7 @@ public: db_set_b(0, SSMODULENAME, SETTING_OFFLINECLOSE, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_OFFLINECLOSE)); db_set_b(0, SSMODULENAME, SETTING_AUTODIAL, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_AUTODIAL)); db_set_b(0, SSMODULENAME, SETTING_AUTOHANGUP, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_AUTOHANGUP)); + return true; } INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override @@ -495,15 +498,17 @@ public: edtProfile.OnChange = Callback(this, &CAddProfileDlg::onChange_Edit); } - void OnInitDialog() override + bool OnInitDialog() override { btnOk.Disable(); + return true; } - void OnApply() override + bool OnApply() override { ptrW profileName(edtProfile.GetText()); SendMessage(m_hwndParent, UM_ADDPROFILE, 0, (LPARAM)profileName.get()); + return true; } void OnDestroy() override @@ -660,7 +665,7 @@ public: lstAccount.OnSelChange = Callback(this, &CSSAdvancedOptDlg::onChange_Account); } - virtual void OnInitDialog() override + bool OnInitDialog() override { chkCreateMMI.SetText(TranslateT("Create a status menu item")); @@ -705,9 +710,10 @@ public: ReinitProfiles(); ShowWindow(GetDlgItem(m_hwnd, IDC_VARIABLESHELP), ServiceExists(MS_VARS_SHOWHELPEX) ? SW_SHOW : SW_HIDE); + return true; } - virtual void OnApply() override + bool OnApply() override { int oldCount = db_get_w(0, SSMODULENAME, SETTING_PROFILECOUNT, 0); for (int i = 0; i < oldCount; i++) { @@ -747,6 +753,7 @@ public: // Rebuild status menu if (bNeedRebuildMenu) Menu_ReloadProtoMenus(); + return true; } // add a profile diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index e3447fd4f2..ad9ca4f3d7 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -31,9 +31,9 @@ public: chk_HIDECONTACTS(this, ID_HIDECONTACTS), chk_IGNORESPAMMERS(this, ID_IGNORESPAMMERS), chk_LOGSPAMTOFILE(this, ID_LOGSPAMTOFILE),
ctrl_DESCRIPTION(this, ID_DESCRIPTION), edit_MAXQUESTCOUNT(this, ID_MAXQUESTCOUNT)
{
-
}
- virtual void OnInitDialog() override
+
+ bool OnInitDialog() override
{
ctrl_DESCRIPTION.SetText(TranslateW(pluginDescription));
edit_MAXQUESTCOUNT.SetInt(gbMaxQuestCount);
@@ -43,9 +43,10 @@ public: chk_HIDECONTACTS.SetState(gbHideContacts);
chk_IGNORESPAMMERS.SetState(gbIgnoreContacts);
chk_LOGSPAMTOFILE.SetState(gbLogToFile);
-
+ return true;
}
- virtual void OnApply() override
+
+ bool OnApply() override
{
db_set_dw(NULL, MODULENAME, "maxQuestCount", gbMaxQuestCount = edit_MAXQUESTCOUNT.GetInt());
db_set_b(NULL, MODULENAME, "infTalkProtection", gbInfTalkProtection = chk_INFTALKPROT.GetState());
@@ -54,7 +55,9 @@ public: db_set_b(NULL, MODULENAME, "HideContacts", gbHideContacts = chk_HIDECONTACTS.GetState());
db_set_b(NULL, MODULENAME, "IgnoreContacts", gbIgnoreContacts = chk_IGNORESPAMMERS.GetState());
db_set_b(NULL, MODULENAME, "LogSpamToFile", gbLogToFile = chk_LOGSPAMTOFILE.GetState());
+ return true;
}
+
private:
CCtrlCheck chk_INFTALKPROT, chk_ADDPERMANENT, chk_HANDLEAUTHREQ, chk_HIDECONTACTS, chk_IGNORESPAMMERS, chk_LOGSPAMTOFILE;
CCtrlData ctrl_DESCRIPTION;
@@ -72,7 +75,8 @@ public: btn_VARS.OnClick = Callback(this, &COptMessagesDlg::onClick_VARS);
}
- virtual void OnInitDialog() override
+
+ bool OnInitDialog() override
{
edit_QUESTION.SetText(gbQuestion.c_str());
edit_ANSWER.SetText(gbAnswer.c_str());
@@ -82,8 +86,10 @@ public: edit_ANSWER.Disable();
variables_skin_helpbutton(m_hwnd, IDC_VARS);
gbVarsServiceExist ? btn_VARS.Enable() : btn_VARS.Disable();
+ return true;
}
- virtual void OnApply() override
+
+ bool OnApply() override
{
db_set_ws(NULL, MODULENAME, "question", edit_QUESTION.GetText());
gbQuestion = DBGetContactSettingStringPAN(NULL, MODULENAME, "question", TranslateW(defQuestion));
@@ -93,7 +99,9 @@ public: gbAuthRepl = DBGetContactSettingStringPAN(NULL, MODULENAME, "authrepl", TranslateW(defAuthReply));
db_set_ws(NULL, MODULENAME, "congratulation", edit_CONGRATULATION.GetText());
gbCongratulation = DBGetContactSettingStringPAN(NULL, MODULENAME, "congratulation", TranslateW(defCongrats));
+ return true;
}
+
void onClick_RESTOREDEFAULTS(CCtrlButton*)
{
edit_QUESTION.SetText(TranslateW(defQuestion));
@@ -124,16 +132,17 @@ public: btn_REMOVEALL.OnClick = Callback(this, &COptProtoDlg::onClick_REMOVEALL);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
for (auto &pa : Accounts()) {
wchar_t *str = mir_utf8decodeW(pa->szModuleName);
ProtoInList(pa->szModuleName) ? list_USEDPROTO.AddString(str) : list_ALLPROTO.AddString(str);
mir_free(str);
}
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
LRESULT count = list_USEDPROTO.GetCount();
@@ -144,6 +153,7 @@ public: mir_free(str);
}
db_set_s(NULL, MODULENAME, "protoList", out.str().c_str());
+ return true;
}
void onClick_ADD(CCtrlButton*)
@@ -198,7 +208,7 @@ public: {
btn_MATH_DETAILS.OnClick = Callback(this, &COptAdvancedDlg::onClick_MATH_DETAILS);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
chk_INVIS_DISABLE.SetState(gbInvisDisable);
chk_CASE_INSENSITIVE.SetState(gbCaseInsensitive);
@@ -215,8 +225,10 @@ public: chk_HISTORY_LOG.SetState(gbHistoryLog);
chk_MATH_QUESTION.SetState(gbMathExpression);
edit_AUTOADDGROUP.SetText(gbAutoAuthGroup.c_str());
+ return true;
}
- virtual void OnApply() override
+
+ bool OnApply() override
{
db_set_b(NULL, MODULENAME, "CaseInsensitive", gbCaseInsensitive = chk_CASE_INSENSITIVE.GetState());
db_set_b(NULL, MODULENAME, "DisableInInvis", gbInvisDisable = chk_INVIS_DISABLE.GetState());
@@ -254,21 +266,20 @@ public: Clist_GroupCreate(0, gbAutoAuthGroup.c_str());
}
}
+ return true;
}
+
void onClick_MATH_DETAILS(CCtrlButton*)
{
MessageBox(m_hwnd, TranslateT("If math expression is turned on, you can use following expression in message text:\nXX+XX-X/X*X\neach X will be replaced by one random number and answer will be expression result.\nMessage must contain only one expression without spaces."), TranslateT("Info"), MB_OK);
}
+
private:
CCtrlCheck chk_INVIS_DISABLE, chk_CASE_INSENSITIVE, chk_SPECIALGROUP, chk_EXCLUDE, chk_REMOVE_TMP, chk_REMOVE_TMP_ALL, chk_IGNOREURL, chk_AUTOAUTH, chk_ADDTOSRVLST, chk_REQAUTH, chk_REGEX, chk_HISTORY_LOG, chk_MATH_QUESTION;
CCtrlEdit edit_SPECIALGROUPNAME, edit_AUTOADDGROUP;
CCtrlButton btn_MATH_DETAILS;
-
};
-
-
-
int OnOptInit(WPARAM w, LPARAM l)
{
UNREFERENCED_PARAMETER(l);
diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp index 0d9d4431bf..568479c6dc 100644 --- a/plugins/StopSpamPlus/src/options.cpp +++ b/plugins/StopSpamPlus/src/options.cpp @@ -29,9 +29,10 @@ public: CreateLink(chk6, g_sets.HistLog);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
edtDescr.SetText(pluginDescription);
+ return true;
}
};
@@ -63,10 +64,11 @@ public: CreateLink(edtDivider, g_sets.AnswSplitString);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
variables_skin_helpbutton(m_hwnd, IDC_VARS);
btnHelp.Enable(ServiceExists(MS_VARS_FORMATSTRING));
+ return true;
}
void onHelp(CCtrlButton*)
@@ -100,7 +102,7 @@ public: m_accounts.OnItemChanged = Callback(this, &COptAccountDlg::list_OnItemChanged);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
m_accounts.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
m_accounts.DeleteAllItems();
@@ -124,9 +126,10 @@ public: int idx = m_accounts.InsertItem(&item);
m_accounts.SetCheckState(idx, g_sets.ProtoDisabled(pa->szModuleName));
}
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
std::ostringstream out;
@@ -143,6 +146,7 @@ public: }
g_sets.DisabledProtoList = (char*)out.str().c_str();
+ return true;
}
void list_OnItemChanged(CCtrlListView::TEventInfo*)
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 24a17cb92a..67390c9a5e 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -600,7 +600,7 @@ public: treeCheck(this, IDC_CHECKBOXES)
{}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
SetWindowLongPtr(treeCheck.GetHwnd(), GWL_STYLE, GetWindowLongPtr(treeCheck.GetHwnd(), GWL_STYLE) | (TVS_NOHSCROLL));
@@ -615,9 +615,10 @@ public: ptrW pszGroup(db_get_wsa(0, CHAT_MODULE, "AddToGroup"));
SetDlgItemText(m_hwnd, IDC_GROUP, (pszGroup != nullptr) ? pszGroup : TranslateT("Chat rooms"));
+ return true;
}
- void OnApply() override
+ bool OnApply() override
{
int iLen = GetWindowTextLength(GetDlgItem(m_hwnd, IDC_GROUP));
if (iLen > 0) {
@@ -630,6 +631,7 @@ public: SaveBranch(branch1, _countof(branch1));
SaveBranch(branch2, _countof(branch2));
+ return true;
}
void OnDestroy() override
@@ -643,7 +645,7 @@ public: TreeViewDestroy(treeCheck.GetHwnd());
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom == IDC_CHECKBOXES)
return TreeViewHandleClick(m_hwnd, ((LPNMHDR)lParam)->hwndFrom, wParam, lParam);
@@ -678,7 +680,7 @@ public: m_timer.OnEvent = Callback(this, &CChatLogOptionDlg::onTimer);
}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
SendDlgItemMessage(m_hwnd, IDC_CHAT_SPIN2, UDM_SETRANGE, 0, MAKELONG(5000, 0));
SendDlgItemMessage(m_hwnd, IDC_CHAT_SPIN2, UDM_SETPOS, 0, MAKELONG(db_get_w(0, CHAT_MODULE, "LogLimit", 100), 0));
@@ -731,9 +733,10 @@ public: hPathTip = CreateToolTip(GetDlgItem(m_hwnd, IDC_LOGDIRECTORY), tszTooltipText, TranslateT("Variables"));
if (hPathTip)
m_timer.Start(3000);
+ return true;
}
- void OnApply() override
+ bool OnApply() override
{
char *pszText = nullptr;
@@ -800,6 +803,7 @@ public: if (g_chatApi.hListBkgBrush)
DeleteObject(g_chatApi.hListBkgBrush);
g_chatApi.hListBkgBrush = CreateSolidBrush(M.GetDword(CHAT_MODULE, "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
+ return true;
}
void OnDestroy() override
@@ -922,7 +926,7 @@ public: CChatBaseOptionDlg(IDD_OPTIONS3)
{}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
DWORD dwFilterFlags = M.GetDword(CHAT_MODULE, "FilterFlags", GC_EVENT_ALL);
DWORD dwTrayFlags = M.GetDword(CHAT_MODULE, "TrayIconFlags", GC_EVENT_HIGHLIGHT);
@@ -945,9 +949,10 @@ public: SendDlgItemMessage(m_hwnd, IDC_LOGICONTYPE, CB_SETCURSEL, (g_Settings.bLogSymbols ? 2 : (g_Settings.dwIconFlags ? 1 : 0)), 0);
CheckDlgButton(m_hwnd, IDC_TRAYONLYFORINACTIVE, M.GetByte(CHAT_MODULE, "TrayIconInactiveOnly", 0) ? BST_CHECKED : BST_UNCHECKED);
+ return true;
}
- void OnApply() override
+ bool OnApply() override
{
DWORD dwFilterFlags = 0, dwTrayFlags = 0,
dwPopupFlags = 0, dwLogFlags = 0;
@@ -971,6 +976,7 @@ public: db_set_b(0, CHAT_MODULE, "LogSymbols", lr == 2 ? 1 : 0);
db_set_b(0, CHAT_MODULE, "TrayIconInactiveOnly", IsDlgButtonChecked(m_hwnd, IDC_TRAYONLYFORINACTIVE) ? 1 : 0);
+ return true;
}
};
@@ -994,7 +1000,7 @@ public: chkText.OnChange = Callback(this, &CHighlighOptionDlg::onChange_Text);
}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
ptrW wszText(db_get_wsa(0, CHAT_MODULE, "HighlightWords"));
if (wszText)
@@ -1011,6 +1017,7 @@ public: ::CheckDlgButton(m_hwnd, IDC_HIGHLIGHTNICKUID, dwFlags & CMUCHighlight::MATCH_UIN ? BST_CHECKED : BST_UNCHECKED);
::CheckDlgButton(m_hwnd, IDC_HIGHLIGHTME, M.GetByte(CHAT_MODULE, "HighlightMe", 1) ? BST_CHECKED : BST_UNCHECKED);
+ return true;
}
void onChange_Text(CCtrlCheck*)
@@ -1027,7 +1034,7 @@ public: Utils::enableDlgControl(m_hwnd, IDC_HIGHLIGHTNICKUID, chkNick.GetState());
}
- void OnApply() override
+ bool OnApply() override
{
db_set_ws(0, CHAT_MODULE, "HighlightNames", ptrW(edtNick.GetText()));
db_set_ws(0, CHAT_MODULE, "HighlightWords", ptrW(edtText.GetText()));
@@ -1039,6 +1046,7 @@ public: db_set_b(0, CHAT_MODULE, "HighlightEnabled", dwFlags);
db_set_b(0, CHAT_MODULE, "HighlightMe", ::IsDlgButtonChecked(m_hwnd, IDC_HIGHLIGHTME) ? 1 : 0);
g_Settings.Highlight->init();
+ return true;
}
};
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index 1f2e3d9920..f28927637e 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -497,7 +497,7 @@ void CChatRoomDlg::tabClearLog() } } -void CChatRoomDlg::OnInitDialog() +bool CChatRoomDlg::OnInitDialog() { CTabBaseDlg::OnInitDialog(); @@ -566,6 +566,7 @@ void CChatRoomDlg::OnInitDialog() UpdateNickList(); m_pContainer->m_hwndActive = m_hwnd; NotifyEvent(MSG_WINDOW_EVT_OPEN); + return true; } void CChatRoomDlg::OnDestroy() diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 4c7ddf8301..b63fe36d79 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -603,7 +603,7 @@ CThumbBase* CSrmmWindow::tabCreateThumb(CProxyWindow *pProxy) const return new CThumbIM(pProxy);
}
-void CSrmmWindow::OnInitDialog()
+bool CSrmmWindow::OnInitDialog()
{
CTabBaseDlg::OnInitDialog();
@@ -850,6 +850,7 @@ void CSrmmWindow::OnInitDialog() m_pContainer->dwFlags &= ~CNT_CREATE_MINIMIZED;
m_pContainer->m_hwndActive = m_hwnd;
}
+ return true;
}
void CSrmmWindow::OnDestroy()
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index acdc82c788..1d9615ebd8 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -585,7 +585,7 @@ public: btnReset.OnClick = Callback(this, &COptMainDlg::onClick_Reset);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
TreeViewInit(GetDlgItem(m_hwnd, IDC_WINDOWOPTIONS), CTranslator::TREE_MSG, 0, FALSE);
@@ -593,9 +593,10 @@ public: spnAvaSize.SetRange(150);
spnAvaSize.SetPosition(M.GetDword("avatarheight", 100));
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
db_set_dw(0, SRMSGMOD_T, "avatarheight", spnAvaSize.GetPosition());
db_set_b(0, SRMSGMOD_T, "dontscaleavatars", chkAvaPreserve.GetState());
@@ -604,9 +605,10 @@ public: TreeViewToDB(GetDlgItem(m_hwnd, IDC_WINDOWOPTIONS), CTranslator::TREE_MSG, SRMSGMOD_T, nullptr);
PluginConfig.reloadSettings();
Srmm_Broadcast(DM_OPTIONSAPPLIED, 1, 0);
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
TreeViewDestroy(GetDlgItem(m_hwnd, IDC_WINDOWOPTIONS));
}
@@ -617,7 +619,7 @@ public: db_set_dw(0, SRMSGMOD_T, "cWarningsH", 0);
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom == IDC_WINDOWOPTIONS)
return TreeViewHandleClick(m_hwnd, ((LPNMHDR)lParam)->hwndFrom, wParam, lParam);
@@ -682,7 +684,7 @@ public: have_hpp = ServiceExists("History++/ExtGrid/NewWindow") != 0;
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
DWORD dwFlags = M.GetDword("mwflags", MWF_LOG_DEFAULT);
@@ -744,9 +746,10 @@ public: SetDlgItemText(m_hwnd, IDC_EXPLAINMSGLOGSETTINGS, TranslateT("You have chosen to use an external plugin for displaying the message history in the chat window. Most of the settings on this page are for the standard message log viewer only and will have no effect. To change the appearance of the message log, you must configure either IEView or History++."));
ShowHide();
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
LRESULT msglogmode = cmbLogDisplay.GetCurSel();
DWORD dwFlags = M.GetDword("mwflags", MWF_LOG_DEFAULT);
@@ -790,9 +793,10 @@ public: db_set_dw(0, SRMSGMOD_T, "maxhist", 0);
PluginConfig.reloadSettings();
Srmm_Broadcast(DM_OPTIONSAPPLIED, 1, 0);
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
TreeViewDestroy(GetDlgItem(m_hwnd, IDC_LOGOPTIONS));
}
@@ -833,7 +837,7 @@ public: ShowHide();
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom == IDC_LOGOPTIONS)
return TreeViewHandleClick(m_hwnd, ((LPNMHDR)lParam)->hwndFrom, wParam, lParam);
@@ -910,7 +914,7 @@ public: chkNotifyPopup.OnChange = Callback(this, &COptTypingDlg::onCheck_NotifyPopup);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
CLCINFOITEM cii = { sizeof(cii) };
cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
@@ -951,9 +955,10 @@ public: Utils::showDlgControl(m_hwnd, IDC_STATIC111, SW_HIDE);
Utils::showDlgControl(m_hwnd, IDC_MTN_POPUPMODE, SW_HIDE);
}
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
SaveList();
db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPING, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWNOTIFY));
@@ -965,9 +970,10 @@ public: db_set_b(0, SRMSGMOD, "ShowTypingPopup", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYPOPUP));
db_set_b(0, SRMSGMOD_T, "MTN_PopupMode", (BYTE)SendDlgItemMessage(m_hwnd, IDC_MTN_POPUPMODE, CB_GETCURSEL, 0, 0));
PluginConfig.reloadSettings();
+ return true;
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_NOTIFY && ((NMHDR*)lParam)->idFrom == IDC_CLIST) {
switch (((NMHDR*)lParam)->code) {
@@ -1035,7 +1041,7 @@ public: chkLimit.OnChange = Callback(this, &COptTabbedDlg::onChange_Cut);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
TreeViewInit(GetDlgItem(m_hwnd, IDC_TABMSGOPTIONS), CTranslator::TREE_TAB, 0, FALSE);
@@ -1048,9 +1054,10 @@ public: cmbEscMode.AddString(TranslateT("Minimize the window to the task bar"));
cmbEscMode.AddString(TranslateT("Close or hide window, depends on the close button setting above"));
cmbEscMode.SetCurSel(PluginConfig.m_EscapeCloses);
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
db_set_w(0, SRMSGMOD_T, "cut_at", spnLimit.GetPosition());
db_set_b(0, SRMSGMOD_T, "cuttitle", chkLimit.GetState());
@@ -1060,9 +1067,10 @@ public: PluginConfig.reloadSettings();
Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0);
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
TreeViewDestroy(GetDlgItem(m_hwnd, IDC_TABMSGOPTIONS));
}
@@ -1080,7 +1088,7 @@ public: spnLimit.Enable(bEnabled);
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_COMMAND && wParam == DM_STATUSMASKSET)
db_set_dw(0, SRMSGMOD_T, "autopopupmask", (DWORD)lParam);
@@ -1131,7 +1139,7 @@ public: chkLimits.OnChange = chkSingle.OnChange = chkGroup.OnChange = chkDefault.OnChange = Callback(this, &COptContainersDlg::onChangeLimits);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
chkGroup.SetState(M.GetByte("useclistgroups", 0));
chkLimits.SetState(M.GetByte("limittabs", 0));
@@ -1161,9 +1169,10 @@ public: chkUseAeroPeek.Enable(PluginConfig.m_bIsWin7);
if (PluginConfig.m_bIsVista)
Utils::enableDlgControl(m_hwnd, IDC_AEROEFFECT, chkUseAero.GetState() != 0);
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
bool fOldAeroState = M.getAeroState();
@@ -1182,6 +1191,7 @@ public: SendMessage(PluginConfig.g_hwndHotkeyHandler, WM_DWMCOLORIZATIONCOLORCHANGED, 0, 0); // simulate aero state change
}
BuildContainerMenu();
+ return true;
}
};
@@ -1205,7 +1215,7 @@ public: btnRevert.OnClick = Callback(this, &COptAdvancedDlg::onClick_Revert);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
TreeViewInit(GetDlgItem(m_hwnd, IDC_PLUS_CHECKTREE), CTranslator::TREE_MODPLUS, 0, FALSE);
@@ -1214,9 +1224,10 @@ public: spnHistSize.SetRange(255, 15);
spnHistSize.SetPosition(M.GetByte("historysize", 0));
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
TreeViewToDB(GetDlgItem(m_hwnd, IDC_PLUS_CHECKTREE), CTranslator::TREE_MODPLUS, SRMSGMOD_T, nullptr);
@@ -1226,14 +1237,15 @@ public: db_set_b(0, SRMSGMOD_T, "historysize", spnHistSize.GetPosition());
PluginConfig.reloadAdv();
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
TreeViewDestroy(GetDlgItem(m_hwnd, IDC_PLUS_CHECKTREE));
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom == IDC_PLUS_CHECKTREE)
return TreeViewHandleClick(m_hwnd, ((LPNMHDR)lParam)->hwndFrom, wParam, lParam);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 2e7bdbdd95..8eef8a5e26 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -91,7 +91,7 @@ void CTabBaseDlg::LoadSettings() LoadLogfont(FONTSECTION_IM, MSGFONTID_MESSAGEAREA, nullptr, &m_clrInputFG, FONTMODULE);
}
-void CTabBaseDlg::OnInitDialog()
+bool CTabBaseDlg::OnInitDialog()
{
CSrmmBaseDialog::OnInitDialog();
@@ -119,6 +119,7 @@ void CTabBaseDlg::OnInitDialog() m_cache->updateUIN();
m_bIsAutosizingInput = IsAutoSplitEnabled();
+ return true;
}
INT_PTR CTabBaseDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index b212ae4e81..14f630fee2 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -373,8 +373,8 @@ public: CTabBaseDlg(int iDialogId, SESSION_INFO* = nullptr);
virtual ~CTabBaseDlg();
- virtual void OnInitDialog() override;
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ bool OnInitDialog() override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
virtual CThumbBase* tabCreateThumb(CProxyWindow*) const = 0;
virtual void tabClearLog() = 0;
@@ -486,14 +486,14 @@ public: public:
CSrmmWindow();
- virtual void OnInitDialog() override;
- virtual void OnDestroy() override;
+ bool OnInitDialog() override;
+ void OnDestroy() override;
- virtual int Resizer(UTILRESIZECONTROL *urc) override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
- virtual void UpdateTitle() override;
+ void UpdateTitle() override;
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
void onClick_Ok(CCtrlButton*);
void onClick_Add(CCtrlButton*);
@@ -534,23 +534,23 @@ class CChatRoomDlg : public CTabBaseDlg public:
CChatRoomDlg(SESSION_INFO*);
- virtual void OnInitDialog() override;
- virtual void OnDestroy() override;
+ bool OnInitDialog() override;
+ void OnDestroy() override;
- virtual int Resizer(UTILRESIZECONTROL *urc) override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
- virtual void AddLog() override;
- virtual void CloseTab() override;
- virtual void RedrawLog() override;
- virtual void ScrollToBottom() override;
- virtual void ShowFilterMenu() override;
- virtual void StreamInEvents(LOGINFO* lin, bool bRedraw) override;
- virtual void UpdateNickList() override;
- virtual void UpdateOptions() override;
- virtual void UpdateStatusBar() override;
- virtual void UpdateTitle() override;
-
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ void AddLog() override;
+ void CloseTab() override;
+ void RedrawLog() override;
+ void ScrollToBottom() override;
+ void ShowFilterMenu() override;
+ void StreamInEvents(LOGINFO* lin, bool bRedraw) override;
+ void UpdateNickList() override;
+ void UpdateOptions() override;
+ void UpdateStatusBar() override;
+ void UpdateTitle() override;
+
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
void onClick_OK(CCtrlButton*);
void onClick_Filter(CCtrlButton*);
@@ -585,10 +585,10 @@ class CTemplateEditDlg : public CTabBaseDlg public:
CTemplateEditDlg(BOOL rtl, HWND hwndParent);
- virtual void OnInitDialog() override;
- virtual void OnDestroy() override;
+ bool OnInitDialog() override;
+ void OnDestroy() override;
- virtual INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
+ INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
void onChange_Text(CCtrlEdit*);
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 0c2db1ff55..fefd3f78df 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -143,7 +143,7 @@ CTemplateEditDlg::CTemplateEditDlg(BOOL _rtl, HWND hwndParent) : btnResetAll.OnClick = Callback(this, &CTemplateEditDlg::onClick_Reset); } -void CTemplateEditDlg::OnInitDialog() +bool CTemplateEditDlg::OnInitDialog() { // set hContact to the first found contact so that we can use the Preview window properly // also, set other parameters needed by the streaming function to display events @@ -184,6 +184,7 @@ void CTemplateEditDlg::OnInitDialog() SendDlgItemMessage(m_hwnd, IDC_COLOR4, CPM_SETCOLOUR, 0, M.GetDword("cc4", SRMSGDEFSET_BKGCOLOUR)); SendDlgItemMessage(m_hwnd, IDC_COLOR5, CPM_SETCOLOUR, 0, M.GetDword("cc5", SRMSGDEFSET_BKGCOLOUR)); SendDlgItemMessage(m_hwnd, IDC_EDITTEMPLATE, EM_SETREADONLY, TRUE, 0); + return true; } void CTemplateEditDlg::OnDestroy() diff --git a/plugins/Toaster/src/options.cpp b/plugins/Toaster/src/options.cpp index 6a027ac84f..326d6ef369 100644 --- a/plugins/Toaster/src/options.cpp +++ b/plugins/Toaster/src/options.cpp @@ -11,9 +11,10 @@ COptions::COptions() m_enabled.OnChange = Callback(this, &COptions::Enabled_OnChange);
}
-void COptions::OnInitDialog()
+bool COptions::OnInitDialog()
{
m_enabled.SetState(CallService(MS_POPUP_QUERY, PUQS_GETSTATUS));
+ return true;
}
void COptions::Shortcut_OnClick(CCtrlBase*)
diff --git a/plugins/Toaster/src/options.h b/plugins/Toaster/src/options.h index 73d50a9877..2a74e72a97 100644 --- a/plugins/Toaster/src/options.h +++ b/plugins/Toaster/src/options.h @@ -9,7 +9,7 @@ private: CCtrlCheck m_enabled;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
void Shortcut_OnClick(CCtrlBase*);
void Preview_OnClick(CCtrlBase*);
diff --git a/plugins/Watrack_MPD/src/options.cpp b/plugins/Watrack_MPD/src/options.cpp index c05fffc223..652e2766a7 100755 --- a/plugins/Watrack_MPD/src/options.cpp +++ b/plugins/Watrack_MPD/src/options.cpp @@ -22,7 +22,8 @@ public: COptWaMpdDlg() : CDlgBase(g_plugin, IDD_OPT_WA_MPD), edit_PORT(this, IDC_PORT), edit_SERVER(this, IDC_SERVER), edit_PASSWORD(this, IDC_PASSWORD) {} - virtual void OnInitDialog() override + + bool OnInitDialog() override { edit_PORT.SetInt(db_get_w(NULL, MODULENAME, "Port", 6600)); wchar_t *tmp = UniGetContactSettingUtf(NULL, MODULENAME, "Server", L"127.0.0.1"); @@ -31,8 +32,10 @@ public: tmp = UniGetContactSettingUtf(NULL, MODULENAME, "Password", L""); edit_PASSWORD.SetText(tmp); mir_free(tmp); + return true; } - virtual void OnApply() override + + bool OnApply() override { db_set_w(NULL, MODULENAME, "Port", (WORD)edit_PORT.GetInt()); gbPort = edit_PORT.GetInt(); @@ -40,7 +43,9 @@ public: mir_wstrcpy(gbHost, edit_SERVER.GetText()); db_set_ws(NULL, MODULENAME, "Password", edit_PASSWORD.GetText()); mir_wstrcpy(gbPassword, edit_PASSWORD.GetText()); + return true; } + private: CCtrlSpin edit_PORT; CCtrlEdit edit_SERVER, edit_PASSWORD; diff --git a/protocols/Discord/src/options.cpp b/protocols/Discord/src/options.cpp index b291f98cdd..04947f76e2 100644 --- a/protocols/Discord/src/options.cpp +++ b/protocols/Discord/src/options.cpp @@ -39,20 +39,22 @@ public: CreateLink(chkHideChats, ppro->m_bHideGroupchats); } - virtual void OnInitDialog() override + bool OnInitDialog() override { ptrW buf(m_proto->getWStringA(DB_KEY_PASSWORD)); if (buf) m_edPassword.SetText(buf); + return true; } - virtual void OnApply() override + bool OnApply() override { if (mir_wstrcmp(m_proto->m_wszDefaultGroup, m_wszOldGroup)) Clist_GroupCreate(0, m_proto->m_wszDefaultGroup); ptrW buf(m_edPassword.GetText()); m_proto->setWString(DB_KEY_PASSWORD, buf); + return true; } }; diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp index 7e9447fd02..dce5630ca9 100644 --- a/protocols/FacebookRM/src/dialogs.cpp +++ b/protocols/FacebookRM/src/dialogs.cpp @@ -632,13 +632,14 @@ CFacebookGuardDialog::CFacebookGuardDialog(FacebookProto *proto, const char *fb_ m_sms.OnClick = Callback(this, &CFacebookGuardDialog::OnSms); } -void CFacebookGuardDialog::OnInitDialog() +bool CFacebookGuardDialog::OnInitDialog() { Window_SetIcon_IcoLib(m_hwnd, GetIconHandle("facebook")); SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 6, 0); Utils_RestoreWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "GuardWindow"); + return true; } void CFacebookGuardDialog::OnOk(CCtrlButton*) @@ -653,9 +654,10 @@ void CFacebookGuardDialog::OnSms(CCtrlButton *btn) m_proto->facy.sms_code(m_fb_dtsg); } -void CFacebookGuardDialog::OnClose() +bool CFacebookGuardDialog::OnClose() { Utils_SaveWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "GuardWindow"); + return true; } const char* CFacebookGuardDialog::GetCode() diff --git a/protocols/FacebookRM/src/dialogs.h b/protocols/FacebookRM/src/dialogs.h index 33229c7f6c..85d6ffff44 100644 --- a/protocols/FacebookRM/src/dialogs.h +++ b/protocols/FacebookRM/src/dialogs.h @@ -46,10 +46,11 @@ private: CCtrlButton m_sms;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
+ bool OnClose() override;
+
void OnOk(CCtrlButton*);
void OnSms(CCtrlButton*);
- void OnClose();
public:
CFacebookGuardDialog(FacebookProto *proto, const char *fb_dtsg);
diff --git a/protocols/Gadu-Gadu/src/options.cpp b/protocols/Gadu-Gadu/src/options.cpp index 5abcd75209..b1b1d4af99 100644 --- a/protocols/Gadu-Gadu/src/options.cpp +++ b/protocols/Gadu-Gadu/src/options.cpp @@ -32,7 +32,7 @@ GaduOptionsDlgConference::GaduOptionsDlgConference(GaduProto *proto) : CreateLink(cmbDefaultChatPolicy, GG_KEY_GC_POLICY_DEFAULT, DBVT_WORD, GG_KEYDEF_GC_POLICY_DEFAULT); } -void GaduOptionsDlgConference::OnInitDialog() +bool GaduOptionsDlgConference::OnInitDialog() { cmbPolicyForAllChatParticipants.AddString(TranslateT("Allow"), 0L); cmbPolicyForAllChatParticipants.AddString(TranslateT("Ask"), 1L); @@ -55,9 +55,10 @@ void GaduOptionsDlgConference::OnInitDialog() cmbDefaultChatPolicy.AddString(TranslateT("Ignore"), 2L); listIndex = m_proto->getWord(GG_KEY_GC_POLICY_DEFAULT, GG_KEYDEF_GC_POLICY_DEFAULT); cmbDefaultChatPolicy.SetCurSel(listIndex); + return true; } -void GaduOptionsDlgConference::OnApply() +bool GaduOptionsDlgConference::OnApply() { int selectionIndex = cmbPolicyForAllChatParticipants.GetCurSel(); m_proto->setWord(GG_KEY_GC_POLICY_TOTAL, cmbPolicyForAllChatParticipants.GetItemData(selectionIndex)); @@ -67,8 +68,10 @@ void GaduOptionsDlgConference::OnApply() selectionIndex = cmbDefaultChatPolicy.GetCurSel(); m_proto->setWord(GG_KEY_GC_POLICY_DEFAULT, cmbDefaultChatPolicy.GetItemData(selectionIndex)); + return true; } +///////////////////////////////////////////////////////////////////////////////////////// GaduOptionsDlgAdvanced::GaduOptionsDlgAdvanced(GaduProto *proto) : GaduDlgBase(proto, IDD_OPT_GG_ADVANCED), @@ -114,7 +117,7 @@ GaduOptionsDlgAdvanced::GaduOptionsDlgAdvanced(GaduProto *proto) : edtForwardPort.OnChange = Callback(this, &GaduOptionsDlgAdvanced::showRecconectRequired); } -void GaduOptionsDlgAdvanced::OnInitDialog() +bool GaduOptionsDlgAdvanced::OnInitDialog() { chkKeepConnectionAlive.Disable(); chkSslConnection.Disable(); @@ -136,6 +139,7 @@ void GaduOptionsDlgAdvanced::OnInitDialog() txtForwardPortLabel.Enable(useForwarding); txtReconnectRequired.Hide(); + return true; } void GaduOptionsDlgAdvanced::onCheck_ManualHosts(CCtrlCheck *) diff --git a/protocols/Gadu-Gadu/src/options.h b/protocols/Gadu-Gadu/src/options.h index 4a58f042a5..8e8694d25e 100644 --- a/protocols/Gadu-Gadu/src/options.h +++ b/protocols/Gadu-Gadu/src/options.h @@ -38,8 +38,8 @@ private: public: GaduOptionsDlgConference(GaduProto *proto); - void OnInitDialog() override; - void OnApply() override; + bool OnInitDialog() override; + bool OnApply() override; }; class GaduOptionsDlgAdvanced : public GaduDlgBase @@ -70,7 +70,7 @@ private: public: GaduOptionsDlgAdvanced(GaduProto *proto); - void OnInitDialog() override; + bool OnInitDialog() override; private: void onCheck_ManualHosts(CCtrlCheck*); diff --git a/protocols/IRCG/src/irc_dlg.h b/protocols/IRCG/src/irc_dlg.h index 0d74f61258..f4d7d1363b 100644 --- a/protocols/IRCG/src/irc_dlg.h +++ b/protocols/IRCG/src/irc_dlg.h @@ -38,10 +38,10 @@ struct CCoolIrcDlg : public CProtoDlgBase < CIrcProto > {
CCoolIrcDlg(CIrcProto* _pro, int dlgId);
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
- virtual void OnInitDialog();
- virtual void OnDestroy();
+ bool OnInitDialog() override;
+ void OnDestroy() override;
};
struct CWhoisDlg : public CCoolIrcDlg
@@ -65,9 +65,9 @@ struct CWhoisDlg : public CCoolIrcDlg void OnTime(CCtrlButton*);
void OnVersion(CCtrlButton*);
- virtual void OnInitDialog();
- virtual void OnClose();
- virtual void OnDestroy();
+ bool OnInitDialog() override;
+ bool OnClose() override;
+ void OnDestroy() override;
};
struct CNickDlg : public CCoolIrcDlg
@@ -77,8 +77,8 @@ struct CNickDlg : public CCoolIrcDlg CCtrlCombo m_Enick;
CCtrlButton m_Ok;
- virtual void OnInitDialog();
- virtual void OnDestroy();
+ bool OnInitDialog() override;
+ void OnDestroy() override;
void OnOk(CCtrlButton*);
};
@@ -87,10 +87,11 @@ struct CListDlg : public CProtoDlgBase < CIrcProto > {
CListDlg(CIrcProto* _pro);
- virtual void OnInitDialog();
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
- virtual void OnDestroy();
- virtual int Resizer(UTILRESIZECONTROL *urc);
+ bool OnInitDialog() override;
+ void OnDestroy() override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
+
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
CCtrlListView m_list, m_list2;
CCtrlEdit m_filter, m_status;
@@ -109,8 +110,8 @@ struct CJoinDlg : public CCoolIrcDlg {
CJoinDlg(CIrcProto* _pro);
- virtual void OnInitDialog();
- virtual void OnDestroy();
+ bool OnInitDialog() override;
+ void OnDestroy() override;
CCtrlButton m_Ok;
void OnOk(CCtrlButton*);
@@ -120,8 +121,8 @@ struct CQuickDlg : public CCoolIrcDlg {
CQuickDlg(CIrcProto* _pro);
- virtual void OnInitDialog();
- virtual void OnDestroy();
+ bool OnInitDialog() override;
+ void OnDestroy() override;
CCtrlCombo m_serverCombo;
void OnServerCombo(CCtrlData*);
@@ -144,9 +145,9 @@ struct CManagerDlg : public CCoolIrcDlg CCtrlMButton m_add, m_edit, m_remove, m_applyTopic, m_applyModes;
CCtrlListBox m_list;
- virtual void OnInitDialog();
- virtual void OnClose();
- virtual void OnDestroy();
+ bool OnInitDialog() override;
+ bool OnClose() override;
+ void OnDestroy() override;
void OnCheck(CCtrlData*);
void OnCheck5(CCtrlData*);
@@ -174,8 +175,8 @@ struct CQuestionDlg : public CCoolIrcDlg {
CQuestionDlg(CIrcProto* _pro, CManagerDlg* owner = nullptr);
- virtual void OnInitDialog();
- virtual void OnClose();
+ bool OnInitDialog() override;
+ bool OnClose() override;
CCtrlButton m_Ok;
void OnOk(CCtrlButton*);
@@ -211,8 +212,8 @@ struct CConnectPrefsDlg : public CProtoDlgBase < CIrcProto > CConnectPrefsDlg(CIrcProto* _pro);
- virtual void OnInitDialog();
- virtual void OnApply();
+ bool OnInitDialog() override;
+ bool OnApply() override;
void OnServerCombo(CCtrlData*);
void OnAddServer(CCtrlButton*);
@@ -223,7 +224,6 @@ struct CConnectPrefsDlg : public CProtoDlgBase < CIrcProto > void OnUseServer(CCtrlData*);
void OnOnlineNotif(CCtrlData*);
void OnChannelAway(CCtrlData*);
- void OnRetry(CCtrlData*);
};
//---- the second property page: DCC/CTCP -----------------------------------------------
@@ -237,8 +237,8 @@ struct CCtcpPrefsDlg : public CProtoDlgBase < CIrcProto > CCtcpPrefsDlg(CIrcProto* _pro);
- virtual void OnInitDialog();
- virtual void OnApply();
+ bool OnInitDialog() override;
+ bool OnApply() override;
void OnClicked(CCtrlData*);
};
@@ -257,9 +257,9 @@ struct COtherPrefsDlg : public CProtoDlgBase < CIrcProto > COtherPrefsDlg(CIrcProto* _pro);
- virtual void OnInitDialog();
- virtual void OnApply();
- virtual void OnDestroy();
+ bool OnInitDialog() override;
+ bool OnApply() override;
+ void OnDestroy() override;
void OnPerformCombo(CCtrlData*);
void OnCodePage(CCtrlData*);
@@ -281,11 +281,11 @@ struct CIgnorePrefsDlg : public CProtoDlgBase < CIrcProto > CIgnorePrefsDlg(CIrcProto* _pro);
- virtual void OnInitDialog();
- virtual void OnDestroy();
- virtual void OnApply();
+ bool OnInitDialog() override;
+ void OnDestroy() override;
+ bool OnApply() override;
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
void List_OnColumnClick(CCtrlListView::TEventInfo*);
void OnEnableIgnore(CCtrlData*);
@@ -308,8 +308,8 @@ struct CAddIgnoreDlg : public CProtoDlgBase < CIrcProto > CAddIgnoreDlg(CIrcProto* _pro, const wchar_t* mask, CIgnorePrefsDlg* parent);
- virtual void OnInitDialog();
- virtual void OnClose();
+ bool OnInitDialog() override;
+ bool OnClose() override;
void OnOk(CCtrlButton*);
};
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 8160d70e30..e84d0d00e2 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -300,7 +300,7 @@ struct CServerDlg : public CProtoDlgBase<CIrcProto> m_autoClose = CLOSE_ON_CANCEL;
}
- virtual void OnInitDialog()
+ bool OnInitDialog() override
{
int i = m_owner->m_serverCombo.GetCount();
for (int index = 0; index < i; index++) {
@@ -340,14 +340,16 @@ struct CServerDlg : public CProtoDlgBase<CIrcProto> EnableWindow(GetDlgItem(m_hwnd, IDC_AUTO), bEnableSsl);
SetFocus(m_groupCombo.GetHwnd());
+ return true;
}
- virtual void OnClose()
+ bool OnClose() override
{
m_owner->m_serverCombo.Enable();
m_owner->m_add.Enable();
m_owner->m_edit.Enable();
m_owner->m_del.Enable();
+ return true;
}
void OnOk(CCtrlButton*)
@@ -480,7 +482,7 @@ CConnectPrefsDlg::CConnectPrefsDlg(CIrcProto* _pro) m_channelAway.OnChange = Callback(this, &CConnectPrefsDlg::OnChannelAway);
}
-void CConnectPrefsDlg::OnInitDialog()
+bool CConnectPrefsDlg::OnInitDialog()
{
m_proto->m_hwndConnect = m_hwnd;
@@ -556,6 +558,7 @@ void CConnectPrefsDlg::OnInitDialog() m_port.Enable(!m_proto->m_disableDefaultServer);
m_port2.Enable(!m_proto->m_disableDefaultServer);
m_pass.Enable(!m_proto->m_disableDefaultServer);
+ return true;
}
void CConnectPrefsDlg::OnServerCombo(CCtrlData*)
@@ -676,7 +679,7 @@ void CConnectPrefsDlg::OnChannelAway(CCtrlData*) m_limit.Enable(m_onlineNotif.GetState() && m_channelAway.GetState());
}
-void CConnectPrefsDlg::OnApply()
+bool CConnectPrefsDlg::OnApply()
{
//Save the setting in the CONNECT dialog
if (m_enableServer.GetState()) {
@@ -772,6 +775,7 @@ void CConnectPrefsDlg::OnApply() }
m_proto->WriteSettings(ConnectSettings, _countof(ConnectSettings));
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -811,7 +815,7 @@ CCtcpPrefsDlg::CCtcpPrefsDlg(CIrcProto* _pro) m_fromServer.OnChange = Callback(this, &CCtcpPrefsDlg::OnClicked);
}
-void CCtcpPrefsDlg::OnInitDialog()
+bool CCtcpPrefsDlg::OnInitDialog()
{
m_userInfo.SetText(m_proto->m_userInfo);
@@ -863,6 +867,7 @@ void CCtcpPrefsDlg::OnInitDialog() else m_ip.SetText(TranslateT("<Automatic>"));
}
}
+ return true;
}
void CCtcpPrefsDlg::OnClicked(CCtrlData*)
@@ -890,7 +895,7 @@ void CCtcpPrefsDlg::OnClicked(CCtrlData*) }
}
-void CCtcpPrefsDlg::OnApply()
+bool CCtcpPrefsDlg::OnApply()
{
m_userInfo.GetText(m_proto->m_userInfo, _countof(m_proto->m_userInfo));
@@ -919,6 +924,7 @@ void CCtcpPrefsDlg::OnApply() m_proto->m_DCCChatAccept = 3;
m_proto->WriteSettings(CtcpSettings, _countof(CtcpSettings));
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -993,7 +999,7 @@ COtherPrefsDlg::COtherPrefsDlg(CIrcProto* _pro) m_delete.OnClick = Callback(this, &COtherPrefsDlg::OnDelete);
}
-void COtherPrefsDlg::OnInitDialog()
+bool COtherPrefsDlg::OnInitDialog()
{
mir_subclassWindow(m_alias.GetHwnd(), EditSubclassProc);
mir_subclassWindow(m_quitMessage.GetHwnd(), EditSubclassProc);
@@ -1039,6 +1045,7 @@ void COtherPrefsDlg::OnInitDialog() m_performCombo.SetCurSel(0);
OnPerformCombo(nullptr);
m_autodetect.SetState(m_proto->m_utfAutodetect);
+ return true;
}
void COtherPrefsDlg::OnPerformCombo(CCtrlData*)
@@ -1128,7 +1135,7 @@ void COtherPrefsDlg::OnDestroy() }
}
-void COtherPrefsDlg::OnApply()
+bool COtherPrefsDlg::OnApply()
{
mir_free(m_proto->m_alias);
m_proto->m_alias = m_alias.GetText();
@@ -1159,6 +1166,7 @@ void COtherPrefsDlg::OnApply() }
}
m_proto->WriteSettings(OtherSettings, _countof(OtherSettings));
+ return true;
}
void COtherPrefsDlg::addPerformComboValue(int idx, const char* szValueName)
@@ -1194,7 +1202,7 @@ CAddIgnoreDlg::CAddIgnoreDlg(CIrcProto* _pro, const wchar_t* mask, CIgnorePrefsD m_Ok.OnClick = Callback(this, &CAddIgnoreDlg::OnOk);
}
-void CAddIgnoreDlg::OnInitDialog()
+bool CAddIgnoreDlg::OnInitDialog()
{
if (szOldMask[0] == 0) {
if (m_proto->IsConnected())
@@ -1205,6 +1213,7 @@ void CAddIgnoreDlg::OnInitDialog() CheckDlgButton(m_hwnd, IDC_D, BST_CHECKED);
CheckDlgButton(m_hwnd, IDC_C, BST_CHECKED);
}
+ return true;
}
void CAddIgnoreDlg::OnOk(CCtrlButton*)
@@ -1235,9 +1244,10 @@ void CAddIgnoreDlg::OnOk(CCtrlButton*) }
}
-void CAddIgnoreDlg::OnClose()
+bool CAddIgnoreDlg::OnClose()
{
m_owner->FixButtons();
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1400,7 +1410,7 @@ CIgnorePrefsDlg::CIgnorePrefsDlg(CIrcProto* _pro) m_list.OnColumnClick = Callback(this, &CIgnorePrefsDlg::List_OnColumnClick);
}
-void CIgnorePrefsDlg::OnInitDialog()
+bool CIgnorePrefsDlg::OnInitDialog()
{
m_proto->m_ignoreDlg = this;
mir_subclassWindow(m_list.GetHwnd(), ListviewSubclassProc);
@@ -1437,6 +1447,7 @@ void CIgnorePrefsDlg::OnInitDialog() ListView_SetExtendedListViewStyle(GetDlgItem(m_hwnd, IDC_INFO_LISTVIEW), LVS_EX_FULLROWSELECT);
RebuildList();
+ return true;
}
INT_PTR CIgnorePrefsDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
@@ -1534,7 +1545,7 @@ void CIgnorePrefsDlg::List_OnColumnClick(CCtrlListView::TEventInfo*) UpdateList();
}
-void CIgnorePrefsDlg::OnApply()
+bool CIgnorePrefsDlg::OnApply()
{
m_proto->m_DCCFileEnabled = !m_ignoreFile.GetState();
m_proto->m_DCCChatEnabled = !m_ignoreChat.GetState();
@@ -1542,6 +1553,7 @@ void CIgnorePrefsDlg::OnApply() m_proto->m_ignoreChannelDefault = m_ignoreChannel.GetState();
m_proto->m_DCCChatIgnore = m_ignoreUnknown.GetState() ? 2 : 1;
m_proto->WriteSettings(IgnoreSettings, _countof(IgnoreSettings));
+ return true;
}
void CIgnorePrefsDlg::OnDestroy()
@@ -1741,7 +1753,7 @@ struct CDlgAccMgrUI : public CProtoDlgBase<CIrcProto> m_serverCombo.OnChange = Callback(this, &CDlgAccMgrUI::OnChangeCombo);
}
- virtual void OnInitDialog()
+ bool OnInitDialog() override
{
for (auto &si : g_servers)
m_serverCombo.AddStringA(si->m_name, LPARAM(si));
@@ -1761,9 +1773,10 @@ struct CDlgAccMgrUI : public CProtoDlgBase<CIrcProto> m_nick2.SetText(m_proto->m_alternativeNick);
m_userID.SetText(m_proto->m_userID);
m_name.SetText(m_proto->m_name);
+ return true;
}
- virtual void OnApply()
+ bool OnApply() override
{
m_proto->m_serverComboSelection = m_serverCombo.GetCurSel();
m_server.GetTextA(m_proto->m_serverName, _countof(m_proto->m_serverName));
@@ -1780,6 +1793,7 @@ struct CDlgAccMgrUI : public CProtoDlgBase<CIrcProto> removeSpaces(m_proto->m_userID);
m_name.GetText(m_proto->m_name, _countof(m_proto->m_name));
m_proto->WriteSettings(ConnectSettings, _countof(ConnectSettings));
+ return true;
}
void OnChangeCombo(CCtrlCombo*)
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp index 6810e439b8..6e402fcc40 100644 --- a/protocols/IRCG/src/windows.cpp +++ b/protocols/IRCG/src/windows.cpp @@ -76,7 +76,7 @@ CWhoisDlg::CWhoisDlg(CIrcProto *_pro) m_Query.OnClick = Callback(this, &CWhoisDlg::OnQuery);
}
-void CWhoisDlg::OnInitDialog()
+bool CWhoisDlg::OnInitDialog()
{
LOGFONT lf;
HFONT hFont = (HFONT)m_AwayTime.SendMsg(WM_GETFONT, 0, 0);
@@ -88,12 +88,14 @@ void CWhoisDlg::OnInitDialog() CCoolIrcDlg::OnInitDialog();
Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_WHOIS));
+ return true;
}
-void CWhoisDlg::OnClose()
+bool CWhoisDlg::OnClose()
{
ShowWindow(m_hwnd, SW_HIDE);
SendMessage(m_hwnd, WM_SETREDRAW, FALSE, 0);
+ return true;
}
void CWhoisDlg::OnDestroy()
@@ -205,7 +207,7 @@ CNickDlg::CNickDlg(CIrcProto *_pro) m_Ok.OnClick = Callback(this, &CNickDlg::OnOk);
}
-void CNickDlg::OnInitDialog()
+bool CNickDlg::OnInitDialog()
{
CCoolIrcDlg::OnInitDialog();
Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_RENAME));
@@ -218,6 +220,7 @@ void CNickDlg::OnInitDialog() db_free(&dbv);
}
+ return true;
}
void CNickDlg::OnDestroy()
@@ -263,7 +266,7 @@ CListDlg::CListDlg(CIrcProto *_pro) m_filter.OnChange = Callback(this, &CListDlg::onChange_Filter);
}
-void CListDlg::OnInitDialog()
+bool CListDlg::OnInitDialog()
{
RECT screen;
@@ -295,6 +298,7 @@ void CListDlg::OnInitDialog() m_list2.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_LIST));
m_status.SetText(TranslateT("Please wait..."));
+ return true;
}
INT_PTR CListDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
@@ -498,7 +502,7 @@ CJoinDlg::CJoinDlg(CIrcProto *_pro) m_Ok.OnClick = Callback(this, &CJoinDlg::OnOk);
}
-void CJoinDlg::OnInitDialog()
+bool CJoinDlg::OnInitDialog()
{
CCoolIrcDlg::OnInitDialog();
@@ -513,6 +517,7 @@ void CJoinDlg::OnInitDialog() }
db_free(&dbv);
}
+ return true;
}
void CJoinDlg::OnDestroy()
@@ -558,7 +563,7 @@ CQuickDlg::CQuickDlg(CIrcProto *_pro) m_serverCombo.OnChange = Callback(this, &CQuickDlg::OnServerCombo);
}
-void CQuickDlg::OnInitDialog()
+bool CQuickDlg::OnInitDialog()
{
CCoolIrcDlg::OnInitDialog();
@@ -600,6 +605,7 @@ void CQuickDlg::OnInitDialog() OnServerCombo(nullptr);
}
else EnableWindow(GetDlgItem(m_hwnd, IDOK), false);
+ return true;
}
void CQuickDlg::OnDestroy()
@@ -708,17 +714,19 @@ CQuestionDlg::CQuestionDlg(CIrcProto *_pro, CManagerDlg *owner) m_Ok.OnClick = Callback(this, &CQuestionDlg::OnOk);
}
-void CQuestionDlg::OnInitDialog()
+bool CQuestionDlg::OnInitDialog()
{
CCoolIrcDlg::OnInitDialog();
Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_IRCQUESTION));
+ return true;
}
-void CQuestionDlg::OnClose()
+bool CQuestionDlg::OnClose()
{
if (m_owner)
m_owner->CloseQuestion();
+ return true;
}
void CQuestionDlg::OnOk(CCtrlButton*)
@@ -861,7 +869,7 @@ LRESULT CALLBACK MgrEditSubclassProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARA return mir_callNextSubclass(m_hwnd, MgrEditSubclassProc, msg, wParam, lParam);
}
-void CManagerDlg::OnInitDialog()
+bool CManagerDlg::OnInitDialog()
{
CCoolIrcDlg::OnInitDialog();
@@ -886,16 +894,15 @@ void CManagerDlg::OnInitDialog() if (!strchr(modes, 'p')) m_check7.Disable();
if (!strchr(modes, 's')) m_check8.Disable();
if (!strchr(modes, 'c')) m_check9.Disable();
+ return true;
}
-void CManagerDlg::OnClose()
+bool CManagerDlg::OnClose()
{
if (m_applyModes.Enabled() || m_applyTopic.Enabled()) {
int i = MessageBox(nullptr, TranslateT("You have not applied all changes!\n\nApply before exiting?"), TranslateT("IRC warning"), MB_YESNOCANCEL | MB_ICONWARNING | MB_DEFBUTTON3);
- if (i == IDCANCEL) {
- m_lresult = TRUE;
- return;
- }
+ if (i == IDCANCEL)
+ return false;
if (i == IDYES) {
if (m_applyModes.Enabled())
@@ -927,6 +934,7 @@ void CManagerDlg::OnClose() mir_free(p);
}
DestroyWindow(m_hwnd);
+ return true;
}
void CManagerDlg::OnDestroy()
@@ -1373,7 +1381,7 @@ CCoolIrcDlg::CCoolIrcDlg(CIrcProto* _pro, int dlgId) : CProtoDlgBase<CIrcProto>(_pro, dlgId)
{}
-void CCoolIrcDlg::OnInitDialog()
+bool CCoolIrcDlg::OnInitDialog()
{
HFONT hFont = (HFONT)SendDlgItemMessage(m_hwnd, IDC_CAPTION, WM_GETFONT, 0, 0);
@@ -1385,6 +1393,7 @@ void CCoolIrcDlg::OnInitDialog() SendDlgItemMessage(m_hwnd, IDC_CAPTION, WM_SETFONT, (WPARAM)hFont, 0);
SendDlgItemMessage(m_hwnd, IDC_LOGO, STM_SETICON, (LPARAM)(HICON)LoadIconEx(IDI_LOGO), 0);
+ return true;
}
void CCoolIrcDlg::OnDestroy()
diff --git a/protocols/IcqOscarJ/src/askauthentication.cpp b/protocols/IcqOscarJ/src/askauthentication.cpp index 998390767e..1afcac4f89 100644 --- a/protocols/IcqOscarJ/src/askauthentication.cpp +++ b/protocols/IcqOscarJ/src/askauthentication.cpp @@ -43,13 +43,14 @@ public: m_btnOk.OnClick = Callback(this, &AskAuthProcDlg::onOk);
}
- virtual void OnInitDialog()
+ bool OnInitDialog() override
{
if (!m_hContact || !m_proto->icqOnline())
EndDialog(m_hwnd, 0);
m_auth.SendMsg(EM_LIMITTEXT, 255, 0);
m_auth.SetText(TranslateT("Please authorize me to add you to my contact list."));
+ return true;
}
void onOk(CCtrlButton*)
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)
diff --git a/protocols/SkypeWeb/src/skype_dialogs.cpp b/protocols/SkypeWeb/src/skype_dialogs.cpp index 231b1025d6..2e1a6aefdc 100644 --- a/protocols/SkypeWeb/src/skype_dialogs.cpp +++ b/protocols/SkypeWeb/src/skype_dialogs.cpp @@ -37,11 +37,12 @@ CSkypeInviteDlg::CSkypeInviteDlg(CSkypeProto *proto) : m_ok.OnClick = Callback(this, &CSkypeInviteDlg::btnOk_OnOk);
}
-void CSkypeInviteDlg::OnInitDialog()
+bool CSkypeInviteDlg::OnInitDialog()
{
for (auto &hContact : m_proto->AccContacts())
if (!m_proto->isChatRoom(hContact))
m_combo.AddString(Clist_GetContactDisplayName(hContact), hContact);
+ return true;
}
void CSkypeInviteDlg::btnOk_OnOk(CCtrlButton*)
@@ -64,13 +65,14 @@ CSkypeGCCreateDlg::~CSkypeGCCreateDlg() m_ContactsList.destroy();
}
-void CSkypeGCCreateDlg::OnInitDialog()
+bool CSkypeGCCreateDlg::OnInitDialog()
{
SetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE,
GetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE) | CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE);
m_clc.SendMsg(CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT, 0);
ResetListOptions(&m_clc);
+ return true;
}
void CSkypeGCCreateDlg::btnOk_OnOk(CCtrlButton*)
diff --git a/protocols/SkypeWeb/src/skype_dialogs.h b/protocols/SkypeWeb/src/skype_dialogs.h index 7b2fc0c2e2..e13f48dccf 100644 --- a/protocols/SkypeWeb/src/skype_dialogs.h +++ b/protocols/SkypeWeb/src/skype_dialogs.h @@ -29,8 +29,8 @@ private: CCtrlCombo m_combo;
protected:
-
- void OnInitDialog();
+ bool OnInitDialog() override;
+
void btnOk_OnOk(CCtrlButton*);
public:
@@ -48,15 +48,13 @@ private: CCtrlClc m_clc;
protected:
+ bool OnInitDialog() override;
- void OnInitDialog();
void btnOk_OnOk(CCtrlButton*);
void FilterList(CCtrlClc*);
void ResetListOptions(CCtrlClc*);
-
public:
-
LIST<char> m_ContactsList;
CSkypeGCCreateDlg(CSkypeProto *proto);
diff --git a/protocols/SkypeWeb/src/skype_options.cpp b/protocols/SkypeWeb/src/skype_options.cpp index cf92dfd198..7e689c427f 100644 --- a/protocols/SkypeWeb/src/skype_options.cpp +++ b/protocols/SkypeWeb/src/skype_options.cpp @@ -38,7 +38,7 @@ CSkypeOptionsMain::CSkypeOptionsMain(CSkypeProto *proto, int idDialog) m_usehostname.OnChange = Callback(this, &CSkypeOptionsMain::OnUsehostnameCheck);
}
-void CSkypeOptionsMain::OnInitDialog()
+bool CSkypeOptionsMain::OnInitDialog()
{
CSkypeDlgBase::OnInitDialog();
@@ -48,10 +48,10 @@ void CSkypeOptionsMain::OnInitDialog() m_skypename.SendMsg(EM_LIMITTEXT, 32, 0);
m_password.SendMsg(EM_LIMITTEXT, 128, 0);
m_group.SendMsg(EM_LIMITTEXT, 64, 0);
+ return true;
}
-
-void CSkypeOptionsMain::OnApply()
+bool CSkypeOptionsMain::OnApply()
{
ptrA szNewSkypename(m_skypename.GetTextA()),
szOldSkypename(m_proto->getStringA(SKYPE_SETTINGS_ID));
@@ -64,6 +64,7 @@ void CSkypeOptionsMain::OnApply() ptrW group(m_group.GetText());
if (mir_wstrlen(group) > 0 && !Clist_GroupExists(group))
Clist_GroupCreate(0, group);
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/SkypeWeb/src/skype_options.h b/protocols/SkypeWeb/src/skype_options.h index 6856e01e3b..59df858290 100644 --- a/protocols/SkypeWeb/src/skype_options.h +++ b/protocols/SkypeWeb/src/skype_options.h @@ -34,8 +34,8 @@ private: protected:
CSkypeOptionsMain(CSkypeProto *proto, int idDialog);
- void OnInitDialog();
- void OnApply();
+ bool OnInitDialog() override;
+ bool OnApply() override;
void OnUsehostnameCheck(CCtrlCheck*);
public:
diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index 569ee3de8f..7e5cd0f93d 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -7,7 +7,7 @@ CSteamPasswordEditor::CSteamPasswordEditor(CSteamProto *proto) m_ok.OnClick = Callback(this, &CSteamPasswordEditor::OnOk);
}
-void CSteamPasswordEditor::OnInitDialog()
+bool CSteamPasswordEditor::OnInitDialog()
{
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, "main");
@@ -16,6 +16,7 @@ void CSteamPasswordEditor::OnInitDialog() SendMessage(m_password.GetHwnd(), EM_LIMITTEXT, 64, 0);
Utils_RestoreWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "PasswordWindow");
+ return true;
}
void CSteamPasswordEditor::OnOk(CCtrlButton*)
@@ -27,9 +28,10 @@ void CSteamPasswordEditor::OnOk(CCtrlButton*) EndDialog(m_hwnd, DIALOG_RESULT_OK);
}
-void CSteamPasswordEditor::OnClose()
+bool CSteamPasswordEditor::OnClose()
{
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "PasswordWindow");
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////
@@ -45,7 +47,7 @@ CSteamGuardDialog::CSteamGuardDialog(CSteamProto *proto, const char *domain) m_ok.OnClick = Callback(this, &CSteamGuardDialog::OnOk);
}
-void CSteamGuardDialog::OnInitDialog()
+bool CSteamGuardDialog::OnInitDialog()
{
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, "main");
@@ -54,6 +56,7 @@ void CSteamGuardDialog::OnInitDialog() SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 5, 0);
Utils_RestoreWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "GuardWindow");
+ return true;
}
void CSteamGuardDialog::OnOk(CCtrlButton*)
@@ -62,9 +65,10 @@ void CSteamGuardDialog::OnOk(CCtrlButton*) EndDialog(m_hwnd, DIALOG_RESULT_OK);
}
-void CSteamGuardDialog::OnClose()
+bool CSteamGuardDialog::OnClose()
{
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "GuardWindow");
+ return true;
}
const char* CSteamGuardDialog::GetGuardCode()
@@ -83,7 +87,7 @@ m_text(this, IDC_TEXT) m_ok.OnClick = Callback(this, &CSteamTwoFactorDialog::OnOk);
}
-void CSteamTwoFactorDialog::OnInitDialog()
+bool CSteamTwoFactorDialog::OnInitDialog()
{
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, "main");
@@ -92,6 +96,7 @@ void CSteamTwoFactorDialog::OnInitDialog() SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 5, 0);
Utils_RestoreWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "TwoFactorWindow");
+ return true;
}
void CSteamTwoFactorDialog::OnOk(CCtrlButton*)
@@ -100,9 +105,10 @@ void CSteamTwoFactorDialog::OnOk(CCtrlButton*) EndDialog(m_hwnd, DIALOG_RESULT_OK);
}
-void CSteamTwoFactorDialog::OnClose()
+bool CSteamTwoFactorDialog::OnClose()
{
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "TwoFactorWindow");
+ return true;
}
const char* CSteamTwoFactorDialog::GetTwoFactorCode()
@@ -130,7 +136,7 @@ CSteamCaptchaDialog::~CSteamCaptchaDialog() mir_free(m_captchaImage);
}
-void CSteamCaptchaDialog::OnInitDialog()
+bool CSteamCaptchaDialog::OnInitDialog()
{
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, "main");
@@ -139,6 +145,7 @@ void CSteamCaptchaDialog::OnInitDialog() SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 6, 0);
Utils_RestoreWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "CaptchaWindow");
+ return true;
}
void CSteamCaptchaDialog::OnOk(CCtrlButton*)
@@ -147,9 +154,10 @@ void CSteamCaptchaDialog::OnOk(CCtrlButton*) EndDialog(m_hwnd, DIALOG_RESULT_OK);
}
-void CSteamCaptchaDialog::OnClose()
+bool CSteamCaptchaDialog::OnClose()
{
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "CaptchaWindow");
+ return true;
}
INT_PTR CSteamCaptchaDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/protocols/Steam/src/steam_dialogs.h b/protocols/Steam/src/steam_dialogs.h index 20d6a60f48..8086114c42 100644 --- a/protocols/Steam/src/steam_dialogs.h +++ b/protocols/Steam/src/steam_dialogs.h @@ -16,9 +16,10 @@ private: CCtrlButton m_ok;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
+ bool OnClose() override;
+
void OnOk(CCtrlButton*);
- void OnClose();
public:
CSteamPasswordEditor(CSteamProto *proto);
@@ -37,9 +38,10 @@ private: CCtrlHyperlink m_link;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
+ bool OnClose() override;
+
void OnOk(CCtrlButton*);
- void OnClose();
public:
CSteamGuardDialog(CSteamProto *proto, const char *domain);
@@ -58,9 +60,10 @@ private: CCtrlButton m_ok;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
+ bool OnClose() override;
+
void OnOk(CCtrlButton*);
- void OnClose();
public:
CSteamTwoFactorDialog(CSteamProto *proto);
@@ -82,11 +85,11 @@ private: CCtrlButton m_ok;
protected:
- void OnInitDialog();
- void OnOk(CCtrlButton*);
- void OnClose();
+ bool OnInitDialog() override;
+ bool OnClose() override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
+ void OnOk(CCtrlButton*);
public:
CSteamCaptchaDialog(CSteamProto *proto, const uint8_t *captchaImage, int captchaImageSize);
diff --git a/protocols/Steam/src/steam_options.cpp b/protocols/Steam/src/steam_options.cpp index 92fd87152e..74c51a82c5 100644 --- a/protocols/Steam/src/steam_options.cpp +++ b/protocols/Steam/src/steam_options.cpp @@ -19,7 +19,7 @@ CSteamOptionsMain::CSteamOptionsMain(CSteamProto *proto, int idDialog, HWND hwnd }
}
-void CSteamOptionsMain::OnInitDialog()
+bool CSteamOptionsMain::OnInitDialog()
{
CSteamDlgBase::OnInitDialog();
@@ -28,9 +28,10 @@ void CSteamOptionsMain::OnInitDialog() SendMessage(m_group.GetHwnd(), EM_LIMITTEXT, 64, 0);
m_pollingErrorLimit.SetRange(255, 0);
+ return true;
}
-void CSteamOptionsMain::OnApply()
+bool CSteamOptionsMain::OnApply()
{
ptrW group(m_group.GetText());
if (mir_wstrcmp(group, m_proto->m_defaultGroup)) {
@@ -46,6 +47,7 @@ void CSteamOptionsMain::OnApply() }
if (m_password.IsChanged())
m_proto->delSetting("TokenSecret");
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////
@@ -59,12 +61,13 @@ CSteamOptionsBlockList::CSteamOptionsBlockList(CSteamProto *proto) m_add.OnClick = Callback(this, &CSteamOptionsBlockList::OnBlock);
}
-void CSteamOptionsBlockList::OnInitDialog()
+bool CSteamOptionsBlockList::OnInitDialog()
{
m_list.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);
m_list.AddColumn(0, TranslateT("Name"), 220);
m_list.AddColumn(1, L"", 32 - GetSystemMetrics(SM_CXVSCROLL));
+ return true;
}
void CSteamOptionsBlockList::OnBlock(CCtrlButton*)
diff --git a/protocols/Steam/src/steam_options.h b/protocols/Steam/src/steam_options.h index d0aaf03bd9..a71e6ae2fa 100644 --- a/protocols/Steam/src/steam_options.h +++ b/protocols/Steam/src/steam_options.h @@ -16,8 +16,8 @@ private: protected:
CSteamOptionsMain(CSteamProto *proto, int idDialog, HWND hwndParent = NULL);
- void OnInitDialog();
- void OnApply();
+ bool OnInitDialog() override;
+ bool OnApply() override;
public:
static CDlgBase *CreateAccountManagerPage(void *param, HWND owner)
@@ -42,7 +42,7 @@ private: CCtrlButton m_add;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
void OnBlock(CCtrlButton*);
public:
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 3cc61ec397..ef923e6fef 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -37,7 +37,7 @@ CToxOptionsMain::CToxOptionsMain(CToxProto *proto, int idDialog) m_profileExport.OnClick = Callback(this, &CToxOptionsMain::ProfileExport_OnClick);
}
-void CToxOptionsMain::OnInitDialog()
+bool CToxOptionsMain::OnInitDialog()
{
CToxDlgBase::OnInitDialog();
@@ -68,6 +68,7 @@ void CToxOptionsMain::OnInitDialog() m_maxConnectRetries.SetRange(255, 1);
m_maxReconnectRetries.SetRange(255, 1);
+ return true;
}
void CToxOptionsMain::PasswordCreate_OnClick(CCtrlButton*)
@@ -226,7 +227,7 @@ void CToxOptionsMain::ProfileExport_OnClick(CCtrlButton*) CopyFile(defaultProfilePath, profilePath, FALSE);
}
-void CToxOptionsMain::OnApply()
+bool CToxOptionsMain::OnApply()
{
ptrW group(m_group.GetText());
if (mir_wstrcmp(group, m_proto->m_defaultGroup)) {
@@ -242,6 +243,7 @@ void CToxOptionsMain::OnApply() m_proto->SaveToxProfile(m_proto->m_toxThread->Tox());
}
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////
@@ -257,7 +259,7 @@ CToxNodeEditor::CToxNodeEditor(int iItem, CCtrlListView *m_nodes) m_ok.OnClick = Callback(this, &CToxNodeEditor::OnOk);
}
-void CToxNodeEditor::OnInitDialog()
+bool CToxNodeEditor::OnInitDialog()
{
SetWindowText(m_hwnd, m_iItem == -1 ? TranslateT("Add node") : TranslateT("Change node"));
@@ -286,6 +288,7 @@ void CToxNodeEditor::OnInitDialog() }
Utils_RestoreWindowPositionNoSize(m_hwnd, NULL, MODULE, "EditNodeDlg");
+ return true;
}
void CToxNodeEditor::OnOk(CCtrlBase*)
@@ -325,12 +328,12 @@ void CToxNodeEditor::OnOk(CCtrlBase*) EndDialog(m_hwnd, 1);
}
-void CToxNodeEditor::OnClose()
+bool CToxNodeEditor::OnClose()
{
Utils_SaveWindowPosition(m_hwnd, NULL, MODULE, "EditNodeDlg");
+ return true;
}
-
/****************************************/
CToxOptionsNodeList::CToxOptionsNodeList(CToxProto *proto)
@@ -345,7 +348,7 @@ CToxOptionsNodeList::CToxOptionsNodeList(CToxProto *proto) m_nodes.OnKeyDown = Callback(this, &CToxOptionsNodeList::OnNodeListKeyDown);
}
-void CToxOptionsNodeList::OnInitDialog()
+bool CToxOptionsNodeList::OnInitDialog()
{
m_nodes.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);
@@ -367,6 +370,7 @@ void CToxOptionsNodeList::OnInitDialog() m_nodes.AddGroup(1, TranslateT("User nodes"));
ReloadNodeList();
+ return true;
}
void CToxOptionsNodeList::OnAddNode(CCtrlBase*)
@@ -484,7 +488,7 @@ void CToxOptionsNodeList::ReloadNodeList() }
}
-void CToxOptionsNodeList::OnApply()
+bool CToxOptionsNodeList::OnApply()
{
char setting[MAX_PATH];
wchar_t tszText[MAX_PATH];
@@ -543,6 +547,7 @@ void CToxOptionsNodeList::OnApply() db_unset(NULL, module, setting);
}
db_set_b(NULL, module, TOX_SETTINGS_NODE_COUNT, itemCount);
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/Tox/src/tox_options.h b/protocols/Tox/src/tox_options.h index 74987139da..374bfbb5af 100644 --- a/protocols/Tox/src/tox_options.h +++ b/protocols/Tox/src/tox_options.h @@ -28,7 +28,7 @@ private: CCtrlSpin m_maxReconnectRetries;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
void PasswordCreate_OnClick(CCtrlButton*);
void PasswordChange_OnClick(CCtrlButton*);
@@ -41,7 +41,7 @@ protected: void ProfileImport_OnClick(CCtrlButton*);
void ProfileExport_OnClick(CCtrlButton*);
- void OnApply();
+ bool OnApply() override;
public:
CToxOptionsMain(CToxProto *proto, int idDialog);
@@ -75,9 +75,10 @@ private: CCtrlButton m_ok;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
+ bool OnClose() override;
+
void OnOk(CCtrlBase*);
- void OnClose();
public:
CToxNodeEditor(int iItem, CCtrlListView *m_list);
@@ -96,8 +97,8 @@ private: CCtrlButton m_updateNodes;
protected:
- void OnInitDialog();
- void OnApply();
+ bool OnInitDialog() override;
+ bool OnApply() override;
void ReloadNodeList();
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp index 76744445e5..d90c1a08f9 100644 --- a/protocols/Tox/src/tox_profile.cpp +++ b/protocols/Tox/src/tox_profile.cpp @@ -200,9 +200,10 @@ CToxEnterPasswordDlg::CToxEnterPasswordDlg(CToxProto *proto) m_ok.OnClick = Callback(this, &CToxEnterPasswordDlg::OnOk);
}
-void CToxEnterPasswordDlg::OnInitDialog()
+bool CToxEnterPasswordDlg::OnInitDialog()
{
m_ok.Disable();
+ return true;
}
void CToxEnterPasswordDlg::Password_OnChange(CCtrlBase*)
@@ -230,7 +231,7 @@ CToxCreatePasswordDlg::CToxCreatePasswordDlg(CToxProto *proto) m_ok.OnClick = Callback(this, &CToxCreatePasswordDlg::OnOk);
}
-void CToxCreatePasswordDlg::OnInitDialog()
+bool CToxCreatePasswordDlg::OnInitDialog()
{
LOGFONT lf;
HFONT hFont = (HFONT)m_passwordValidation.SendMsg(WM_GETFONT, 0, 0);
@@ -239,6 +240,7 @@ void CToxCreatePasswordDlg::OnInitDialog() m_passwordValidation.SendMsg(WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), 0);
m_ok.Disable();
+ return true;
}
void CToxCreatePasswordDlg::Password_OnChange(CCtrlBase*)
@@ -284,7 +286,7 @@ CToxChangePasswordDlg::CToxChangePasswordDlg(CToxProto *proto) m_ok.OnClick = Callback(this, &CToxChangePasswordDlg::OnOk);
}
-void CToxChangePasswordDlg::OnInitDialog()
+bool CToxChangePasswordDlg::OnInitDialog()
{
LOGFONT lf;
HFONT hFont = (HFONT)m_passwordValidation.SendMsg(WM_GETFONT, 0, 0);
@@ -293,6 +295,7 @@ void CToxChangePasswordDlg::OnInitDialog() m_passwordValidation.SendMsg(WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), 0);
m_ok.Disable();
+ return true;
}
void CToxChangePasswordDlg::Password_OnChange(CCtrlBase*)
diff --git a/protocols/Tox/src/tox_profile.h b/protocols/Tox/src/tox_profile.h index 4aedae071f..fd23665c90 100644 --- a/protocols/Tox/src/tox_profile.h +++ b/protocols/Tox/src/tox_profile.h @@ -11,7 +11,8 @@ private: CCtrlButton m_ok;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
+
void Password_OnChange(CCtrlBase*);
void OnOk(CCtrlButton*);
@@ -32,7 +33,8 @@ private: CCtrlButton m_ok;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
+
void Password_OnChange(CCtrlBase*);
void OnOk(CCtrlButton*);
@@ -55,7 +57,8 @@ private: CCtrlButton m_ok;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
+
void Password_OnChange(CCtrlBase*);
void OnOk(CCtrlButton*);
diff --git a/protocols/VKontakte/src/vk_dialogs.cpp b/protocols/VKontakte/src/vk_dialogs.cpp index fafc0bcd69..fd394cd67c 100644 --- a/protocols/VKontakte/src/vk_dialogs.cpp +++ b/protocols/VKontakte/src/vk_dialogs.cpp @@ -32,13 +32,14 @@ CVkCaptchaForm::CVkCaptchaForm(CVkProto *proto, CAPTCHA_FORM_PARAMS *param) : m_edtValue.OnChange = Callback(this, &CVkCaptchaForm::On_edtValue_Change);
}
-void CVkCaptchaForm::OnInitDialog()
+bool CVkCaptchaForm::OnInitDialog()
{
Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_KEYS));
m_btnOk.Disable();
m_btnOpenInBrowser.Enable((m_param->bmp != nullptr));
m_instruction.SetText(TranslateT("Enter the text you see"));
+ return true;
}
INT_PTR CVkCaptchaForm::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
@@ -115,7 +116,7 @@ CVkWallPostForm::CVkWallPostForm(CVkProto *proto, WALLPOST_FORM_PARAMS *param) : m_edtUrl.OnChange = Callback(this, &CVkWallPostForm::On_edtValue_Change);
}
-void CVkWallPostForm::OnInitDialog()
+bool CVkWallPostForm::OnInitDialog()
{
Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_WALL));
@@ -123,6 +124,7 @@ void CVkWallPostForm::OnInitDialog() SetCaption(wszTitle);
m_btnShare.Disable();
+ return true;
}
void CVkWallPostForm::OnDestroy()
@@ -155,11 +157,12 @@ CVkInviteChatForm::CVkInviteChatForm(CVkProto *proto) : m_btnOk.OnClick = Callback(this, &CVkInviteChatForm::btnOk_OnOk);
}
-void CVkInviteChatForm::OnInitDialog()
+bool CVkInviteChatForm::OnInitDialog()
{
for (auto &hContact : m_proto->AccContacts())
if (!m_proto->isChatRoom(hContact))
m_cbxCombo.AddString(Clist_GetContactDisplayName(hContact), hContact);
+ return true;
}
void CVkInviteChatForm::btnOk_OnOk(CCtrlButton*)
@@ -180,13 +183,14 @@ CVkGCCreateForm::CVkGCCreateForm(CVkProto *proto) : m_clCList.OnListRebuilt = Callback(this, &CVkGCCreateForm::FilterList);
}
-void CVkGCCreateForm::OnInitDialog()
+bool CVkGCCreateForm::OnInitDialog()
{
SetWindowLongPtr(m_clCList.GetHwnd(), GWL_STYLE, GetWindowLongPtr(m_clCList.GetHwnd(), GWL_STYLE)
| CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE);
m_clCList.SendMsg(CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT, 0);
ResetListOptions(&m_clCList);
+ return true;
}
void CVkGCCreateForm::btnOk_OnOk(CCtrlButton*)
@@ -253,7 +257,7 @@ CVkContactDeleteForm::CVkContactDeleteForm(CVkProto *proto, CONTACTDELETE_FORM_P m_btnOk.OnClick = Callback(this, &CVkContactDeleteForm::btnOk_OnOk);
}
-void CVkContactDeleteForm::OnInitDialog()
+bool CVkContactDeleteForm::OnInitDialog()
{
CMStringW szText(FORMAT, TranslateT("You delete %s from the contact list.\nWhat needs to be done additionally?"),
m_param->pwszNick);
@@ -271,6 +275,7 @@ void CVkContactDeleteForm::OnInitDialog() szText.Format(TranslateT("Deleting %s from contact list"), m_param->pwszNick);
SetCaption(szText.c_str());
+ return true;
}
void CVkContactDeleteForm::btnOk_OnOk(CCtrlButton*)
diff --git a/protocols/VKontakte/src/vk_dialogs.h b/protocols/VKontakte/src/vk_dialogs.h index 51bbdfa433..ba77fc52db 100644 --- a/protocols/VKontakte/src/vk_dialogs.h +++ b/protocols/VKontakte/src/vk_dialogs.h @@ -39,9 +39,12 @@ class CVkCaptchaForm : public CVkDlgBase public:
CVkCaptchaForm(CVkProto *proto, CAPTCHA_FORM_PARAMS *param);
- void OnInitDialog();
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
- void OnDestroy();
+
+ bool OnInitDialog() override;
+ void OnDestroy() override;
+
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+
void On_btnOpenInBrowser_Click(CCtrlButton*);
void On_btnOk_Click(CCtrlButton*);
void On_edtValue_Change(CCtrlEdit*);
@@ -83,8 +86,10 @@ class CVkWallPostForm : public CVkDlgBase public:
CVkWallPostForm(CVkProto *proto, WALLPOST_FORM_PARAMS *param);
- void OnInitDialog();
+
+ bool OnInitDialog() override;
void OnDestroy();
+
void On_btnShare_Click(CCtrlButton*);
void On_edtValue_Change(CCtrlEdit*);
};
@@ -100,7 +105,9 @@ public: MCONTACT m_hContact;
CVkInviteChatForm(CVkProto *proto);
- void OnInitDialog();
+
+ bool OnInitDialog() override;
+
void btnOk_OnOk(CCtrlButton*);
};
@@ -114,7 +121,8 @@ class CVkGCCreateForm : public CVkDlgBase public:
CVkGCCreateForm(CVkProto *proto);
- void OnInitDialog();
+ bool OnInitDialog() override;
+
void btnOk_OnOk(CCtrlButton*);
void FilterList(CCtrlClc*);
void ResetListOptions(CCtrlClc*);
@@ -150,6 +158,7 @@ class CVkContactDeleteForm : public CVkDlgBase public:
CVkContactDeleteForm(CVkProto *proto, CONTACTDELETE_FORM_PARAMS *param);
- void OnInitDialog();
+ bool OnInitDialog() override;
+
void btnOk_OnOk(CCtrlButton*);
};
\ No newline at end of file diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp index beb9171e58..36e4d7f73a 100644 --- a/protocols/VKontakte/src/vk_options.cpp +++ b/protocols/VKontakte/src/vk_options.cpp @@ -39,7 +39,7 @@ CVkAccMgrForm::CVkAccMgrForm(CVkProto *proto, HWND hwndParent) : CreateLink(m_edtLogin, "Login", L"");
}
-void CVkAccMgrForm::OnInitDialog()
+bool CVkAccMgrForm::OnInitDialog()
{
CSuper::OnInitDialog();
@@ -49,9 +49,10 @@ void CVkAccMgrForm::OnInitDialog() m_pwszOldPass = m_proto->GetUserStoredPassword();
m_edtPassword.SetText(m_pwszOldPass);
m_edtPassword.SendMsg(EM_LIMITTEXT, 1024, 0);
+ return true;
}
-void CVkAccMgrForm::OnApply()
+bool CVkAccMgrForm::OnApply()
{
pass_ptrW pwszNewPass(m_edtPassword.GetText());
bool bPassChanged = mir_wstrcmp(m_pwszOldPass, pwszNewPass) != 0;
@@ -66,6 +67,7 @@ void CVkAccMgrForm::OnApply() if (bPassChanged || mir_wstrcmpi(m_pwszOldLogin, pwszNewLogin))
m_proto->ClearAccessToken();
m_pwszOldLogin = pwszNewLogin;
+ return true;
}
////////////////////// Options ///////////////////////////////////////////////
@@ -157,7 +159,7 @@ CVkOptionAccountForm::CVkOptionAccountForm(CVkProto *proto) : CreateLink(m_cbLoadOnlyFriends, m_proto->m_vkOptions.bLoadOnlyFriends);
}
-void CVkOptionAccountForm::OnInitDialog()
+bool CVkOptionAccountForm::OnInitDialog()
{
m_pwszOldLogin = m_edtLogin.GetText();
m_edtLogin.SendMsg(EM_LIMITTEXT, 1024, 0);
@@ -191,10 +193,10 @@ void CVkOptionAccountForm::OnInitDialog() iListIndex = i;
}
m_cbxVKLang.SetCurSel(iListIndex);
-
+ return true;
}
-void CVkOptionAccountForm::OnApply()
+bool CVkOptionAccountForm::OnApply()
{
m_proto->m_vkOptions.iSyncHistoryMetod = m_cbxSyncHistory.GetItemData(m_cbxSyncHistory.GetCurSel());
m_proto->m_vkOptions.iMarkMessageReadOn = m_cbxMarkAsRead.GetItemData(m_cbxMarkAsRead.GetCurSel());
@@ -219,7 +221,7 @@ void CVkOptionAccountForm::OnApply() if (bPassChanged || mir_wstrcmpi(m_pwszOldLogin, pwszNewLogin))
m_proto->ClearAccessToken();
m_pwszOldLogin = pwszNewLogin;
-
+ return true;
}
////////////////////// Advanced page /////////////////////////////////////////
@@ -263,7 +265,7 @@ CVkOptionAdvancedForm::CVkOptionAdvancedForm(CVkProto *proto) : m_cbSendVKLinksAsAttachments.OnChange = Callback(this, &CVkOptionAdvancedForm::On_cbSendVKLinksAsAttachmentsChange);
}
-void CVkOptionAdvancedForm::OnInitDialog()
+bool CVkOptionAdvancedForm::OnInitDialog()
{
m_cbMusicSendOff.SetState(m_proto->m_vkOptions.iMusicSendMetod == MusicSendMetod::sendNone);
m_cbMusicSendBroadcastAndStatus.SetState(m_proto->m_vkOptions.iMusicSendMetod == MusicSendMetod::sendBroadcastAndStatus);
@@ -275,9 +277,10 @@ void CVkOptionAdvancedForm::OnInitDialog() On_cbForceInvisibleStatusChange(&m_cbForceInvisibleStatus);
On_cbSendVKLinksAsAttachmentsChange(&m_cbSendVKLinksAsAttachments);
+ return true;
}
-void CVkOptionAdvancedForm::OnApply()
+bool CVkOptionAdvancedForm::OnApply()
{
if (m_cbMusicSendOff.GetState())
m_proto->m_vkOptions.iMusicSendMetod = MusicSendMetod::sendNone;
@@ -290,6 +293,7 @@ void CVkOptionAdvancedForm::OnApply() if (m_cbSendVKLinksAsAttachments.GetState() == 0)
m_proto->m_vkOptions.bLoadSentAttachments = false;
+ return true;
}
void CVkOptionAdvancedForm::On_cbForceInvisibleStatusChange(CCtrlCheck *)
@@ -364,7 +368,7 @@ CVkOptionFeedsForm::CVkOptionFeedsForm(CVkProto *proto) : }
-void CVkOptionFeedsForm::OnInitDialog()
+bool CVkOptionFeedsForm::OnInitDialog()
{
m_spNewsInterval.SetRange(60 * 24, 1);
m_spNewsInterval.SetPosition(m_proto->m_vkOptions.iNewsInterval);
@@ -374,6 +378,7 @@ void CVkOptionFeedsForm::OnInitDialog() On_cbNewsEnabledChange(&m_cbNewsEnabled);
On_cbNotificationsEnabledChange(&m_cbNotificationsEnabled);
+ return true;
}
void CVkOptionFeedsForm::On_cbNewsEnabledChange(CCtrlCheck*)
@@ -436,7 +441,7 @@ CVkOptionViewForm::CVkOptionViewForm(CVkProto *proto) : CreateLink(m_cbUseNonStandardNotifications, m_proto->m_vkOptions.bUseNonStandardNotifications);
}
-void CVkOptionViewForm::OnInitDialog()
+bool CVkOptionViewForm::OnInitDialog()
{
m_cbIMGBBCSupportOff.SetState(m_proto->m_vkOptions.iIMGBBCSupport == IMGBBCSypport::imgNo);
m_cbIMGBBCSupportFullSize.SetState(m_proto->m_vkOptions.iIMGBBCSupport == IMGBBCSypport::imgFullSize);
@@ -450,9 +455,10 @@ void CVkOptionViewForm::OnInitDialog() m_cbBBCForAttachmentsOff.SetState(m_proto->m_vkOptions.iBBCForAttachments == BBCSupport::bbcNo);
m_cbBBCForAttachmentsBasic.SetState(m_proto->m_vkOptions.iBBCForAttachments == BBCSupport::bbcBasic);
m_cbBBCForAttachmentsAdvanced.SetState(m_proto->m_vkOptions.iBBCForAttachments == BBCSupport::bbcAdvanced);
+ return true;
}
-void CVkOptionViewForm::OnApply()
+bool CVkOptionViewForm::OnApply()
{
if (m_cbIMGBBCSupportOff.GetState())
m_proto->m_vkOptions.iIMGBBCSupport = IMGBBCSypport::imgNo;
@@ -476,6 +482,7 @@ void CVkOptionViewForm::OnApply() m_proto->m_vkOptions.iBBCForAttachments = BBCSupport::bbcBasic;
if (m_cbBBCForAttachmentsAdvanced.GetState())
m_proto->m_vkOptions.iBBCForAttachments = BBCSupport::bbcAdvanced;
+ return true;
}
////////////////////// Menu page /////////////////////////////////////////////
@@ -499,10 +506,11 @@ CVkOptionMenuForm::CVkOptionMenuForm(CVkProto *proto) : CreateLink(m_cbMenuEnabled6, m_proto->m_vkOptions.bShowProtoMenuItem6);
}
-void CVkOptionMenuForm::OnApply()
+bool CVkOptionMenuForm::OnApply()
{
if (MessageBoxW(nullptr,
TranslateT("These changes will take effect after Miranda NG restart.\nWould you like to restart it now?"),
TranslateT("VKontakte protocol"), MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2) == IDYES)
CallServiceSync(MS_SYSTEM_RESTART, 1, 0);
+ return true;
}
\ No newline at end of file diff --git a/protocols/VKontakte/src/vk_options.h b/protocols/VKontakte/src/vk_options.h index 8e91336848..c40d658adc 100644 --- a/protocols/VKontakte/src/vk_options.h +++ b/protocols/VKontakte/src/vk_options.h @@ -35,8 +35,8 @@ class CVkAccMgrForm : public CVkDlgBase public:
CVkAccMgrForm(CVkProto *proto, HWND hwndParent);
- void OnInitDialog();
- void OnApply();
+ bool OnInitDialog() override;
+ bool OnApply() override;
};
////////////////////// Account page //////////////////////////////////////////
@@ -61,8 +61,8 @@ class CVkOptionAccountForm : public CVkDlgBase public:
CVkOptionAccountForm(CVkProto *proto);
- void OnInitDialog();
- void OnApply();
+ bool OnInitDialog() override;
+ bool OnApply() override;
};
////////////////////// Advanced page /////////////////////////////////////////
@@ -95,8 +95,8 @@ class CVkOptionAdvancedForm : public CVkDlgBase public:
CVkOptionAdvancedForm(CVkProto *proto);
- void OnInitDialog();
- void OnApply();
+ bool OnInitDialog() override;
+ bool OnApply() override;
void On_cbForceInvisibleStatusChange(CCtrlCheck*);
void On_cbSendVKLinksAsAttachmentsChange(CCtrlCheck*);
};
@@ -140,7 +140,8 @@ class CVkOptionFeedsForm : public CVkDlgBase public:
CVkOptionFeedsForm(CVkProto *proto);
- void OnInitDialog();
+
+ bool OnInitDialog() override;
void On_cbNewsEnabledChange(CCtrlCheck*);
void On_cbNotificationsEnabledChange(CCtrlCheck*);
@@ -172,8 +173,8 @@ class CVkOptionViewForm : public CVkDlgBase public:
CVkOptionViewForm(CVkProto *proto);
- void OnInitDialog();
- void OnApply();
+ bool OnInitDialog() override;
+ bool OnApply() override;
};
////////////////////// Menu page /////////////////////////////////////////////
@@ -190,5 +191,5 @@ class CVkOptionMenuForm : public CVkDlgBase public:
CVkOptionMenuForm(CVkProto *proto);
- void OnApply();
+ bool OnApply() override;
};
\ No newline at end of file diff --git a/src/core/stdautoaway/src/options.cpp b/src/core/stdautoaway/src/options.cpp index e8ee0669da..79f6795174 100644 --- a/src/core/stdautoaway/src/options.cpp +++ b/src/core/stdautoaway/src/options.cpp @@ -87,7 +87,7 @@ public: chkShortIdle.OnChange = chkShort.OnChange = Callback(this, &COptionsDlg::onChange); } - virtual void OnInitDialog() override + bool OnInitDialog() override { chkOnWindows.SetState(!g_plugin.bIdleMethod); @@ -99,9 +99,10 @@ public: cmbAAStatus.SetCurSel(IdleGetStatusIndex(g_plugin.bAAStatus)); ShowHide(); + return true; } - virtual void OnApply() override + bool OnApply() override { g_plugin.iIdleTime1st = spinIdle.GetPosition(); @@ -112,6 +113,7 @@ public: // destroy any current idle and reset settings. IdleObject_Destroy(); IdleObject_Create(); + return true; } void onChange(CCtrlCheck*) diff --git a/src/core/stdmsg/src/chat_options.cpp b/src/core/stdmsg/src/chat_options.cpp index 272b75ef6c..fc7258ce76 100644 --- a/src/core/stdmsg/src/chat_options.cpp +++ b/src/core/stdmsg/src/chat_options.cpp @@ -342,7 +342,7 @@ public: checkBoxes.OnItemChanged = Callback(this, &COptMainDlg::onChange_Tree); } - virtual void OnInitDialog() override + bool OnInitDialog() override { SetWindowLongPtr(checkBoxes.GetHwnd(), GWL_STYLE, GetWindowLongPtr(checkBoxes.GetHwnd(), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES); @@ -363,9 +363,10 @@ public: FillBranch(hListHeading6, branch6, _countof(branch6), 0x0000); } FixHeadings(); + return true; } - virtual void OnApply() override + bool OnApply() override { SaveBranch(branch1, _countof(branch1)); SaveBranch(branch2, _countof(branch2)); @@ -377,9 +378,10 @@ public: g_chatApi.ReloadSettings(); Chat_UpdateOptions(); + return true; } - virtual void OnDestroy() override + void OnDestroy() override { BYTE b = checkBoxes.GetItemState(hListHeading1, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0; db_set_b(0, CHAT_MODULE, "Branch1Exp", b); @@ -464,7 +466,7 @@ public: btnFontChoose.OnClick = Callback(this, &COptLogDlg::onClick_Font); } - virtual void OnInitDialog() override + bool OnInitDialog() override { spin2.SetRange(5000); spin2.SetPosition(db_get_w(0, CHAT_MODULE, "LogLimit", 100)); @@ -493,9 +495,10 @@ public: chkLogging.SetState(g_Settings.bLoggingEnabled); onChange_Logging(nullptr); + return true; } - virtual void OnApply() override + bool OnApply() override { ptrW pszText(rtrimw(edtHighlight.GetText())); if (*pszText) { @@ -555,6 +558,7 @@ public: g_chatApi.ReloadSettings(); Chat_UpdateOptions(); + return true; } void onChange_Logging(CCtrlCheck*) @@ -610,7 +614,7 @@ public: chkRadio1.OnChange = chkRadio2.OnChange = chkRadio3.OnChange = Callback(this, &COptPopupDlg::onChange_Radio); } - virtual void OnInitDialog() override + bool OnInitDialog() override { SendDlgItemMessage(m_hwnd, IDC_BKG, CPM_SETCOLOUR, 0, g_Settings.crPUBkgColour); SendDlgItemMessage(m_hwnd, IDC_TEXT, CPM_SETCOLOUR, 0, g_Settings.crPUTextColour); @@ -627,9 +631,10 @@ public: SendDlgItemMessage(m_hwnd, IDC_SPIN1, UDM_SETRANGE, 0, MAKELONG(100, -1)); SendDlgItemMessage(m_hwnd, IDC_SPIN1, UDM_SETPOS, 0, MAKELONG(g_Settings.iPopupTimeout, 0)); + return true; } - virtual void OnApply() override + bool OnApply() override { int iLen; if (IsDlgButtonChecked(m_hwnd, IDC_RADIO2) == BST_CHECKED) @@ -649,6 +654,7 @@ public: db_set_dw(0, CHAT_MODULE, "PopupColorBG", (DWORD)SendDlgItemMessage(m_hwnd, IDC_BKG, CPM_GETCOLOUR, 0, 0)); g_Settings.crPUTextColour = SendDlgItemMessage(m_hwnd, IDC_TEXT, CPM_GETCOLOUR, 0, 0); db_set_dw(0, CHAT_MODULE, "PopupColorText", (DWORD)SendDlgItemMessage(m_hwnd, IDC_TEXT, CPM_GETCOLOUR, 0, 0)); + return true; } void onChange_Radio(CCtrlCheck*) diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index 459bb6575d..3f513be937 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -47,7 +47,7 @@ CChatRoomDlg::CChatRoomDlg(CTabbedWindow *pOwner, SESSION_INFO *si) : m_iSplitterY = g_Settings.iSplitterY; } -void CChatRoomDlg::OnInitDialog() +bool CChatRoomDlg::OnInitDialog() { CSuper::OnInitDialog(); m_si->pDlg = this; @@ -71,6 +71,7 @@ void CChatRoomDlg::OnInitDialog() UpdateTitle(); NotifyEvent(MSG_WINDOW_EVT_OPEN); + return true; } void CChatRoomDlg::OnDestroy() diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 3b402181b5..cfb4c8d556 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -97,7 +97,7 @@ CSrmmWindow::CSrmmWindow(CTabbedWindow *pOwner, MCONTACT hContact) : m_splitter.OnChange = Callback(this, &CSrmmWindow::OnSplitterMoved);
}
-void CSrmmWindow::OnInitDialog()
+bool CSrmmWindow::OnInitDialog()
{
CSuper::OnInitDialog();
@@ -251,6 +251,7 @@ void CSrmmWindow::OnInitDialog() SendMessage(m_hwnd, DM_GETAVATAR, 0, 0);
NotifyEvent(MSG_WINDOW_EVT_OPEN);
+ return true;
}
void CSrmmWindow::OnDestroy()
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index f8d60c6be2..d8c88d0327 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -245,7 +245,7 @@ public: CreateLink(chkDoNotStealFocus, g_dat.bDoNotStealFocus);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
FillCheckBoxTree(g_dat.popupFlags);
@@ -256,9 +256,10 @@ public: chkCascade.Enable(!g_dat.bSavePerContact);
chkCtrlSupport.Enable(!g_dat.bAutoClose);
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
g_dat.popupFlags = MakeCheckBoxTreeFlags();
@@ -268,6 +269,7 @@ public: g_dat.msgTimeout = msgTimeout;
Srmm_Broadcast(DM_OPTIONSAPPLIED, TRUE, 0);
+ return true;
}
void onChange_AutoMin(CCtrlCheck*)
@@ -342,7 +344,7 @@ public: CreateLink(chkShowNames, g_dat.bShowNames);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
switch (g_dat.iLoadHistory) {
case LOADHISTORY_UNREAD:
@@ -366,9 +368,10 @@ public: spinTime.SetPosition(g_dat.nLoadTime);
onChange_Time(nullptr);
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
if (chkLoadCount.GetState())
g_dat.iLoadHistory = LOADHISTORY_COUNT;
@@ -382,9 +385,10 @@ public: FreeMsgLogIcons();
LoadMsgLogIcons();
Srmm_Broadcast(DM_OPTIONSAPPLIED, TRUE, 0);
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
DeleteObject(hBkgColourBrush);
}
@@ -474,7 +478,7 @@ public: }
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
CLCINFOITEM cii = { sizeof(cii) };
cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
@@ -491,12 +495,14 @@ public: clist.OnOptionsChanged = Callback(this, &COptionTypingDlg::ResetCList);
onChange_ShowNotify(nullptr);
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
SaveList();
Srmm_Broadcast(DM_OPTIONSAPPLIED, TRUE, 0);
+ return true;
}
void onChange_Clist(CCtrlClc::TEventInfo*)
@@ -539,15 +545,16 @@ public: m_chkTabs.OnChange = Callback(this, &COptionsTabDlg::onChange_Tabs);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
m_chkTabs.SetState(g_Settings.bTabsEnable);
m_chkTabsBottom.SetState(g_Settings.bTabsAtBottom);
m_chkTabsClose.SetState(g_Settings.bTabCloseOnDblClick);
onChange_Tabs(&m_chkTabs);
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
BYTE bOldValue = db_get_b(0, CHAT_MODULE, "Tabs", 1);
@@ -563,6 +570,7 @@ public: g_Settings.bTabsEnable = db_get_b(0, CHAT_MODULE, "Tabs", 1) != 0;
}
else Chat_UpdateOptions();
+ return true;
}
void onChange_Tabs(CCtrlCheck *pCheck)
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h index 2322ca2c99..6dfe7f31af 100644 --- a/src/core/stdmsg/src/msgs.h +++ b/src/core/stdmsg/src/msgs.h @@ -126,7 +126,7 @@ public: public:
CSrmmWindow(CTabbedWindow*, MCONTACT hContact);
- void OnInitDialog() override;
+ bool OnInitDialog() override;
void OnDestroy() override;
void OnActivate() override;
@@ -183,7 +183,7 @@ class CChatRoomDlg : public CMsgDialog public:
CChatRoomDlg(CTabbedWindow*, SESSION_INFO*);
- void OnInitDialog() override;
+ bool OnInitDialog() override;
void OnDestroy() override;
void OnActivate() override;
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index 344b40992a..67c98ec5f5 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -173,11 +173,11 @@ public: void SetTabHighlight(CMsgDialog*);
void TabClicked();
- virtual void OnInitDialog() override;
- virtual void OnDestroy() override;
+ bool OnInitDialog() override;
+ void OnDestroy() override;
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
- virtual int Resizer(UTILRESIZECONTROL *urc) override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
};
extern CTabbedWindow *g_pTabDialog;
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp index 5a0537b45d..cf8c187512 100644 --- a/src/core/stdmsg/src/tabs.cpp +++ b/src/core/stdmsg/src/tabs.cpp @@ -144,7 +144,7 @@ CTabbedWindow::CTabbedWindow() : { } -void CTabbedWindow::OnInitDialog() +bool CTabbedWindow::OnInitDialog() { SetWindowLongPtr(m_tab.GetHwnd(), GWLP_USERDATA, LPARAM(this)); mir_subclassWindow(m_tab.GetHwnd(), ::TabSubclassProc); @@ -156,7 +156,7 @@ void CTabbedWindow::OnInitDialog() if (!g_Settings.bTabsEnable) { m_tab.Hide(); - return; + return false; } LONG_PTR mask = GetWindowLongPtr(m_tab.GetHwnd(), GWL_STYLE); @@ -168,6 +168,7 @@ void CTabbedWindow::OnInitDialog() TabCtrl_SetMinTabWidth(m_tab.GetHwnd(), 80); TabCtrl_SetImageList(m_tab.GetHwnd(), Clist_GetImageList()); + return true; } void CTabbedWindow::OnDestroy() diff --git a/src/mir_app/src/addcontact.cpp b/src/mir_app/src/addcontact.cpp index d16544fa8c..500aa2cae3 100644 --- a/src/mir_app/src/addcontact.cpp +++ b/src/mir_app/src/addcontact.cpp @@ -65,7 +65,7 @@ public: m_btnOk.OnClick = Callback(this, &CAddContactDlg::OnOk);
}
- void OnInitDialog()
+ bool OnInitDialog() override
{
Window_SetSkinIcon_IcoLib(m_hwnd, SKINICON_OTHER_ADDCONTACT);
@@ -107,6 +107,7 @@ public: m_authReq.Enable(m_chkAuth.Enabled());
m_authReq.SetText(TranslateT("Please authorize my request and add me to your contact list."));
}
+ return true;
}
void OnDestroy()
diff --git a/src/mir_app/src/auth.cpp b/src/mir_app/src/auth.cpp index 91200e360a..6633802df0 100644 --- a/src/mir_app/src/auth.cpp +++ b/src/mir_app/src/auth.cpp @@ -52,21 +52,21 @@ public: btnDetails.OnClick = Callback(this, &CAuthReqDlg::onClick_Details); } - virtual void OnInitDialog() override + bool OnInitDialog() override { Button_SetIcon_IcoLib(m_hwnd, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details")); Button_SetIcon_IcoLib(m_hwnd, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list")); int iBlobSize = db_event_getBlobSize(m_hDbEvent); if (iBlobSize == -1) - return; + return false; // blob is: uin(DWORD), hcontact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ) DBEVENTINFO dbei = {}; dbei.cbBlob = iBlobSize; dbei.pBlob = (PBYTE)alloca(dbei.cbBlob); if (db_event_get(m_hDbEvent, &dbei)) - return; + return false; m_szProto = dbei.szModule; @@ -131,9 +131,10 @@ public: chkAdd.SetState(false); } else chkAdd.SetState(true); + return true; } - virtual void OnDestroy() override + void OnDestroy() override { Button_FreeIcon_IcoLib(m_hwnd, IDC_ADD); Button_FreeIcon_IcoLib(m_hwnd, IDC_DETAILS); @@ -198,7 +199,7 @@ public: btnDetails.OnClick = Callback(this, &CAddedDlg::onClick_Details); } - virtual void OnInitDialog() override + bool OnInitDialog() override { Button_SetIcon_IcoLib(m_hwnd, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details")); Button_SetIcon_IcoLib(m_hwnd, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list")); @@ -255,9 +256,10 @@ public: if (m_hContact == INVALID_CONTACT_ID || !db_get_b(m_hContact, "CList", "NotOnList", 0)) ShowWindow(GetDlgItem(m_hwnd, IDC_ADD), FALSE); + return true; } - virtual void OnDestroy() override + void OnDestroy() override { Button_FreeIcon_IcoLib(m_hwnd, IDC_ADD); Button_FreeIcon_IcoLib(m_hwnd, IDC_DETAILS); diff --git a/src/mir_app/src/colorchooser.cpp b/src/mir_app/src/colorchooser.cpp index 95918e239d..8d9cb701c7 100644 --- a/src/mir_app/src/colorchooser.cpp +++ b/src/mir_app/src/colorchooser.cpp @@ -105,7 +105,7 @@ public: m_yPosition = IsWindowVisible(hwndChooser) ? rc.top - 1 : rc.top + 20;
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
int iSquareRoot = (int)sqrt(static_cast<float>(16));
@@ -127,9 +127,10 @@ public: m_text.SetText(m_bForeground ? TranslateT("Text color") : TranslateT("Background color"));
SetWindowPos(m_text.GetHwnd(), nullptr, 0, 0, width, 20, 0);
SetWindowPos(m_hwnd, nullptr, m_xPosition, m_yPosition, width, height, SWP_SHOWWINDOW);
+ return true;
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
switch (msg) {
case WM_COMMAND:
@@ -265,9 +266,10 @@ public: return CDlgBase::DlgProc(msg, wParam, lParam);
}
- virtual void OnClose() override
+ bool OnClose() override
{
SetFocus(m_hwndTarget);
+ return true;
}
};
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index 72a7e5d5b1..ba1df15b2e 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -314,7 +314,7 @@ public: m_nameOrder.OnBeginDrag = Callback(this, &CContactOptsDlg::OnBeginDrag);
}
- virtual void OnInitDialog()
+ bool OnInitDialog() override
{
TVINSERTSTRUCT tvis;
tvis.hParent = nullptr;
@@ -325,9 +325,10 @@ public: tvis.item.pszText = TranslateW(nameOrderDescr[nameOrder[i]]);
m_nameOrder.InsertItem(&tvis);
}
+ return true;
}
- virtual void OnApply()
+ bool OnApply() override
{
TVITEMEX tvi;
tvi.hItem = m_nameOrder.GetRoot();
@@ -340,6 +341,7 @@ public: }
db_set_blob(0, "Contact", "NameOrder", nameOrder, _countof(nameOrderDescr));
g_clistApi.pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID);
+ return true;
}
void OnBeginDrag(CCtrlTreeView::TEventInfo *evt)
diff --git a/src/mir_app/src/db_ini.cpp b/src/mir_app/src/db_ini.cpp index c35ac38817..a03aabc333 100644 --- a/src/mir_app/src/db_ini.cpp +++ b/src/mir_app/src/db_ini.cpp @@ -41,55 +41,51 @@ class CInstallIniDlg : public CDlgBase CCtrlBase m_securityInfo;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override
+ {
+ m_iniName.SetText(m_szIniPath);
+
+ wchar_t szSecurity[11];
+ const wchar_t *pszSecurityInfo;
+
+ Profile_GetSetting(L"AutoExec/Warn", szSecurity, L"notsafe");
+ if (!mir_wstrcmpi(szSecurity, L"all"))
+ pszSecurityInfo = LPGENW("Security systems to prevent malicious changes are in place and you will be warned before every change that is made.");
+ else if (!mir_wstrcmpi(szSecurity, L"onlyunsafe"))
+ pszSecurityInfo = LPGENW("Security systems to prevent malicious changes are in place and you will be warned before changes that are known to be unsafe.");
+ else if (!mir_wstrcmpi(szSecurity, L"none"))
+ pszSecurityInfo = LPGENW("Security systems to prevent malicious changes have been disabled. You will receive no further warnings.");
+ else pszSecurityInfo = nullptr;
+
+ if (pszSecurityInfo)
+ m_securityInfo.SetText(TranslateW(pszSecurityInfo));
+ return true;
+ }
+
+ void ViewIni_OnClick(CCtrlBase*)
+ {
+ ptrW szPath(m_iniName.GetText());
+ ShellExecute(m_hwnd, L"open", szPath, nullptr, nullptr, SW_SHOW);
+ }
- void ViewIni_OnClick(CCtrlBase*);
- void NoToAll_OnClick(CCtrlBase*);
+ void NoToAll_OnClick(CCtrlBase*)
+ {
+ Close();
+ }
public:
- CInstallIniDlg(wchar_t *szIniPath);
+ CInstallIniDlg(wchar_t *szIniPath) :
+ CDlgBase(g_plugin, IDD_INSTALLINI),
+ m_noToAll(this, IDC_NOTOALL), m_viewIni(this, IDC_VIEWINI),
+ m_iniName(this, IDC_ININAME), m_securityInfo(this, IDC_SECURITYINFO)
+ {
+ m_szIniPath = szIniPath;
+
+ m_noToAll.OnClick = Callback(this, &CInstallIniDlg::NoToAll_OnClick);
+ m_viewIni.OnClick = Callback(this, &CInstallIniDlg::ViewIni_OnClick);
+ }
};
-CInstallIniDlg::CInstallIniDlg(wchar_t *szIniPath)
- : CDlgBase(g_plugin, IDD_INSTALLINI),
- m_noToAll(this, IDC_NOTOALL), m_viewIni(this, IDC_VIEWINI),
- m_iniName(this, IDC_ININAME), m_securityInfo(this, IDC_SECURITYINFO)
-{
- m_szIniPath = szIniPath;
-
- m_noToAll.OnClick = Callback(this, &CInstallIniDlg::NoToAll_OnClick);
- m_viewIni.OnClick = Callback(this, &CInstallIniDlg::ViewIni_OnClick);
-}
-
-void CInstallIniDlg::OnInitDialog()
-{
- m_iniName.SetText(m_szIniPath);
-
- wchar_t szSecurity[11];
- const wchar_t *pszSecurityInfo;
-
- Profile_GetSetting(L"AutoExec/Warn", szSecurity, L"notsafe");
- if (!mir_wstrcmpi(szSecurity, L"all"))
- pszSecurityInfo = LPGENW("Security systems to prevent malicious changes are in place and you will be warned before every change that is made.");
- else if (!mir_wstrcmpi(szSecurity, L"onlyunsafe"))
- pszSecurityInfo = LPGENW("Security systems to prevent malicious changes are in place and you will be warned before changes that are known to be unsafe.");
- else if (!mir_wstrcmpi(szSecurity, L"none"))
- pszSecurityInfo = LPGENW("Security systems to prevent malicious changes have been disabled. You will receive no further warnings.");
- else pszSecurityInfo = nullptr;
- if (pszSecurityInfo) m_securityInfo.SetText(TranslateW(pszSecurityInfo));
-}
-
-void CInstallIniDlg::ViewIni_OnClick(CCtrlBase*)
-{
- ptrW szPath(m_iniName.GetText());
- ShellExecute(m_hwnd, L"open", szPath, nullptr, nullptr, SW_SHOW);
-}
-
-void CInstallIniDlg::NoToAll_OnClick(CCtrlBase*)
-{
- Close();
-}
-
//////////////////////////////////////////////////////
static bool IsInSpaceSeparatedList(const char *szWord, const char *szList)
@@ -137,60 +133,54 @@ class CWarnIniChangeDlg : public CDlgBase CCtrlBase m_newValue;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override
+ {
+ char szSettingName[256];
+ const wchar_t *pszSecurityInfo;
+ m_iniName.SetText(m_warnInfo->szIniPath);
+ mir_strcpy(szSettingName, m_warnInfo->szSection);
+ mir_strcat(szSettingName, " / ");
+ mir_strcat(szSettingName, m_warnInfo->szName);
+ m_settingName.SetTextA(szSettingName);
+ m_newValue.SetTextA(m_warnInfo->szValue);
+ if (IsInSpaceSeparatedList(m_warnInfo->szSection, m_warnInfo->szSafeSections))
+ pszSecurityInfo = LPGENW("This change is known to be safe.");
+ else if (IsInSpaceSeparatedList(m_warnInfo->szSection, m_warnInfo->szUnsafeSections))
+ pszSecurityInfo = LPGENW("This change is known to be potentially hazardous.");
+ else
+ pszSecurityInfo = LPGENW("This change is not known to be safe.");
+ m_securityInfo.SetText(TranslateW(pszSecurityInfo));
+ return true;
+ }
+
+ void YesNo_OnClick(CCtrlBase*)
+ {
+ m_warnInfo->warnNoMore = m_noWarn.GetState();
+ Close();
+ }
- void YesNo_OnClick(CCtrlBase*);
- void Cancel_OnClick(CCtrlBase*);
+ void Cancel_OnClick(CCtrlBase*)
+ {
+ m_warnInfo->cancel = 1;
+ m_warnInfo->warnNoMore = m_noWarn.GetState();
+ }
public:
- CWarnIniChangeDlg(warnSettingChangeInfo_t *warnInfo);
+ CWarnIniChangeDlg(warnSettingChangeInfo_t *warnInfo) :
+ CDlgBase(g_plugin, IDD_WARNINICHANGE),
+ m_yes(this, IDYES), m_no(this, IDNO),
+ m_cancel(this, IDCANCEL), m_noWarn(this, IDC_WARNNOMORE),
+ m_iniName(this, IDC_ININAME), m_settingName(this, IDC_SETTINGNAME),
+ m_newValue(this, IDC_NEWVALUE), m_securityInfo(this, IDC_SECURITYINFO)
+ {
+ m_warnInfo = warnInfo;
+
+ m_yes.OnClick = Callback(this, &CWarnIniChangeDlg::YesNo_OnClick);
+ m_no.OnClick = Callback(this, &CWarnIniChangeDlg::YesNo_OnClick);
+ m_cancel.OnClick = Callback(this, &CWarnIniChangeDlg::Cancel_OnClick);
+ }
};
-CWarnIniChangeDlg::CWarnIniChangeDlg(warnSettingChangeInfo_t *warnInfo)
- : CDlgBase(g_plugin, IDD_WARNINICHANGE),
- m_yes(this, IDYES), m_no(this, IDNO),
- m_cancel(this, IDCANCEL), m_noWarn(this, IDC_WARNNOMORE),
- m_iniName(this, IDC_ININAME), m_settingName(this, IDC_SETTINGNAME),
- m_newValue(this, IDC_NEWVALUE), m_securityInfo(this, IDC_SECURITYINFO)
-{
- m_warnInfo = warnInfo;
-
- m_yes.OnClick = Callback(this, &CWarnIniChangeDlg::YesNo_OnClick);
- m_no.OnClick = Callback(this, &CWarnIniChangeDlg::YesNo_OnClick);
- m_cancel.OnClick = Callback(this, &CWarnIniChangeDlg::Cancel_OnClick);
-}
-
-void CWarnIniChangeDlg::OnInitDialog()
-{
- char szSettingName[256];
- const wchar_t *pszSecurityInfo;
- m_iniName.SetText(m_warnInfo->szIniPath);
- mir_strcpy(szSettingName, m_warnInfo->szSection);
- mir_strcat(szSettingName, " / ");
- mir_strcat(szSettingName, m_warnInfo->szName);
- m_settingName.SetTextA(szSettingName);
- m_newValue.SetTextA(m_warnInfo->szValue);
- if (IsInSpaceSeparatedList(m_warnInfo->szSection, m_warnInfo->szSafeSections))
- pszSecurityInfo = LPGENW("This change is known to be safe.");
- else if (IsInSpaceSeparatedList(m_warnInfo->szSection, m_warnInfo->szUnsafeSections))
- pszSecurityInfo = LPGENW("This change is known to be potentially hazardous.");
- else
- pszSecurityInfo = LPGENW("This change is not known to be safe.");
- m_securityInfo.SetText(TranslateW(pszSecurityInfo));
-}
-
-void CWarnIniChangeDlg::YesNo_OnClick(CCtrlBase*)
-{
- m_warnInfo->warnNoMore = m_noWarn.GetState();
- Close();
-}
-
-void CWarnIniChangeDlg::Cancel_OnClick(CCtrlBase*)
-{
- m_warnInfo->cancel = 1;
- m_warnInfo->warnNoMore = m_noWarn.GetState();
-}
-
//////////////////////////////////////////////////////
class CIniImportDoneDlg : public CDlgBase
@@ -206,62 +196,55 @@ class CIniImportDoneDlg : public CDlgBase CCtrlEdit m_newPath;
protected:
- void OnInitDialog();
-
- void Delete_OnClick(CCtrlBase*);
- void Leave_OnClick(CCtrlBase*);
- void Recycle_OnClick(CCtrlBase*);
- void Move_OnClick(CCtrlBase*);
-
-public:
- CIniImportDoneDlg(wchar_t *path);
-};
+ bool OnInitDialog() override
+ {
+ m_iniPath.SetText(m_path);
+ m_newPath.SetText(m_path);
+ return true;
+ }
-void CIniImportDoneDlg::OnInitDialog()
-{
- m_iniPath.SetText(m_path);
- m_newPath.SetText(m_path);
-}
+ void Delete_OnClick(CCtrlBase*)
+ {
+ ptrW szIniPath(m_iniPath.GetText());
+ DeleteFile(szIniPath);
+ Close();
+ }
-CIniImportDoneDlg::CIniImportDoneDlg(wchar_t *path)
- : CDlgBase(g_plugin, IDD_INIIMPORTDONE),
- m_delete(this, IDC_DELETE), m_leave(this, IDC_LEAVE),
- m_recycle(this, IDC_RECYCLE), m_move(this, IDC_MOVE),
- m_iniPath(this, IDC_ININAME), m_newPath(this, IDC_NEWNAME)
-{
- m_path = path;
-}
-void CIniImportDoneDlg::Delete_OnClick(CCtrlBase*)
-{
- ptrW szIniPath(m_iniPath.GetText());
- DeleteFile(szIniPath);
- Close();
-}
+ void Leave_OnClick(CCtrlBase*)
+ {
+ Close();
+ }
-void CIniImportDoneDlg::Recycle_OnClick(CCtrlBase*)
-{
- ptrW szIniPath(m_iniPath.GetText());
- SHFILEOPSTRUCT shfo = {};
- shfo.wFunc = FO_DELETE;
- shfo.pFrom = szIniPath;
- szIniPath[mir_wstrlen(szIniPath) + 1] = '\0';
- shfo.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO;
- SHFileOperation(&shfo);
- Close();
-}
+ void Recycle_OnClick(CCtrlBase*)
+ {
+ ptrW szIniPath(m_iniPath.GetText());
+ SHFILEOPSTRUCT shfo = {};
+ shfo.wFunc = FO_DELETE;
+ shfo.pFrom = szIniPath;
+ szIniPath[mir_wstrlen(szIniPath) + 1] = '\0';
+ shfo.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO;
+ SHFileOperation(&shfo);
+ Close();
+ }
-void CIniImportDoneDlg::Move_OnClick(CCtrlBase*)
-{
- ptrW szIniPath(m_iniPath.GetText());
- ptrW szNewPath(m_newPath.GetText());
- MoveFile(szIniPath, szNewPath);
- Close();
-}
+ void Move_OnClick(CCtrlBase*)
+ {
+ ptrW szIniPath(m_iniPath.GetText());
+ ptrW szNewPath(m_newPath.GetText());
+ MoveFile(szIniPath, szNewPath);
+ Close();
+ }
-void CIniImportDoneDlg::Leave_OnClick(CCtrlBase*)
-{
- Close();
-}
+public:
+ CIniImportDoneDlg(wchar_t *path) :
+ CDlgBase(g_plugin, IDD_INIIMPORTDONE),
+ m_delete(this, IDC_DELETE), m_leave(this, IDC_LEAVE),
+ m_recycle(this, IDC_RECYCLE), m_move(this, IDC_MOVE),
+ m_iniPath(this, IDC_ININAME), m_newPath(this, IDC_NEWNAME)
+ {
+ m_path = path;
+ }
+};
//////////////////////////////////////////////////////
diff --git a/src/mir_app/src/ei_options.cpp b/src/mir_app/src/ei_options.cpp index 50cdcc1ce3..7f763d87c8 100644 --- a/src/mir_app/src/ei_options.cpp +++ b/src/mir_app/src/ei_options.cpp @@ -254,7 +254,7 @@ public: m_timer.OnEvent = Callback(this, &CExtraIconOptsDlg::onTimer); } - virtual void OnInitDialog() + bool OnInitDialog() override { pGlgOptions = this; @@ -266,9 +266,10 @@ public: } BuildIconList(); + return true; } - virtual void OnApply() + bool OnApply() override { // Store old slots int *oldSlots = new int[registeredExtraIcons.getCount()]; @@ -367,9 +368,10 @@ public: extra->applyIcons(); delete[] oldSlots; + return true; } - virtual void OnDestroy() + void OnDestroy() override { pGlgOptions = nullptr; diff --git a/src/mir_app/src/help.cpp b/src/mir_app/src/help.cpp index 1b0aa39d5a..8eef92a7cf 100644 --- a/src/mir_app/src/help.cpp +++ b/src/mir_app/src/help.cpp @@ -50,7 +50,7 @@ public: ctrlDevelopers.UseSystemColors(); } - virtual void OnInitDialog() override + bool OnInitDialog() override { ptrW wszCopyright(mir_utf8decodeW(LEGAL_COPYRIGHT)); if (wszCopyright == nullptr) @@ -82,9 +82,10 @@ public: ctrlCredits.Hide(); Window_SetSkinIcon_IcoLib(m_hwnd, SKINICON_OTHER_MIRANDA); + return true; } - virtual void OnDestroy() override + void OnDestroy() override { pAboutDialog = nullptr; Window_FreeIcon_IcoLib(m_hwnd); diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp index 01916a1a16..b3fd2d488a 100644 --- a/src/mir_app/src/lpopts.cpp +++ b/src/mir_app/src/lpopts.cpp @@ -57,9 +57,9 @@ class CLangpackDlg : public CDlgBase void DisplayPackInfo(const LANGPACK_INFO *pack);
protected:
- void OnInitDialog();
- void OnApply();
- void OnDestroy();
+ bool OnInitDialog() override;
+ bool OnApply() override;
+ void OnDestroy() override;
void Languages_OnChange(CCtrlBase*);
void Reload_OnClick(CCtrlBase*);
@@ -80,10 +80,11 @@ CLangpackDlg::CLangpackDlg() m_reload.OnClick = Callback(this, &CLangpackDlg::Reload_OnClick);
}
-void CLangpackDlg::OnInitDialog()
+bool CLangpackDlg::OnInitDialog()
{
m_languages.ResetContent();
LoadLangpacks();
+ return true;
}
void CLangpackDlg::LoadLangpacks()
@@ -217,7 +218,7 @@ void CLangpackDlg::Reload_OnClick(CCtrlBase*) m_reload.Enable(TRUE);
}
-void CLangpackDlg::OnApply()
+bool CLangpackDlg::OnApply()
{
wchar_t tszPath[MAX_PATH]; tszPath[0] = 0;
int idx = m_languages.GetCurSel();
@@ -241,6 +242,7 @@ void CLangpackDlg::OnApply() mir_forkthread(ReloadOptions, hwndParent);
}
}
+ return true;
}
void CLangpackDlg::OnDestroy()
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index 333426c5d7..011dff0698 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -321,7 +321,7 @@ public: } //---- init dialog ------------------------------------------- - virtual void OnInitDialog() + bool OnInitDialog() override { iInitMenuValue = db_get_b(0, "CList", "MoveProtoMenus", TRUE); @@ -339,9 +339,10 @@ public: m_menuObjects.SetCurSel(0); RebuildCurrent(); + return true; } - virtual void OnApply() + bool OnApply() override { bIconsDisabled = m_enableIcons.GetState() == 0; db_set_b(0, "CList", "DisableMenuIcons", bIconsDisabled); @@ -355,9 +356,10 @@ public: iInitMenuValue = iNewMenuValue; } RebuildCurrent(); + return true; } - virtual void OnDestroy() + void OnDestroy() override { FreeTreeData(); } diff --git a/src/mir_app/src/meta_addto.cpp b/src/mir_app/src/meta_addto.cpp index d2d8e38dcc..9687fc5c33 100644 --- a/src/mir_app/src/meta_addto.cpp +++ b/src/mir_app/src/meta_addto.cpp @@ -94,8 +94,8 @@ static int BuildList(HWND list, BOOL sort) *
* @param hwndDlg : HANDLE to the <b>'Add To'</b> Dialog.
* @param uMsg : Specifies the message received by this dialog.
-* @param wParam : Specifies additional message-specific information.
-* @param lParam : Specifies additional message-specific information.
+* @param wParam : Specifies additional message-specific information.
+* @param lParam : Specifies additional message-specific information.
*
* @return TRUE if the dialog processed the message, FALSE if it did not.
*/
@@ -112,9 +112,9 @@ class CMetaSelectDlg : public CDlgBase CCtrlCheck m_sortCheck;
protected:
- void OnInitDialog();
- void OnApply();
- void OnDestroy();
+ bool OnInitDialog() override;
+ bool OnApply() override;
+ void OnDestroy() override;
void MetaList_OnDblClick(CCtrlListBox*);
void SortCheck_OnChange(CCtrlCheck*);
@@ -131,31 +131,24 @@ CMetaSelectDlg::CMetaSelectDlg(MCONTACT hContact) m_sortCheck.OnChange = Callback(this, &CMetaSelectDlg::SortCheck_OnChange);
}
-void CMetaSelectDlg::OnInitDialog()
+bool CMetaSelectDlg::OnInitDialog()
{
DBCachedContact *cc = currDb->getCache()->GetCachedContact(m_hContact);
if (cc == nullptr)
- {
- Close();
- return;
- }
+ return false;
- if (cc->IsMeta())
- {
+ if (cc->IsMeta()) {
MessageBox(GetHwnd(),
TranslateT("This contact is a metacontact.\nYou can't add a metacontact to another metacontact.\n\nPlease choose another."),
TranslateT("Metacontact conflict"), MB_ICONERROR);
- Close();
- return;
+ return false;
}
- if (cc->IsSub())
- {
+ if (cc->IsSub()) {
MessageBox(GetHwnd(),
TranslateT("This contact is already associated to a metacontact.\nYou cannot add a contact to multiple metacontacts."),
TranslateT("Multiple metacontacts"), MB_ICONERROR);
- Close();
- return;
+ return false;
}
Window_SetIcon_IcoLib(GetHwnd(), Meta_GetIconHandle(I_ADD));
@@ -163,33 +156,29 @@ void CMetaSelectDlg::OnInitDialog() // Initialize the graphical part
CheckDlgButton(GetHwnd(), IDC_ONLYAVAIL, BST_CHECKED); // Initially checked; display all metacontacts is only an option
// Besides, we can check if there is at least one metacontact to add the contact to.
- if (BuildList(GetDlgItem(GetHwnd(), IDC_METALIST), FALSE) <= 0)
- {
+ if (BuildList(GetDlgItem(GetHwnd(), IDC_METALIST), FALSE) <= 0) {
if (MessageBox(GetHwnd(), TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(m_hContact, 0);
- Close();
- return;
- }
- else
- {
- // get contact display name from clist
- wchar_t *ptszCDN = Clist_GetContactDisplayName(m_hContact);
- if (!ptszCDN)
- ptszCDN = TranslateT("a contact");
-
- // ... and set it to the Window title.
- wchar_t buf[256];
- mir_snwprintf(buf, TranslateT("Adding %s..."), ptszCDN);
- SetWindowText(GetHwnd(), buf);
+ return false;
}
+
+ // get contact display name from clist
+ wchar_t *ptszCDN = Clist_GetContactDisplayName(m_hContact);
+ if (!ptszCDN)
+ ptszCDN = TranslateT("a contact");
+
+ // ... and set it to the Window title.
+ wchar_t buf[256];
+ mir_snwprintf(buf, TranslateT("Adding %s..."), ptszCDN);
+ SetWindowText(GetHwnd(), buf);
ShowWindow(GetHwnd(), SW_SHOWNORMAL);
+ return true;
}
-void CMetaSelectDlg::OnApply()
+bool CMetaSelectDlg::OnApply()
{
int item = m_metaList.GetCurSel();
- if (item == -1)
- {
+ if (item == -1) {
BOOL result = IDOK == MessageBox(GetHwnd(), TranslateT("Please select a metacontact"), TranslateT("No metacontact selected"), MB_ICONHAND);
EndModal(result);
}
@@ -197,6 +186,7 @@ void CMetaSelectDlg::OnApply() MCONTACT hMeta = (MCONTACT)m_metaList.GetItemData(item);
if (!Meta_Assign(m_hContact, hMeta, FALSE))
MessageBox(GetHwnd(), TranslateT("Assignment to the metacontact failed."), TranslateT("Assignment failure"), MB_ICONERROR);
+ return true;
}
void CMetaSelectDlg::OnDestroy()
@@ -216,8 +206,7 @@ void CMetaSelectDlg::MetaList_OnDblClick(CCtrlListBox*) void CMetaSelectDlg::SortCheck_OnChange(CCtrlCheck*)
{
SetWindowLongPtr(m_metaList.GetHwnd(), GWL_STYLE, GetWindowLongPtr(m_metaList.GetHwnd(), GWL_STYLE) ^ LBS_SORT);
- if (BuildList(m_metaList.GetHwnd(), m_sortCheck.GetState() ? TRUE : FALSE) <= 0)
- {
+ if (BuildList(m_metaList.GetHwnd(), m_sortCheck.GetState() ? TRUE : FALSE) <= 0) {
if (MessageBox(GetHwnd(), TranslateW(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(m_hContact, 0);
Close();
diff --git a/src/mir_app/src/meta_options.cpp b/src/mir_app/src/meta_options.cpp index f80d9c3019..798af79448 100644 --- a/src/mir_app/src/meta_options.cpp +++ b/src/mir_app/src/meta_options.cpp @@ -70,7 +70,7 @@ public: {
}
- virtual void OnInitDialog()
+ bool OnInitDialog() override
{
m_btnLock.SetState(g_metaOptions.bLockHandle);
m_btnCheck.SetState(g_metaOptions.bSuppressStatus);
@@ -90,9 +90,10 @@ public: m_btnNick.SetState(true);
else
m_btnName.SetState(true);
+ return true;
}
- virtual void OnApply()
+ bool OnApply() override
{
g_metaOptions.bLockHandle = m_btnLock.GetState() != 0;
g_metaOptions.bSuppressStatus = m_btnCheck.GetState() != 0;
@@ -111,6 +112,7 @@ public: Meta_SuppressStatus(g_metaOptions.bSuppressStatus);
Meta_SetAllNicks();
+ return true;
}
};
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 3b8a50f6eb..52a7b20b21 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -400,7 +400,7 @@ Chat_UpdateOptions @418 NONAME ?UpdateOptions@CSrmmBaseDialog@@UAEXXZ @420 NONAME
?ShowColorChooser@CSrmmBaseDialog@@QAEXH@Z @421 NONAME
?ShowFilterMenu@CSrmmBaseDialog@@UAEXXZ @422 NONAME
-?OnInitDialog@CSrmmBaseDialog@@MAEXXZ @423 NONAME
+?OnInitDialog@CSrmmBaseDialog@@MAE_NXZ @423 NONAME
?StreamInEvents@CSrmmBaseDialog@@UAEXPAULOGINFO@@_N@Z @424 NONAME
?AddLog@CSrmmBaseDialog@@UAEXXZ @425 NONAME
?RedrawLog2@CSrmmBaseDialog@@QAEXXZ @426 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 5678c9d5e2..360fe8adea 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -400,7 +400,7 @@ Chat_UpdateOptions @418 NONAME ?UpdateOptions@CSrmmBaseDialog@@UEAAXXZ @420 NONAME
?ShowColorChooser@CSrmmBaseDialog@@QEAAXH@Z @421 NONAME
?ShowFilterMenu@CSrmmBaseDialog@@UEAAXXZ @422 NONAME
-?OnInitDialog@CSrmmBaseDialog@@MEAAXXZ @423 NONAME
+?OnInitDialog@CSrmmBaseDialog@@MEAA_NXZ @423 NONAME
?StreamInEvents@CSrmmBaseDialog@@UEAAXPEAULOGINFO@@_N@Z @424 NONAME
?AddLog@CSrmmBaseDialog@@UEAAXXZ @425 NONAME
?RedrawLog2@CSrmmBaseDialog@@QEAAXXZ @426 NONAME
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index 60e9553540..29ca6bba52 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -200,48 +200,41 @@ class CWaitRestartDlg : public CDlgBase CCtrlButton m_cancel;
protected:
- void OnInitDialog();
-
- void Timer_OnEvent(CTimer*);
-
- void Cancel_OnClick(CCtrlBase*);
-
-public:
- CWaitRestartDlg(HANDLE hProcess);
-};
-
-CWaitRestartDlg::CWaitRestartDlg(HANDLE hProcess)
- : CDlgBase(g_plugin, IDD_WAITRESTART), m_timer(this, 1),
- m_progress(this, IDC_PROGRESSBAR), m_cancel(this, IDCANCEL)
-{
- m_autoClose = 0;
- m_hProcess = hProcess;
- m_timer.OnEvent = Callback(this, &CWaitRestartDlg::Timer_OnEvent);
- m_cancel.OnClick = Callback(this, &CWaitRestartDlg::Cancel_OnClick);
-}
+ bool OnInitDialog() override
+ {
+ m_progress.SetRange(MIRANDA_PROCESS_WAIT_STEPS);
+ m_progress.SetStep(1);
+ m_timer.Start(MIRANDA_PROCESS_WAIT_RESOLUTION);
+ return true;
+ }
-void CWaitRestartDlg::OnInitDialog()
-{
- m_progress.SetRange(MIRANDA_PROCESS_WAIT_STEPS);
- m_progress.SetStep(1);
- m_timer.Start(MIRANDA_PROCESS_WAIT_RESOLUTION);
-}
+ void Timer_OnEvent(CTimer*)
+ {
+ if (m_progress.Move() == MIRANDA_PROCESS_WAIT_STEPS)
+ EndModal(0);
+ if (WaitForSingleObject(m_hProcess, 1) != WAIT_TIMEOUT) {
+ m_progress.SetPosition(MIRANDA_PROCESS_WAIT_STEPS);
+ EndModal(0);
+ }
+ }
-void CWaitRestartDlg::Timer_OnEvent(CTimer*)
-{
- if (m_progress.Move() == MIRANDA_PROCESS_WAIT_STEPS)
- EndModal(0);
- if (WaitForSingleObject(m_hProcess, 1) != WAIT_TIMEOUT) {
+ void Cancel_OnClick(CCtrlBase*)
+ {
m_progress.SetPosition(MIRANDA_PROCESS_WAIT_STEPS);
- EndModal(0);
+ EndModal(1);
}
-}
-void CWaitRestartDlg::Cancel_OnClick(CCtrlBase*)
-{
- m_progress.SetPosition(MIRANDA_PROCESS_WAIT_STEPS);
- EndModal(1);
-}
+public:
+ CWaitRestartDlg(HANDLE hProcess)
+ : CDlgBase(g_plugin, IDD_WAITRESTART), m_timer(this, 1),
+ m_progress(this, IDC_PROGRESSBAR), m_cancel(this, IDCANCEL)
+ {
+ m_autoClose = 0;
+ m_hProcess = hProcess;
+ m_timer.OnEvent = Callback(this, &CWaitRestartDlg::Timer_OnEvent);
+ m_cancel.OnClick = Callback(this, &CWaitRestartDlg::Cancel_OnClick);
+ }
+};
INT_PTR CheckRestart()
{
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index cb1492ec27..ddd93d997f 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -179,7 +179,7 @@ public: {
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_INITDIALOG)
lParam = m_lParam;
@@ -714,7 +714,7 @@ public: m_timerRebuild.OnEvent = Callback(this, &COptionsDlg::onNewPageTimer);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
Utils_RestoreWindowPositionNoSize(m_hwnd, 0, "Options", "");
Window_SetSkinIcon_IcoLib(m_hwnd, SKINICON_OTHER_OPTIONS);
@@ -787,9 +787,10 @@ public: FillFilterCombo();
RebuildPageTree();
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
ClearFilterStrings();
m_szFilterString[0] = 0;
@@ -824,7 +825,7 @@ public: pOptionsDlg = nullptr;
}
- virtual void OnApply() override
+ bool OnApply() override
{
m_btnApply.Disable();
SetFocus(m_pageTree.GetHwnd());
@@ -836,7 +837,7 @@ public: pshn.hdr.code = PSN_KILLACTIVE;
pshn.hdr.hwndFrom = opd->getHwnd();
if (SendMessage(opd->getHwnd(), WM_NOTIFY, 0, (LPARAM)&pshn))
- return;
+ return false;
}
LIST<OptionsPageData> arChanged(10, CompareOPD);
@@ -863,7 +864,7 @@ public: if (opd)
opd->pDialog->Show();
m_bInsideApply = false;
- return;
+ return false;
}
}
m_bInsideApply = false;
@@ -886,6 +887,7 @@ public: SendMessage(p->pDialog->GetHwnd(), WM_NOTIFY, 0, (LPARAM)&pshn);
}
+ return true;
}
void btnApply_Click(CCtrlButton*)
@@ -1038,7 +1040,7 @@ public: SetFocus(m_pageTree.GetHwnd());
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
switch (msg) {
case PSM_CHANGED:
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index 3d2f8a929c..48e29fd535 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -272,7 +272,7 @@ public: m_plugList.OnKeyDown = Callback(this, &CPluginOptDlg::list_OnKeyDown);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
HIMAGELIST hIml = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 4, 0);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_UNICODE);
@@ -322,9 +322,10 @@ public: m_plugList.SetColumnWidth(2, max);
m_plugList.SortItems(SortPlugins, (LPARAM)m_hwnd);
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
CMStringW bufRestart(TranslateT("Miranda NG must be restarted to apply changes for these plugins:"));
bufRestart.AppendChar('\n');
@@ -385,9 +386,10 @@ public: if (MessageBox(m_hwnd, bufRestart, L"Miranda NG", MB_ICONWARNING | MB_YESNO) == IDYES)
CallService(MS_SYSTEM_RESTART, 1, 0);
}
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
arPluginList.destroy();
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index ad50cbbde8..9bdc5bb863 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -139,7 +139,7 @@ public: m_warning(this, IDC_NODBDRIVERS) {} - virtual void OnInitDialog() + bool OnInitDialog() override { // what, no plugins?! if (arDbPlugins.getCount() == 0) { @@ -175,9 +175,10 @@ public: // focus on the textbox PostMessage(m_hwnd, WM_FOCUSTEXTBOX, 0, 0); + return true; } - virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) + INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override { switch (msg) { case WM_FOCUSTEXTBOX: @@ -201,15 +202,15 @@ public: return CDlgBase::DlgProc(msg, wParam, lParam); } - virtual void OnApply() + bool OnApply() override { LRESULT curSel = m_driverList.GetCurSel(); if (curSel == -1 || !m_bFocused) - return; // should never happen + return false; // should never happen ptrW szName(m_profileName.GetText()); if (mir_wstrlen(szName) == 0) - return; + return false; // profile placed in "profile_name" subfolder mir_snwprintf(m_pd->ptszProfile, MAX_PATH, L"%s\\%s\\%s.dat", m_pd->ptszProfileDir, szName, szName); @@ -220,6 +221,7 @@ public: SetWindowLongPtr(m_hwnd, DWLP_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE); else m_pd->bRun = true; + return true; } }; @@ -443,7 +445,7 @@ public: m_profileList.OnDoubleClick = Callback(this, &CChooseProfileDlg::list_OnDblClick); } - virtual void OnInitDialog() + bool OnInitDialog() override { // set columns LVCOLUMN col; @@ -479,9 +481,10 @@ public: m_hFileNotify = FindFirstChangeNotification(m_pd->ptszProfileDir, TRUE, FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE); if (m_hFileNotify != INVALID_HANDLE_VALUE) SetTimer(m_hwnd, 0, 1200, nullptr); + return true; } - virtual void OnDestroy() + void OnDestroy() { KillTimer(m_hwnd, 0); FindCloseChangeNotification(m_hFileNotify); @@ -524,7 +527,7 @@ public: EndDialog(GetParent(m_hwndParent), 1); } - virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) + INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override { switch (msg) { case WM_TIMER: @@ -583,7 +586,7 @@ public: m_tab.AddPage(LPGENW("New profile"), nullptr, new CCreateProfileDlg(m_btnOk, m_pd)); } - virtual void OnInitDialog() + bool OnInitDialog() override { // MUST NOT be replaced with Window_SetIcon_IcoLib!!! SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadImage(g_plugin.getInst(), MAKEINTRESOURCE(IDI_DETAILSLOGO), IMAGE_ICON, g_iIconSX, g_iIconSY, 0)); @@ -606,9 +609,10 @@ public: m_servicePlugs.AddString(TranslateW(p->pluginname), i); } } + return true; } - virtual void OnDestroy() + void OnDestroy() { LRESULT curSel = m_servicePlugs.GetCurSel(); if (curSel != -1) { diff --git a/src/mir_app/src/proto_internal.cpp b/src/mir_app/src/proto_internal.cpp index 4454e80439..616d84402d 100644 --- a/src/mir_app/src/proto_internal.cpp +++ b/src/mir_app/src/proto_internal.cpp @@ -52,22 +52,22 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE PROTO_INTERFACE(pszModuleName, ptszUserName)
{}
- virtual MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override
{
return (MCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLIST, flags, (LPARAM)psr);
}
- virtual MCONTACT AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) override
+ MCONTACT AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) override
{
return (MCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), hDbEvent);
}
- virtual int Authorize(MEVENT hDbEvent) override
+ int Authorize(MEVENT hDbEvent) override
{
return (int)ProtoCallService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hDbEvent, 0);
}
- virtual int AuthDeny(MEVENT hDbEvent, const wchar_t *szReason) override
+ int AuthDeny(MEVENT hDbEvent, const wchar_t *szReason) override
{
if (m_iVersion > 1)
return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, hDbEvent, (LPARAM)szReason);
@@ -75,13 +75,13 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, hDbEvent, _T2A(szReason));
}
- virtual int AuthRecv(MCONTACT hContact, PROTORECVEVENT *evt) override
+ int AuthRecv(MCONTACT hContact, PROTORECVEVENT *evt) override
{
CCSDATA ccs = { hContact, PSR_AUTH, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_AUTH, 0, (LPARAM)&ccs);
}
- virtual int AuthRequest(MCONTACT hContact, const wchar_t *szMessage) override
+ int AuthRequest(MCONTACT hContact, const wchar_t *szMessage) override
{
CCSDATA ccs = { hContact, PSS_AUTHREQUEST, 0, (LPARAM)szMessage };
if (m_iVersion > 1)
@@ -93,7 +93,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return res;
}
- virtual HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath) override
+ HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath) override
{
CCSDATA ccs = { hContact, PSS_FILEALLOW, (WPARAM)hTransfer, (LPARAM)szPath };
if (m_iVersion > 1)
@@ -105,13 +105,13 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return res;
}
- virtual int FileCancel(MCONTACT hContact, HANDLE hTransfer) override
+ int FileCancel(MCONTACT hContact, HANDLE hTransfer) override
{
CCSDATA ccs = { hContact, PSS_FILECANCEL, (WPARAM)hTransfer, 0 };
return (int)ProtoCallService(m_szModuleName, PSS_FILECANCEL, 0, (LPARAM)&ccs);
}
- virtual int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason) override
+ int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason) override
{
CCSDATA ccs = { hContact, PSS_FILEDENY, (WPARAM)hTransfer, (LPARAM)szReason };
if (m_iVersion > 1)
@@ -137,18 +137,18 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return res;
}
- virtual INT_PTR GetCaps(int type, MCONTACT hContact) override
+ INT_PTR GetCaps(int type, MCONTACT hContact) override
{
return ProtoCallService(m_szModuleName, PS_GETCAPS, type, hContact);
}
- virtual int GetInfo(MCONTACT hContact, int flags) override
+ int GetInfo(MCONTACT hContact, int flags) override
{
CCSDATA ccs = { hContact, PSS_GETINFO, (WPARAM)flags, 0 };
return ProtoCallService(m_szModuleName, PSS_GETINFO, 0, (LPARAM)&ccs);
}
- virtual HANDLE SearchBasic(const wchar_t* id) override
+ HANDLE SearchBasic(const wchar_t* id) override
{
if (m_iVersion > 1)
return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, (LPARAM)id);
@@ -156,14 +156,14 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, _T2A(id));
}
- virtual HANDLE SearchByEmail(const wchar_t* email) override
+ HANDLE SearchByEmail(const wchar_t* email) override
{
if (m_iVersion > 1)
return (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYEMAIL, 0, (LPARAM)email);
return (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYEMAIL, 0, _T2A(email));
}
- virtual HANDLE SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName) override
+ HANDLE SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName) override
{
PROTOSEARCHBYNAME psn;
psn.pszNick = (wchar_t*)mir_u2a(nick);
@@ -177,48 +177,48 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE }
- virtual HWND SearchAdvanced(HWND owner) override
+ HWND SearchAdvanced(HWND owner) override
{
return (HWND)ProtoCallService(m_szModuleName, PS_SEARCHBYADVANCED, 0, (LPARAM)owner);
}
- virtual HWND CreateExtendedSearchUI(HWND owner) override
+ HWND CreateExtendedSearchUI(HWND owner) override
{
return (HWND)ProtoCallService(m_szModuleName, PS_CREATEADVSEARCHUI, 0, (LPARAM)owner);
}
- virtual int RecvContacts(MCONTACT hContact, PROTORECVEVENT* evt) override
+ int RecvContacts(MCONTACT hContact, PROTORECVEVENT* evt) override
{
CCSDATA ccs = { hContact, PSR_CONTACTS, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_CONTACTS, 0, (LPARAM)&ccs);
}
- virtual int RecvFile(MCONTACT hContact, PROTORECVFILE* evt) override
+ int RecvFile(MCONTACT hContact, PROTORECVFILE* evt) override
{
CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)evt };
return ProtoCallService(m_szModuleName, PSR_FILE, 0, (LPARAM)&ccs);
}
- virtual int RecvMsg(MCONTACT hContact, PROTORECVEVENT* evt) override
+ int RecvMsg(MCONTACT hContact, PROTORECVEVENT* evt) override
{
CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)evt };
INT_PTR res = ProtoCallService(m_szModuleName, PSR_MESSAGE, 0, (LPARAM)&ccs);
return (res == CALLSERVICE_NOTFOUND) ? -1 : (int)res;
}
- virtual int RecvUrl(MCONTACT hContact, PROTORECVEVENT* evt) override
+ int RecvUrl(MCONTACT hContact, PROTORECVEVENT* evt) override
{
CCSDATA ccs = { hContact, PSR_URL, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_URL, 0, (LPARAM)&ccs);
}
- virtual int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) override
+ int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) override
{
CCSDATA ccs = { hContact, PSS_CONTACTS, MAKEWPARAM(flags, nContacts), (LPARAM)hContactsList };
return (int)ProtoCallService(m_szModuleName, PSS_CONTACTS, 0, (LPARAM)&ccs);
}
- virtual HANDLE SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles) override
+ HANDLE SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles) override
{
CCSDATA ccs = { hContact, PSS_FILE, (WPARAM)szDescription, (LPARAM)ppszFiles };
@@ -233,49 +233,49 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return res;
}
- virtual int SendMsg(MCONTACT hContact, int /*flags*/, const char *msg) override
+ int SendMsg(MCONTACT hContact, int /*flags*/, const char *msg) override
{
CCSDATA ccs = { hContact, PSS_MESSAGE, 0, (LPARAM)msg };
return (int)ProtoCallService(m_szModuleName, PSS_MESSAGE, 0, (LPARAM)&ccs);
}
- virtual int SendUrl(MCONTACT hContact, int flags, const char* url) override
+ int SendUrl(MCONTACT hContact, int flags, const char* url) override
{
CCSDATA ccs = { hContact, PSS_URL, (WPARAM)flags, (LPARAM)url };
return (int)ProtoCallService(m_szModuleName, PSS_URL, 0, (LPARAM)&ccs);
}
- virtual int SetApparentMode(MCONTACT hContact, int mode) override
+ int SetApparentMode(MCONTACT hContact, int mode) override
{
CCSDATA ccs = { hContact, PSS_SETAPPARENTMODE, (WPARAM)mode, 0 };
return (int)ProtoCallService(m_szModuleName, PSS_SETAPPARENTMODE, 0, (LPARAM)&ccs);
}
- virtual int SetStatus(int iNewStatus) override
+ int SetStatus(int iNewStatus) override
{
return (int)ProtoCallService(m_szModuleName, PS_SETSTATUS, iNewStatus, 0);
}
- virtual HANDLE GetAwayMsg(MCONTACT hContact) override
+ HANDLE GetAwayMsg(MCONTACT hContact) override
{
CCSDATA ccs = { hContact, PSS_GETAWAYMSG, 0, 0 };
return (HANDLE)ProtoCallService(m_szModuleName, PSS_GETAWAYMSG, 0, (LPARAM)&ccs);
}
- virtual int RecvAwayMsg(MCONTACT hContact, int statusMode, PROTORECVEVENT* evt) override
+ int RecvAwayMsg(MCONTACT hContact, int statusMode, PROTORECVEVENT* evt) override
{
CCSDATA ccs = { hContact, PSR_AWAYMSG, (WPARAM)statusMode, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_AWAYMSG, 0, (LPARAM)&ccs);
}
- virtual int SetAwayMsg(int iStatus, const wchar_t *msg) override
+ int SetAwayMsg(int iStatus, const wchar_t *msg) override
{
if (m_iVersion > 1)
return (int)ProtoCallService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)msg);
return (int)ProtoCallService(m_szModuleName, PS_SETAWAYMSG, iStatus, _T2A(msg));
}
- virtual int UserIsTyping(MCONTACT hContact, int type) override
+ int UserIsTyping(MCONTACT hContact, int type) override
{
CCSDATA ccs = { hContact, PSS_USERISTYPING, hContact, type };
return ProtoCallService(m_szModuleName, PSS_USERISTYPING, 0, (LPARAM)&ccs);
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index a9a2ac15e0..85e7aa0947 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -113,9 +113,8 @@ class CAccountFormDlg : public CDlgBase public:
CAccountFormDlg(CAccountManagerDlg *pParent, int action, PROTOACCOUNT *pa);
- virtual void OnInitDialog() override;
-
- void OnOk(CCtrlButton*);
+ bool OnInitDialog() override;
+ bool OnApply() override;
};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -270,7 +269,7 @@ public: m_btnNetwork.OnClick = Callback(this, &CAccountManagerDlg::OnNetwork);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
Window_SetSkinIcon_IcoLib(m_hwnd, SKINICON_OTHER_ACCMGR);
@@ -317,9 +316,10 @@ public: Refresh();
Utils_RestoreWindowPositionNoSize(m_hwnd, 0, "AccMgr", "");
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
PSHNOTIFY pshn;
pshn.hdr.idFrom = 0;
@@ -331,6 +331,7 @@ public: pa->bAccMgrUIChanged = FALSE;
}
}
+ return true;
}
virtual void OnReset() override
@@ -347,7 +348,7 @@ public: }
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
for (auto &pa : accounts) {
pa->bAccMgrUIChanged = FALSE;
@@ -813,10 +814,9 @@ CAccountFormDlg::CAccountFormDlg(CAccountManagerDlg *pParent, int action, PROTOA m_pParent(pParent)
{
m_hwndParent = pParent->GetHwnd();
- m_btnOk.OnClick = Callback(this, &CAccountFormDlg::OnOk);
}
-void CAccountFormDlg::OnInitDialog()
+bool CAccountFormDlg::OnInitDialog()
{
int cnt = 0;
for (auto &it : g_arProtos)
@@ -846,16 +846,17 @@ void CAccountFormDlg::OnInitDialog() }
m_internalName.SendMsg(EM_LIMITTEXT, 40, 0);
+ return true;
}
-void CAccountFormDlg::OnOk(CCtrlButton*)
+bool CAccountFormDlg::OnApply()
{
wchar_t tszAccName[256];
m_accName.GetText(tszAccName, _countof(tszAccName));
rtrimw(tszAccName);
if (tszAccName[0] == 0) {
MessageBox(m_hwnd, TranslateT("Account name must be filled."), TranslateT("Account error"), MB_ICONERROR | MB_OK);
- return;
+ return false;
}
if (m_action == PRAC_ADDED) {
@@ -863,7 +864,7 @@ void CAccountFormDlg::OnOk(CCtrlButton*) m_internalName.GetTextA(buf, _countof(buf));
if (FindAccountByName(rtrim(buf))) {
MessageBox(m_hwnd, TranslateT("Account name has to be unique. Please enter unique name."), TranslateT("Account error"), MB_ICONERROR | MB_OK);
- return;
+ return false;
}
}
@@ -901,6 +902,7 @@ void CAccountFormDlg::OnOk(CCtrlButton*) m_pParent->Refresh();
EndModal(IDOK);
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/proto_order.cpp b/src/mir_app/src/proto_order.cpp index 997f2b2a7b..a8f9017f45 100644 --- a/src/mir_app/src/proto_order.cpp +++ b/src/mir_app/src/proto_order.cpp @@ -158,12 +158,13 @@ public: m_order.OnDeleteItem = Callback(this, &CProtocolOrderOpts::onOrder_DeleteItem);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
FillTree();
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
// assume all accounts are disabled
for (auto &it : accounts)
@@ -201,6 +202,7 @@ public: Clist_TrayIconIconsChanged();
Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0);
Clist_Broadcast(INTM_INVALIDATE, 0, 0);
+ return true;
}
void onReset_Click(CCtrlButton*)
diff --git a/src/mir_app/src/proto_ui.cpp b/src/mir_app/src/proto_ui.cpp index 2658436bd1..ca390845c5 100644 --- a/src/mir_app/src/proto_ui.cpp +++ b/src/mir_app/src/proto_ui.cpp @@ -94,17 +94,17 @@ INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) // Protocol events
case WM_PROTO_ACTIVATE:
OnProtoActivate(wParam, lParam);
- return m_lresult;
+ return 0;
case WM_PROTO_CHECK_ONLINE:
if (m_hwndStatus)
UpdateStatusBar();
OnProtoCheckOnline(wParam, lParam);
- return m_lresult;
+ return 0;
case WM_PROTO_REFRESH:
OnProtoRefresh(wParam, lParam);
- return m_lresult;
+ return 0;
}
return CSuper::DlgProc(msg, wParam, lParam);
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index 3d70ba3952..6347d5347c 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -177,8 +177,8 @@ public: m_preview.OnBeginDrag = Callback(this, &CIconImportDlg::OnBeginDragPreview);
}
- virtual void OnInitDialog() override;
- virtual void OnClose() override;
+ bool OnInitDialog() override;
+ bool OnClose() override;
virtual int Resizer(UTILRESIZECONTROL *urc) override
{
@@ -270,7 +270,7 @@ public: MySetCursor(IDC_ARROW);
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override; // forward declaration
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override; // forward declaration
};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -563,7 +563,7 @@ public: m_categoryList.OnBuildMenu = Callback(this, &CIcoLibOptsDlg::OnTreeMenu);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
// Reset temporary data & upload sections list
{
@@ -584,9 +584,10 @@ public: m_preview.SetIconSpacing(56, 67);
RebuildTree();
+ return true;
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
switch (msg) {
case WM_NOTIFY:
@@ -623,7 +624,7 @@ public: }
}
- virtual void OnApply() override
+ bool OnApply() override
{
{
mir_cslock lck(csIconList);
@@ -646,9 +647,10 @@ public: }
DoIconsChanged();
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
HTREEITEM hti = m_categoryList.GetRoot();
while (hti != nullptr) {
@@ -821,7 +823,7 @@ public: /////////////////////////////////////////////////////////////////////////////////////////
-void CIconImportDlg::OnInitDialog()
+bool CIconImportDlg::OnInitDialog()
{
m_preview.SetImageList(ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 0, 100), LVSIL_NORMAL);
m_preview.SetIconSpacing(56, 67);
@@ -845,11 +847,13 @@ void CIconImportDlg::OnInitDialog() SHAutoComplete(m_iconSet.GetHwnd(), 1);
m_iconSet.SetText(L"icons.dll");
+ return true;
}
-void CIconImportDlg::OnClose()
+bool CIconImportDlg::OnClose()
{
m_pParent->m_btnImport.Enable();
+ return true;
}
INT_PTR CIconImportDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index ce7bf0d7c5..923b34f58f 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -630,7 +630,7 @@ LRESULT CSrmmBaseDialog::WndProc_Nicklist(UINT msg, WPARAM wParam, LPARAM lParam ///////////////////////////////////////////////////////////////////////////////////////// -void CSrmmBaseDialog::OnInitDialog() +bool CSrmmBaseDialog::OnInitDialog() { WindowList_Add(g_hWindowList, m_hwnd, m_hContact); SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this); @@ -653,6 +653,7 @@ void CSrmmBaseDialog::OnInitDialog() mir_subclassWindow(m_btnBkColor.GetHwnd(), Srmm_ButtonSubclassProc); LoadSettings(); + return true; } void CSrmmBaseDialog::OnDestroy() diff --git a/src/mir_app/src/srmm_toolbar.cpp b/src/mir_app/src/srmm_toolbar.cpp index caa774e09c..9f8f3e3aa1 100644 --- a/src/mir_app/src/srmm_toolbar.cpp +++ b/src/mir_app/src/srmm_toolbar.cpp @@ -620,7 +620,7 @@ public: m_btnSeparator.OnClick = Callback(this, &CSrmmToolbarOptions::btnSeparatorClicked); } - virtual void OnInitDialog() override + bool OnInitDialog() override { BuildMenuObjectsTree(); @@ -630,15 +630,16 @@ public: m_gap.SetRange(10); m_gap.SetPosition(db_get_b(0, BB_MODULE_NAME, "ButtonsBarGap", 1)); + return true; } - virtual void OnDestroy() override + void OnDestroy() override { ImageList_Destroy(m_toolBar.GetImageList(TVSIL_NORMAL)); ImageList_Destroy(m_toolBar.GetImageList(TVSIL_STATE)); } - virtual void OnApply() override + bool OnApply() override { OnTreeSelChanging(nullptr); // save latest changes SaveTree(); // save the whole tree then @@ -655,6 +656,7 @@ public: m_btnIM.Disable(); m_btnChat.Disable(); m_btnHidden.Disable(); + return true; } virtual void OnReset() override diff --git a/src/mir_core/src/CCtrlBase.cpp b/src/mir_core/src/CCtrlBase.cpp index 9901ce0c68..87f59e77c8 100644 --- a/src/mir_core/src/CCtrlBase.cpp +++ b/src/mir_core/src/CCtrlBase.cpp @@ -67,9 +67,10 @@ void CCtrlBase::OnDestroy() m_hwnd = nullptr; } -void CCtrlBase::OnApply() +bool CCtrlBase::OnApply() { m_bChanged = false; + return true; } void CCtrlBase::OnReset() diff --git a/src/mir_core/src/CCtrlCheck.cpp b/src/mir_core/src/CCtrlCheck.cpp index 5f220c6eba..3fe7fe2b15 100644 --- a/src/mir_core/src/CCtrlCheck.cpp +++ b/src/mir_core/src/CCtrlCheck.cpp @@ -35,12 +35,13 @@ BOOL CCtrlCheck::OnCommand(HWND, WORD, WORD) return TRUE; } -void CCtrlCheck::OnApply() +bool CCtrlCheck::OnApply() { CSuper::OnApply(); if (m_dbLink != nullptr) SaveInt(GetState()); + return true; } void CCtrlCheck::OnReset() diff --git a/src/mir_core/src/CCtrlCombo.cpp b/src/mir_core/src/CCtrlCombo.cpp index d8877ac82b..6854e841c3 100644 --- a/src/mir_core/src/CCtrlCombo.cpp +++ b/src/mir_core/src/CCtrlCombo.cpp @@ -51,7 +51,7 @@ void CCtrlCombo::OnInit() OnReset(); } -void CCtrlCombo::OnApply() +bool CCtrlCombo::OnApply() { CSuper::OnApply(); @@ -64,6 +64,7 @@ void CCtrlCombo::OnApply() else if (GetDataType() != DBVT_DELETED) { SaveInt(GetInt()); } + return true; } void CCtrlCombo::OnReset() diff --git a/src/mir_core/src/CCtrlEdit.cpp b/src/mir_core/src/CCtrlEdit.cpp index 7b821c2de2..1d08d665ac 100644 --- a/src/mir_core/src/CCtrlEdit.cpp +++ b/src/mir_core/src/CCtrlEdit.cpp @@ -36,7 +36,7 @@ BOOL CCtrlEdit::OnCommand(HWND, WORD, WORD idCode) return TRUE; } -void CCtrlEdit::OnApply() +bool CCtrlEdit::OnApply() { CSuper::OnApply(); @@ -49,6 +49,7 @@ void CCtrlEdit::OnApply() else if (GetDataType() != DBVT_DELETED) { SaveInt(GetInt()); } + return true; } void CCtrlEdit::OnReset() diff --git a/src/mir_core/src/CCtrlPages.cpp b/src/mir_core/src/CCtrlPages.cpp index d56231b796..39efe9e997 100644 --- a/src/mir_core/src/CCtrlPages.cpp +++ b/src/mir_core/src/CCtrlPages.cpp @@ -353,7 +353,7 @@ void CCtrlPages::OnReset() } } -void CCtrlPages::OnApply() +bool CCtrlPages::OnApply() { PSHNOTIFY pshn; pshn.hdr.idFrom = 0; @@ -362,10 +362,8 @@ void CCtrlPages::OnApply() if (m_pActivePage != nullptr) { pshn.hdr.code = PSN_KILLACTIVE; pshn.hdr.hwndFrom = m_pActivePage->GetHwnd(); - if (SendMessage(pshn.hdr.hwndFrom, WM_NOTIFY, 0, (LPARAM)&pshn)) { - m_parentWnd->Fail(); - return; - } + if (SendMessage(pshn.hdr.hwndFrom, WM_NOTIFY, 0, (LPARAM)&pshn)) + return false; } pshn.hdr.code = PSN_APPLY; @@ -383,12 +381,12 @@ void CCtrlPages::OnApply() m_pActivePage->Hide(); m_pActivePage = p->m_pDlg; m_pActivePage->Show(); - m_parentWnd->Fail(); - return; + return false; } } CSuper::OnApply(); + return true; } void CCtrlPages::OnDestroy() diff --git a/src/mir_core/src/CCtrlSpin.cpp b/src/mir_core/src/CCtrlSpin.cpp index f0af3c9609..a348b5c5e4 100644 --- a/src/mir_core/src/CCtrlSpin.cpp +++ b/src/mir_core/src/CCtrlSpin.cpp @@ -38,12 +38,13 @@ BOOL CCtrlSpin::OnNotify(int, NMHDR *pnmh) return FALSE; } -void CCtrlSpin::OnApply() +bool CCtrlSpin::OnApply() { CSuper::OnApply(); if (m_dbLink != nullptr) SaveInt(GetPosition()); + return true; } void CCtrlSpin::OnReset() diff --git a/src/mir_core/src/CDlgBase.cpp b/src/mir_core/src/CDlgBase.cpp index a92012e996..6bf0b703b4 100644 --- a/src/mir_core/src/CDlgBase.cpp +++ b/src/mir_core/src/CDlgBase.cpp @@ -51,10 +51,7 @@ CDlgBase::CDlgBase(CMPluginBase &pPlug, int idDialog) m_pPlugin(pPlug) { m_idDialog = idDialog; - m_hwnd = m_hwndParent = nullptr; - m_isModal = m_initialized = m_bExiting = false; m_autoClose = CLOSE_ON_OK | CLOSE_ON_CANCEL; - m_forceResizable = false; } CDlgBase::~CDlgBase() @@ -65,6 +62,36 @@ CDlgBase::~CDlgBase() } ///////////////////////////////////////////////////////////////////////////////////////// +// events + +bool CDlgBase::OnInitDialog() +{ + return true; +} + +bool CDlgBase::OnClose() +{ + return true; +} + +bool CDlgBase::OnApply() +{ + return true; +} + +void CDlgBase::OnChange() +{} + +void CDlgBase::OnDestroy() +{} + +void CDlgBase::OnReset() +{} + +void CDlgBase::OnTimer(CTimer*) +{} + +///////////////////////////////////////////////////////////////////////////////////////// // methods void CDlgBase::Close() @@ -181,7 +208,8 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) ::EnumChildWindows(m_hwnd, &GlobalFieldEnum, LPARAM(this)); NotifyControls(&CCtrlBase::OnInit); - OnInitDialog(); + if (!OnInitDialog()) + return FALSE; m_initialized = true; return TRUE; @@ -244,16 +272,15 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) // close dialog automatically if 'OK' button is pressed if (idCtrl == IDOK && (m_autoClose & CLOSE_ON_OK)) { // validate dialog data first - m_bExiting = true; - m_lresult = TRUE; - NotifyControls(&CCtrlBase::OnApply); - OnApply(); - - // everything ok? good, let's close it - if (m_lresult == TRUE) - PostMessage(m_hwnd, WM_CLOSE, 0, 0); - else - m_bExiting = false; + if (VerifyControls(&CCtrlBase::OnApply)) { + m_bExiting = true; + + // everything ok? good, let's close it + if (OnApply()) + PostMessage(m_hwnd, WM_CLOSE, 0, 0); + else + m_bExiting = false; + } } } } @@ -269,10 +296,10 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) if (LPPSHNOTIFY(lParam)->lParam != 3) // IDC_APPLY m_bExiting = true; - m_lresult = true; - NotifyControls(&CCtrlBase::OnApply); - if (m_lresult) - OnApply(); + if (!VerifyControls(&CCtrlBase::OnApply)) + m_bExiting = false; + else if (!OnApply()) + m_bExiting = false; break; case PSN_RESET: @@ -312,10 +339,8 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) return FALSE; case WM_CLOSE: - m_bExiting = true; - m_lresult = FALSE; - OnClose(); - if (!m_lresult) { + if (OnClose()) { + m_bExiting = true; if (m_isModal) EndModal(0); else @@ -384,6 +409,15 @@ void CDlgBase::NotifyControls(void (CCtrlBase::*fn)()) (it->*fn)(); } +bool CDlgBase::VerifyControls(bool (CCtrlBase::*fn)()) +{ + for (auto &it : m_controls) + if (!(it->*fn)()) + return false; + + return true; +} + CCtrlBase* CDlgBase::FindControl(int idCtrl) { CCtrlBase search(nullptr, idCtrl); diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 678e5453e5..3c0afec46b 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -738,13 +738,13 @@ mir_wstrcmpi @280 ?MapIndexToID@CCtrlListView@@QAEII@Z @909 NONAME
?NotifyChange@CCtrlBase@@QAEXXZ @910 NONAME
?NotifyControls@CDlgBase@@AAEXP8CCtrlBase@@AEXXZ@Z @911 NONAME
-?OnApply@CCtrlBase@@UAEXXZ @912 NONAME
-?OnApply@CCtrlCheck@@UAEXXZ @913 NONAME
-?OnApply@CCtrlCombo@@UAEXXZ @914 NONAME
-?OnApply@CCtrlEdit@@UAEXXZ @915 NONAME
-?OnApply@CDlgBase@@MAEXXZ @916 NONAME
+?OnApply@CCtrlBase@@UAE_NXZ @912 NONAME
+?OnApply@CCtrlCheck@@UAE_NXZ @913 NONAME
+?OnApply@CCtrlCombo@@UAE_NXZ @914 NONAME
+?OnApply@CCtrlEdit@@UAE_NXZ @915 NONAME
+?OnApply@CDlgBase@@MAE_NXZ @916 NONAME
?OnChange@CDlgBase@@MAEXXZ @917 NONAME
-?OnClose@CDlgBase@@MAEXXZ @918 NONAME
+?OnClose@CDlgBase@@MAE_NXZ @918 NONAME
?OnCommand@CCtrlBase@@UAEHPAUHWND__@@GG@Z @919 NONAME
?OnCommand@CCtrlButton@@UAEHPAUHWND__@@GG@Z @920 NONAME
?OnCommand@CCtrlCheck@@UAEHPAUHWND__@@GG@Z @921 NONAME
@@ -762,7 +762,7 @@ mir_wstrcmpi @280 ?OnInit@CCtrlData@@UAEXXZ @934 NONAME
?OnInit@CCtrlMButton@@UAEXXZ @936 NONAME
?OnInit@CCtrlPages@@MAEXXZ @937 NONAME
-?OnInitDialog@CDlgBase@@MAEXXZ @938 NONAME
+?OnInitDialog@CDlgBase@@MAE_NXZ @938 NONAME
?OnMeasureItem@CCtrlBase@@UAEHPAUtagMEASUREITEMSTRUCT@@@Z @939 NONAME
?OnNotify@CCtrlBase@@UAEHHPAUtagNMHDR@@@Z @940 NONAME
?OnNotify@CCtrlClc@@MAEHHPAUtagNMHDR@@@Z @941 NONAME
@@ -907,8 +907,7 @@ mir_wstrcmpi @280 ?UnselectAll@CCtrlTreeView@@QAEXXZ @1093 NONAME
?MoveItemAbove@CCtrlTreeView@@AAEPAU_TREEITEM@@PAU2@00@Z @1094 NONAME
?GetCurrPage@CCtrlPages@@AAEPAUTPageInfo@1@XZ @1095 NONAME
-?Fail@CDlgBase@@QAEXXZ @1096 NONAME
-?OnApply@CCtrlPages@@MAEXXZ @1097 NONAME
+?OnApply@CCtrlPages@@MAE_NXZ @1097 NONAME
?OnReset@CCtrlPages@@MAEXXZ @1098 NONAME
Bitmap_GetFilter @1099
Bitmap_Load @1100
@@ -1055,7 +1054,7 @@ IsTerminalDisconnected @1245 ?OnDestroy@CCtrlTreeView@@MAEXXZ @1249 NONAME
?GetUrl@CCtrlHyperlink@@QAEPBDXZ @1250 NONAME
?IsChecked@CCtrlCheck@@QAE_NXZ @1251 NONAME
-?OnApply@CCtrlSpin@@UAEXXZ @1252 NONAME
+?OnApply@CCtrlSpin@@UAE_NXZ @1252 NONAME
?OnReset@CCtrlSpin@@UAEXXZ @1253 NONAME
?SetUrl@CCtrlHyperlink@@QAEXPBD@Z @1254 NONAME
?Default_OnClick@CCtrlHyperlink@@IAEXPAV1@@Z @1255 NONAME
@@ -1068,3 +1067,4 @@ CallObjectEventHook @1259 ?CreateLink@CDlgBase@@IAEXAAVCCtrlData@@PBDEK@Z @1262 NONAME
?CreateLink@CDlgBase@@IAEXAAVCCtrlData@@PBDPA_W@Z @1263 NONAME
?CheckRowCount@CCtrlPages@@AAEXXZ @1264 NONAME
+?VerifyControls@CDlgBase@@AAE_NP8CCtrlBase@@AE_NXZ@Z @1265 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index f84202ff91..05064e9e3b 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -738,13 +738,13 @@ mir_wstrcmpi @280 ?MapIndexToID@CCtrlListView@@QEAAII@Z @909 NONAME
?NotifyChange@CCtrlBase@@QEAAXXZ @910 NONAME
?NotifyControls@CDlgBase@@AEAAXP8CCtrlBase@@EAAXXZ@Z @911 NONAME
-?OnApply@CCtrlBase@@UEAAXXZ @912 NONAME
-?OnApply@CCtrlCheck@@UEAAXXZ @913 NONAME
-?OnApply@CCtrlCombo@@UEAAXXZ @914 NONAME
-?OnApply@CCtrlEdit@@UEAAXXZ @915 NONAME
-?OnApply@CDlgBase@@MEAAXXZ @916 NONAME
+?OnApply@CCtrlBase@@UEAA_NXZ @912 NONAME
+?OnApply@CCtrlCheck@@UEAA_NXZ @913 NONAME
+?OnApply@CCtrlCombo@@UEAA_NXZ @914 NONAME
+?OnApply@CCtrlEdit@@UEAA_NXZ @915 NONAME
+?OnApply@CDlgBase@@MEAA_NXZ @916 NONAME
?OnChange@CDlgBase@@MEAAXXZ @917 NONAME
-?OnClose@CDlgBase@@MEAAXXZ @918 NONAME
+?OnClose@CDlgBase@@MEAA_NXZ @918 NONAME
?OnCommand@CCtrlBase@@UEAAHPEAUHWND__@@GG@Z @919 NONAME
?OnCommand@CCtrlButton@@UEAAHPEAUHWND__@@GG@Z @920 NONAME
?OnCommand@CCtrlCheck@@UEAAHPEAUHWND__@@GG@Z @921 NONAME
@@ -762,7 +762,7 @@ mir_wstrcmpi @280 ?OnInit@CCtrlData@@UEAAXXZ @934 NONAME
?OnInit@CCtrlMButton@@UEAAXXZ @936 NONAME
?OnInit@CCtrlPages@@MEAAXXZ @937 NONAME
-?OnInitDialog@CDlgBase@@MEAAXXZ @938 NONAME
+?OnInitDialog@CDlgBase@@MEAA_NXZ @938 NONAME
?OnMeasureItem@CCtrlBase@@UEAAHPEAUtagMEASUREITEMSTRUCT@@@Z @939 NONAME
?OnNotify@CCtrlBase@@UEAAHHPEAUtagNMHDR@@@Z @940 NONAME
?OnNotify@CCtrlClc@@MEAAHHPEAUtagNMHDR@@@Z @941 NONAME
@@ -907,8 +907,7 @@ mir_wstrcmpi @280 ?UnselectAll@CCtrlTreeView@@QEAAXXZ @1093 NONAME
?MoveItemAbove@CCtrlTreeView@@AEAAPEAU_TREEITEM@@PEAU2@00@Z @1094 NONAME
?GetCurrPage@CCtrlPages@@AEAAPEAUTPageInfo@1@XZ @1095 NONAME
-?Fail@CDlgBase@@QEAAXXZ @1096 NONAME
-?OnApply@CCtrlPages@@MEAAXXZ @1097 NONAME
+?OnApply@CCtrlPages@@MEAA_NXZ @1097 NONAME
?OnReset@CCtrlPages@@MEAAXXZ @1098 NONAME
Bitmap_GetFilter @1099
Bitmap_Load @1100
@@ -1056,7 +1055,7 @@ IsTerminalDisconnected @1245 ?Default_OnClick@CCtrlHyperlink@@IEAAXPEAV1@@Z @1250 NONAME
?GetUrl@CCtrlHyperlink@@QEAAPEBDXZ @1251 NONAME
?IsChecked@CCtrlCheck@@QEAA_NXZ @1252 NONAME
-?OnApply@CCtrlSpin@@UEAAXXZ @1253 NONAME
+?OnApply@CCtrlSpin@@UEAA_NXZ @1253 NONAME
?OnReset@CCtrlSpin@@UEAAXXZ @1254 NONAME
?SetUrl@CCtrlHyperlink@@QEAAXPEBD@Z @1255 NONAME
??0CCtrlLabel@@QEAA@PEAVCDlgBase@@H@Z @1256 NONAME
@@ -1068,3 +1067,4 @@ CallObjectEventHook @1259 ?CreateLink@CDlgBase@@IEAAXAEAVCCtrlData@@PEBDEK@Z @1262 NONAME
?CreateLink@CDlgBase@@IEAAXAEAVCCtrlData@@PEBDPEA_W@Z @1263 NONAME
?CheckRowCount@CCtrlPages@@AEAAXXZ @1264 NONAME
+?VerifyControls@CDlgBase@@AEAA_NP8CCtrlBase@@EAA_NXZ@Z @1265 NONAME
|