From 883293a51a6ca91dba991c3afed74dd2d1943996 Mon Sep 17 00:00:00 2001 From: ondrej Date: Fri, 3 Feb 2017 08:27:50 +0000 Subject: [PATCH] IDE: open LPI dialog - cancel opening on ESC. git-svn-id: trunk@54078 - --- ide/sourcefilemanager.pas | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ide/sourcefilemanager.pas b/ide/sourcefilemanager.pas index 106cc77f80..90ad4c3e93 100644 --- a/ide/sourcefilemanager.pas +++ b/ide/sourcefilemanager.pas @@ -1095,15 +1095,19 @@ begin // either this is a lazarus project or it is not yet a lazarus project ;) LPIFilename:=ChangeFileExt(FFilename,'.lpi'); if FileExistsCached(LPIFilename) then begin - if IDEQuestionDialog(lisProjectInfoFileDetected, + case IDEQuestionDialog(lisProjectInfoFileDetected, Format(lisTheFileSeemsToBeTheProgramFileOfAnExistingLazarusP, [FFilename]), mtConfirmation, - [mrOk, lisOpenProject2, mrCancel, lisOpenTheFileAsNormalSource])=mrOk then - begin - Result:=MainIDE.DoOpenProjectFile(LPIFilename,[ofAddToRecent]); - if Result = mrOK then - Result := mrIgnore; - exit; + [mrOk, lisOpenProject2, mrAbort, lisOpenTheFileAsNormalSource]) + of + mrOk: + begin + Result:=MainIDE.DoOpenProjectFile(LPIFilename,[ofAddToRecent]); + if Result = mrOK then + Result := mrIgnore; + exit; + end; + mrCancel: Exit; end; end else begin AText:=Format(lisTheFileSeemsToBeAProgramCloseCurrentProject,