From 210acddc8bc8d48c7a3d71c09db0eed3f5a9c2b0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 10 Jun 2020 22:02:52 +0300 Subject: =?UTF-8?q?fixes=20#2438=20(Jabber:=20=D1=81=D0=BF=D0=B8=D1=81?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BF=D1=80=D0=B8=D0=B2=D0=B0=D1=82=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D0=B8=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=BD=D0=BE?= =?UTF-8?q?=20=D1=81=D0=B5=D0=B1=D1=8F=20=D0=B2=D0=B5=D0=B4=D1=83=D1=82)?= =?UTF-8?q?=20+=20some=20another=20DoModal()=20calls=20cleaning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mir_app/src/db_ini.cpp | 16 +++++++++------- src/mir_app/src/proto_opts.cpp | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mir_app/src/db_ini.cpp b/src/mir_app/src/db_ini.cpp index 31d65c2627..2580d8eb3d 100644 --- a/src/mir_app/src/db_ini.cpp +++ b/src/mir_app/src/db_ini.cpp @@ -46,16 +46,17 @@ protected: m_iniName.SetText(m_szIniPath); wchar_t szSecurity[11]; - const wchar_t *pszSecurityInfo; - Profile_GetSetting(L"AutoExec/Warn", szSecurity, L"notsafe"); + + const wchar_t *pszSecurityInfo; 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; + else + pszSecurityInfo = nullptr; if (pszSecurityInfo) m_securityInfo.SetText(TranslateW(pszSecurityInfo)); @@ -70,7 +71,7 @@ protected: void NoToAll_OnClick(CCtrlBase*) { - Close(); + EndModal(IDC_NOTOALL); } public: @@ -135,13 +136,14 @@ protected: 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); + + const wchar_t *pszSecurityInfo; 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)) @@ -158,9 +160,9 @@ protected: m_warnInfo->warnNoMore = m_noWarn.GetState(); } - void YesNo_OnClick(CCtrlBase*) + void YesNo_OnClick(CCtrlBase *pButton) { - Close(); + EndModal(pButton->GetCtrlId()); } public: diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index ba09d8cf6f..1f5913d960 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -489,7 +489,7 @@ public: void OnAdd(CCtrlButton*) { - if (IDOK == CAccountFormDlg(this, PRAC_ADDED, nullptr).DoModal()) { + if (CAccountFormDlg(this, PRAC_ADDED, nullptr).DoModal()) { m_iPrevSel = -1; Refresh(); } -- cgit v1.2.3