Merge branch 'issue-40920-by-n8700-mrcancel-not-handled' into 'main'

Draft: FOR REVIEW ( Issue  ): Handle mrCancel in question dialogs.

See merge request freepascal.org/lazarus/lazarus!281
This commit is contained in:
Martin 2025-04-04 16:35:43 +02:00
commit b235c7b0bc
2 changed files with 4 additions and 4 deletions
ide/packages/idepackager
tools/lazdatadesktop

View File

@ -3664,7 +3664,7 @@ begin
Result:=CheckIfCurPkgOutDirNeedsCompile(APackage,
true,SkipDesignTimePackages,GroupCompile,
NeedBuildAllFlag,ConfigChanged,DependenciesChanged,Note);
if Result=mrNo then begin
if Result in [mrNo, mrCancel] then begin
// the current output is valid
exit;
end;
@ -3729,7 +3729,7 @@ begin
DefResult:=CheckIfCurPkgOutDirNeedsCompile(APackage,
true,SkipDesignTimePackages,GroupCompile,
NeedBuildAllFlag,ConfigChanged,DependenciesChanged,Note);
if IsDefDirWritable or (DefResult=mrNo) then begin
if IsDefDirWritable or (DefResult in [mrNo, mrCancel]) then begin
// switching back to the default output directory
debugln(['Hint: (lazarus) switching back to the normal output directory: "',APackage.GetOutputDirectory,'" Package ',APackage.IDAsString]);
Note+='Switching back to default output directory.'+LineEnding;
@ -4484,7 +4484,7 @@ begin
if Note<>'' then
Note:='Compile reason: '+Note;
if (pcfOnlyIfNeeded in Flags) then begin
if Result=mrNo then begin
if Result in [mrNo, mrCancel] then begin
//DebugLn(['TLazPackageGraph.CompilePackage ',APackage.IDAsString,' does not need compilation.']);
Result:=mrOk;
exit;

View File

@ -1514,7 +1514,7 @@ procedure TMainForm.DoImport(const EngineName, ConnectionString: String);
Function UseNewDataDict : Boolean;
begin
Result:=(mrNo=QuestionDLG(SImportDictInto,SWhichCurrentDictToUse,mtInformation,[mrYes,SUseCurrentDict,mrNo,SUseNewDict],0))
Result:=mrYes<>QuestionDlg(SImportDictInto,SWhichCurrentDictToUse,mtInformation,[mrYes,SUseCurrentDict,mrNo,SUseNewDict],0);
end;
Var