summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-11 17:09:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-11 17:09:17 +0300
commitb2c91edc9646daa331de71d589e4fec6bdef4945 (patch)
tree847a77d0686d26e25b126313fbaa8262c81f8d1a /plugins
parentae081843e9663b3cb36b17309fbce1d2967315f1 (diff)
GUI change:
- methods OnInitDialog, OnApply & OnClose of CDlgBase now return true if successful. return of false prevents a dialog from being loaded or left respectively; - massive code cleaning considering the 'virtual' attribute of overridden methods; - also fixes #1476 (Don't close "Create new account" window if user not set account name)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AuthState/src/options.h3
-rw-r--r--plugins/CloudFile/src/oauth.cpp3
-rw-r--r--plugins/CloudFile/src/oauth.h2
-rw-r--r--plugins/CloudFile/src/options.cpp9
-rw-r--r--plugins/CloudFile/src/options.h6
-rw-r--r--plugins/Db3x_mmap/src/ui.h6
-rw-r--r--plugins/Db_autobackups/src/options.cpp8
-rw-r--r--plugins/Dbx_mdbx/src/ui.h56
-rw-r--r--plugins/MirLua/src/Modules/m_options.cpp6
-rw-r--r--plugins/MirLua/src/options.cpp9
-rw-r--r--plugins/MirLua/src/options.h6
-rwxr-xr-xplugins/New_GPG/src/options.cpp27
-rwxr-xr-xplugins/New_GPG/src/ui.cpp320
-rwxr-xr-xplugins/New_GPG/src/ui.h18
-rw-r--r--plugins/NewsAggregator/Src/Authentication.cpp3
-rw-r--r--plugins/NewsAggregator/Src/Options.cpp28
-rw-r--r--plugins/NewsAggregator/Src/Options.h24
-rw-r--r--plugins/Scriver/src/chat_window.cpp3
-rw-r--r--plugins/Scriver/src/msgdialog.cpp3
-rw-r--r--plugins/Scriver/src/msgoptions.cpp24
-rw-r--r--plugins/Scriver/src/msgs.h6
-rw-r--r--plugins/Scriver/src/msgtimedout.cpp3
-rw-r--r--plugins/StartPosition/src/options.cpp6
-rw-r--r--plugins/StartPosition/src/options.h4
-rw-r--r--plugins/StatusManager/src/options.cpp3
-rw-r--r--plugins/StatusManager/src/ss_options.cpp21
-rwxr-xr-xplugins/StopSpamMod/src/options.cpp39
-rw-r--r--plugins/StopSpamPlus/src/options.cpp12
-rw-r--r--plugins/TabSRMM/src/chat_options.cpp26
-rw-r--r--plugins/TabSRMM/src/chat_window.cpp3
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp3
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp54
-rw-r--r--plugins/TabSRMM/src/msgs.cpp3
-rw-r--r--plugins/TabSRMM/src/msgs.h50
-rw-r--r--plugins/TabSRMM/src/templates.cpp3
-rw-r--r--plugins/Toaster/src/options.cpp3
-rw-r--r--plugins/Toaster/src/options.h2
-rwxr-xr-xplugins/Watrack_MPD/src/options.cpp9
38 files changed, 481 insertions, 333 deletions
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;