Fix checking modal result, handle mrCancel. Issue: #40920

This commit is contained in:
Martin 2024-04-25 21:47:15 +02:00
parent 0002e72121
commit 49f44c8ee1
9 changed files with 11 additions and 11 deletions

View File

@ -300,7 +300,7 @@ begin
Data := FVSTPackages.GetNodeData(Node); Data := FVSTPackages.GetNodeData(Node);
if Data^.FDataType = 1 then if Data^.FDataType = 1 then
begin begin
if MessageDlgEx(Format(rsCreateRepositoryFrm_Conf1, [Data^.FDisplayname]), mtConfirmation, [mbYes, mbNo], Self) = mrNo then if MessageDlgEx(Format(rsCreateRepositoryFrm_Conf1, [Data^.FDisplayname]), mtConfirmation, [mbYes, mbNo], Self) <> mrYes then
Exit; Exit;
CanGo := False; CanGo := False;
PackageIndex := FSerializablePackages.FindPackageIndex(Data^.FName, fpbPackageName); PackageIndex := FSerializablePackages.FindPackageIndex(Data^.FName, fpbPackageName);

View File

@ -1213,7 +1213,7 @@ var
Node: PVirtualNode; Node: PVirtualNode;
MetaPkg: TMetaPackage; MetaPkg: TMetaPackage;
begin begin
if MessageDlgEx(rsMainFrm_miResetRating + '?', mtConfirmation, [mbYes, mbNo], Self) = mrNo then if MessageDlgEx(rsMainFrm_miResetRating + '?', mtConfirmation, [mbYes, mbNo], Self) <> mrYes then
Exit; Exit;
Node := VisualTree.VST.GetFirstSelected; Node := VisualTree.VST.GetFirstSelected;
if Node <> nil then if Node <> nil then

View File

@ -93,7 +93,7 @@ begin
if SDRep.Execute then if SDRep.Execute then
begin begin
if (not IsDirectoryEmpty(ExtractFilePath(SDRep.FileName))) then if (not IsDirectoryEmpty(ExtractFilePath(SDRep.FileName))) then
if MessageDlgEx(Format(rsCreateRepositoryFrm_Info1, [ExtractFilePath(SDRep.FileName)]), mtConfirmation, [mbYes, mbNo], Self) = mrNo then if MessageDlgEx(Format(rsCreateRepositoryFrm_Info1, [ExtractFilePath(SDRep.FileName)]), mtConfirmation, [mbYes, mbNo], Self) <> mrYes then
Exit; Exit;
if not DirectoryIsWritable(ExtractFilePath(SDRep.FileName)) then if not DirectoryIsWritable(ExtractFilePath(SDRep.FileName)) then
begin begin

View File

@ -289,7 +289,7 @@ begin
if Dataset.TableExists then if Dataset.TableExists then
begin begin
if MessageDlg(Format(sATableNamedAlreadyExistsAreYouSureYouWantToReplace, [Dataset.TableName, LineEnding]), if MessageDlg(Format(sATableNamedAlreadyExistsAreYouSureYouWantToReplace, [Dataset.TableName, LineEnding]),
mtWarning,[mbYes,MbNo],0) = mrNo then mtWarning,[mbYes,mbNo],0) <> mrYes then
exit exit
else else
DataSet.ExecSQL('DROP TABLE '+DataSet.TableName+';'); DataSet.ExecSQL('DROP TABLE '+DataSet.TableName+';');

View File

@ -306,7 +306,7 @@ begin
if IDEMessageDialog(dlgMarkupUserDefinedDelCaption, if IDEMessageDialog(dlgMarkupUserDefinedDelCaption,
Format(dlgMarkupUserDefinedDelPrompt, [FUserWords.Name]), Format(dlgMarkupUserDefinedDelPrompt, [FUserWords.Name]),
mtConfirmation, mbYesNo) = mrNo mtConfirmation, mbYesNo) <> mrYes
then then
exit; exit;

View File

