From f43be0afa0cfc3262d040e6e28642e5d10b215ca Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 15 Dec 2015 17:22:20 +0000 Subject: fix for creating erroneous .dat in Profile Manager git-svn-id: http://svn.miranda-ng.org/main/trunk@15868 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_app/src/profilemanager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index caa4215997..c530aae139 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -127,6 +127,7 @@ class CCreateProfileDlg : public CDlgBase return 1; } + bool m_bFocused; CCtrlCombo m_driverList; CCtrlEdit m_profileName; CCtrlBase m_warning; @@ -136,6 +137,7 @@ public: CDlgBase(g_hInst, IDD_PROFILE_NEW), m_btnOk(_btn), m_pd(_pd), + m_bFocused(false), m_driverList(this, IDC_PROFILEDRIVERS), m_profileName(this, IDC_PROFILENAME), m_warning(this, IDC_NODBDRIVERS) @@ -196,7 +198,9 @@ public: if (wParam) { m_btnOk.SetText(TranslateT("&Create")); SendMessage(m_hwnd, WM_INPUTCHANGED, 0, 0); + m_bFocused = true; } + else m_bFocused = false; break; } return CDlgBase::DlgProc(msg, wParam, lParam); @@ -205,11 +209,11 @@ public: virtual void OnApply() { LRESULT curSel = m_driverList.GetCurSel(); - if (curSel == -1) + if (curSel == -1 || !m_bFocused) return; // should never happen ptrT szName(m_profileName.GetText()); - if (szName == 0) + if (mir_tstrlen(szName) == 0) return; // profile placed in "profile_name" subfolder -- cgit v1.2.3