@ -852,7 +852,7 @@ begin
if EnvironmentDebugOpts.ConfirmDeleteFileBreakPoints then begin if EnvironmentDebugOpts.ConfirmDeleteFileBreakPoints then begin
MsgResult:=TaskDlg(lisDeleteAllBreakpoints, lisDeleteAllBreakpoints2, '', tdiQuestion, MsgResult:=TaskDlg(lisDeleteAllBreakpoints, lisDeleteAllBreakpoints2, '', tdiQuestion,
[mbYes, mbNo], dbgDoNotShowThisMessageAgain, NotAgain); [mbYes, mbNo], dbgDoNotShowThisMessageAgain, NotAgain);
if MsgResult = mrNo then if MsgResult <> mrYes then
exit; exit;
if NotAgain then if NotAgain then
EnvironmentDebugOpts.ConfirmDeleteFileBreakPoints:= False; EnvironmentDebugOpts.ConfirmDeleteFileBreakPoints:= False;
@ -927,7 +927,7 @@ begin
if EnvironmentDebugOpts.ConfirmDeleteAllBreakPoints then begin if EnvironmentDebugOpts.ConfirmDeleteAllBreakPoints then begin
MsgResult:=TaskDlg(lisDeleteAllBreakpoints, lisDeleteAllBreakpoints, '', tdiQuestion, MsgResult:=TaskDlg(lisDeleteAllBreakpoints, lisDeleteAllBreakpoints, '', tdiQuestion,
[mbYes, mbNo], dbgDoNotShowThisMessageAgain, NotAgain); [mbYes, mbNo], dbgDoNotShowThisMessageAgain, NotAgain);
if MsgResult = mrNo then if MsgResult <> mrYes then
exit; exit;
if NotAgain then if NotAgain then
EnvironmentDebugOpts.ConfirmDeleteAllBreakPoints := False; EnvironmentDebugOpts.ConfirmDeleteAllBreakPoints := False;

View File

@ -125,7 +125,7 @@ begin
if EnvironmentDebugOpts.ConfirmDeleteAllHistory then begin if EnvironmentDebugOpts.ConfirmDeleteAllHistory then begin
MsgResult:=TaskDlg(dlgHistoryDeleteAllConfirm, dlgHistoryDeleteAllConfirm, '', tdiQuestion, MsgResult:=TaskDlg(dlgHistoryDeleteAllConfirm, dlgHistoryDeleteAllConfirm, '', tdiQuestion,
[mbYes, mbNo], dbgDoNotShowThisMessageAgain, NotAgain); [mbYes, mbNo], dbgDoNotShowThisMessageAgain, NotAgain);
if MsgResult = mrNo then if MsgResult <> mrYes then
exit; exit;
if NotAgain then if NotAgain then
EnvironmentDebugOpts.ConfirmDeleteAllHistory := False; EnvironmentDebugOpts.ConfirmDeleteAllHistory := False;

View File

@ -908,7 +908,7 @@ begin
if EnvironmentDebugOpts.ConfirmDeleteAllWatches then begin if EnvironmentDebugOpts.ConfirmDeleteAllWatches then begin
MsgResult:=TaskDlg(dlgWatchesDeleteAllConfirm, dlgWatchesDeleteAllConfirm, '', tdiQuestion, MsgResult:=TaskDlg(dlgWatchesDeleteAllConfirm, dlgWatchesDeleteAllConfirm, '', tdiQuestion,
[mbYes, mbNo], dbgDoNotShowThisMessageAgain, NotAgain); [mbYes, mbNo], dbgDoNotShowThisMessageAgain, NotAgain);
if MsgResult = mrNo then if MsgResult <> mrYes then
exit; exit;
if NotAgain then if NotAgain then
EnvironmentDebugOpts.ConfirmDeleteAllWatches := False; EnvironmentDebugOpts.ConfirmDeleteAllWatches := False;

View File

@ -181,7 +181,7 @@ var
begin begin
if MessageDlg('This will add all files in the project directory ' + LineEnding + if MessageDlg('This will add all files in the project directory ' + LineEnding +
'recursively. Do you want to continue?', 'recursively. Do you want to continue?',
mtConfirmation, [mbYes, mbNo],0) = mrNo then exit; mtConfirmation, [mbYes, mbNo],0) <> mrYes then exit;
Modified := True; Modified := True;
Files := TStringList.Create; Files := TStringList.Create;
try try
@ -384,7 +384,7 @@ begin
If SaveDialog1.Execute then If SaveDialog1.Execute then
begin begin
if FileExists(SaveDialog1.FileName) if FileExists(SaveDialog1.FileName)
and (MessageDlg('File Already Exists! Ovewrite?', mtWarning, [mbYes, mbNo],0) = mrNo) then Exit; and (MessageDlg('File Already Exists! Ovewrite?', mtWarning, [mbYes, mbNo],0) <> mrYes) then Exit;
OpenProject(SaveDialog1.FileName); OpenProject(SaveDialog1.FileName);
Project.SaveToFile(SaveDialog1.FileName); Project.SaveToFile(SaveDialog1.FileName);
end; end;