lazbuild: replaced some MessageDlg with IDEMessageDialog

git-svn-id: trunk@36680 -
This commit is contained in:
mattias 2012-04-09 14:58:59 +00:00
parent bdef003197
commit 2ec91c5b8e
14 changed files with 207 additions and 200 deletions

View File

@ -49,7 +49,7 @@ uses
InterfaceBase, Themes, CheckLst, Menus, ComCtrls, DividerBevel,
DefineTemplates,
// IDEIntf
LazIDEIntf, IDEMsgIntf, IDEHelpIntf, IDEImagesIntf, IDEWindowIntf,
LazIDEIntf, IDEMsgIntf, IDEHelpIntf, IDEImagesIntf, IDEWindowIntf, IDEDialogs,
// IDE
LazarusIDEStrConsts, TransferMacros, LazConf, IDEProcs, DialogProcs, MainBar,
InputHistory, ExtToolDialog, ExtToolEditDlg, EnvironmentOpts,
@ -214,10 +214,10 @@ function MakeLazarus(Profile: TBuildLazarusProfile;
begin
if DirectoryIsWritableCached(Dir) then exit(true);
Result:=false;
MessageDlg(lisBuildingLazarusFailed,
IDEMessageDialog(lisBuildingLazarusFailed,
Format(lisThisSetOfOptionsToBuildLazarusIsNotSupportedByThis,
[#13, '"', Dir, '"', #13]),
mtError,[mbCancel],0);
mtError,[mbCancel]);
end;
procedure CleanLazarusSrcDir(Dir: string; Recursive: boolean = true);
@ -280,10 +280,10 @@ begin
if (Tool.Filename='') or (not FileExistsUTF8(Tool.Filename)) then begin
Tool.Filename:=FindDefaultMakePath;
if (Tool.Filename='') or (not FileExistsUTF8(Tool.Filename)) then begin
MessageDlg(lisMakeNotFound,
IDEMessageDialog(lisMakeNotFound,
Format(lisTheProgramMakeWasNotFoundThisToolIsNeededToBuildLa,
['"', '"', #13, #13]),
mtError,[mbCancel],0);
mtError,[mbCancel]);
exit;
end;
end;
@ -690,10 +690,10 @@ begin
end;
except
on E: Exception do begin
Result:=MessageDlg(lisLazBuildErrorWritingFile,
Result:=IDEMessageDialog(lisLazBuildErrorWritingFile,
Format(lisLazBuildUnableToWriteFile, [Filename, #13])
+E.Message,
mtError,[mbCancel,mbAbort],0);
mtError,[mbCancel,mbAbort]);
exit;
end;
end;

View File

@ -257,7 +257,7 @@ begin
DumpStack;
{$ENDIF}
s:='';
//IDEMessageDlg('Unknown Macro','Macro not defined: "'+s+'".',mtError,[mbAbort],0);
//IDEMessageDialog('Unknown Macro','Macro not defined: "'+s+'".',mtError,[mbAbort],0);
Handled:=true;
exit;
end;
@ -1475,8 +1475,8 @@ begin
ACaption:=lisDeleteFileFailed;
AText:=Format(lisUnableToRemoveOldBackupFile, ['"',
CounterFilename, '"']);
Result:=MessageDlg(ACaption,AText,mtError,
[mbAbort,mbRetry,mbIgnore],0);
Result:=IDEMessageDialog(ACaption,AText,mtError,
[mbAbort,mbRetry,mbIgnore]);
if Result=mrAbort then exit;
if Result=mrIgnore then Result:=mrOk;
end;
@ -1493,8 +1493,8 @@ begin
ACaption:=lisRenameFileFailed;
AText:=Format(lisUnableToRenameFileTo, ['"', BackupFilename+IntToStr
(i), '"', '"', BackupFilename+IntToStr(i+1), '"']);
Result:=MessageDlg(ACaption,AText,mtError,
[mbAbort,mbRetry,mbIgnore],0);
Result:=IDEMessageDialog(ACaption,AText,mtError,
[mbAbort,mbRetry,mbIgnore]);
if Result=mrAbort then exit;
if Result=mrIgnore then Result:=mrOk;
end;

View File

@ -34,8 +34,8 @@ uses
Classes, SysUtils, FileUtil, Laz2_XMLCfg, LazLogger, LResources, Forms,
Controls, Graphics, Dialogs, ExtCtrls, Buttons, StdCtrls, ComCtrls, Contnrs,
ButtonPanel, DefineTemplates, IDEImagesIntf, IDEMsgIntf, IDEHelpIntf,
LazarusIDEStrConsts, LazConf, InterfaceBase, IDEProcs, TransferMacros,
CompilerOptions;
IDEDialogs, LazarusIDEStrConsts, LazConf, InterfaceBase, IDEProcs,
TransferMacros, CompilerOptions;
type
@ -596,9 +596,9 @@ begin
i := ProfilesListbox.ItemIndex;
if i<0 then exit;
// Remove the item from selected list.
if MessageDlg(lisLazBuildConfirmDeletion,
if IDEMessageDialog(lisLazBuildConfirmDeletion,
lisLazBuildAreYouSureYouWantToDeleteThisBuildProfile, mtConfirmation,
[mbYes, mbNo], 0)=mrYes then
[mbYes, mbNo])=mrYes then
begin
SelI:=fProfsToManage.Selected.IndexOf(fProfsToManage[i].fName);
if SelI>-1 then

View File

@ -40,7 +40,7 @@ uses
PascalParserTool,
// IDEIntf
IDECommands, TextTools, SrcEditorIntf, MenuIntf, IDEWindowIntf, LazIDEIntf,
IDEHelpIntf,
IDEHelpIntf, IDEDialogs,
// IDE
IDEProcs, InputHistory, LazarusIDEStrConsts, EditorOptions, CodeMacroSelect,
CodeMacroPrompt;
@ -917,7 +917,7 @@ begin
else begin
AText:=Format(lisCodeTemplATokenAlreadyExists, ['"', TokenEdit.Text, '"']);
ACaption:=lisCodeTemplError;
MessageDlg(ACaption,AText,mterror,[mbok],0);
IDEMessageDialog(ACaption,AText,mterror,[mbok]);
end;
end;
@ -1022,9 +1022,10 @@ begin
SynAutoComplete.AutoCompleteList.SaveToFile(
UTF8ToSys(EditorOpts.CodeTemplateFileName));
except
res:=MessageDlg(' Unable to write code templates to file '''
res:=IDEMessageDialog(lisCCOErrorCaption, 'Unable to write code '
+'templates to file '''
+EditorOpts.CodeTemplateFileName+'''! ',mtError
,[mbAbort, mbIgnore, mbRetry],0);
,[mbAbort, mbIgnore, mbRetry]);
if res=mrAbort then exit;
end;
until Res<>mrRetry;
@ -1084,10 +1085,10 @@ begin
a := PtrInt(TemplateListBox.Items.Objects[idx]);
if a < 0 then exit;
if MessageDlg(dlgDelTemplate
if IDEMessageDialog(lisConfirm, dlgDelTemplate
+'"'+SynAutoComplete.Completions[a]+' - '
+SynAutoComplete.CompletionComments[a]+'"'
+'?',mtConfirmation,[mbOk,mbCancel],0)=mrOK
+'?',mtConfirmation,[mbOk,mbCancel])=mrOK
then begin
SynAutoComplete.DeleteCompletion(a);
LastTemplate := -1; // to prevent the saving of the deleted template

View File

@ -525,8 +525,8 @@ begin
Result:=mrOk;
except
on E: Exception do begin
MessageDlg(lisFileLinkError,
E.Message,mtError,[mbCancel],0);
IDEMessageDialog(lisFileLinkError,
E.Message,mtError,[mbCancel]);
end;
end;
end;

View File

@ -63,7 +63,7 @@ uses
// codetools
LinkScanner, CodeToolManager,
// IDEIntf
IDECommands, SrcEditorIntf, IDEOptionsIntf,
IDECommands, SrcEditorIntf, IDEOptionsIntf, IDEDialogs,
// IDE
LazarusIDEStrConsts, IDEProcs, KeyMapping, LazConf, typinfo;
@ -3304,9 +3304,9 @@ procedure TEditorMouseOptions.ImportFromXml(aXMLConfig: TRttiXMLConfig; aPath: S
MActions.AssertNoConflict(MAct);
except
MActions.Delete(MActions.Count-1);
MessageDlg(dlgMouseOptErrorDup, dlgMouseOptErrorDupText + LineEnding
IDEMessageDialog(dlgMouseOptErrorDup, dlgMouseOptErrorDupText + LineEnding
+ Path + 'M' + IntToStr(i) + LineEnding + MAct.DisplayName,
mtError, [mbOk], 0);
mtError, [mbOk]);
end;
end;
Mact.Free;

View File

@ -41,7 +41,7 @@ uses
Dialogs, LazConfigStorage, Laz2_XMLCfg,
// IDEIntf
ProjectIntf, ObjectInspector, IDEWindowIntf, IDEOptionsIntf,
CompOptsIntf, IDEExternToolIntf,
CompOptsIntf, IDEExternToolIntf, IDEDialogs,
// IDE
IDEProcs, LazarusIDEStrConsts, IDETranslations, LazConf,
IDEOptionDefs, TransferMacros, Debugger;
@ -698,8 +698,8 @@ begin
end;
if (not FileIsExecutable(Filename)) then begin
if MessageDlg(ErrorCaption,Format(ErrorMsg,[Filename]),
mtWarning,[mbIgnore,mbCancel],0)=mrCancel
if IDEMessageDialog(ErrorCaption,Format(ErrorMsg,[Filename]),
mtWarning,[mbIgnore,mbCancel])=mrCancel
then begin
Result:=false;
end;
@ -710,8 +710,8 @@ function CheckDirPathExists(const Dir,
ErrorCaption, ErrorMsg: string): TModalResult;
begin
if not DirPathExists(Dir) then begin
Result:=MessageDlg(ErrorCaption,Format(ErrorMsg,[Dir]),mtWarning,
[mbIgnore,mbCancel],0);
Result:=IDEMessageDialog(ErrorCaption,Format(ErrorMsg,[Dir]),mtWarning,
[mbIgnore,mbCancel]);
end else
Result:=mrOk;
end;

View File

@ -46,7 +46,7 @@ uses
LCLType, Controls, Forms, Buttons, StdCtrls,
Dialogs, ExtCtrls, LCLProc, ButtonPanel,
IDEMsgIntf, IDEExternToolIntf, IDEHelpIntf,
PropEdits, TransferMacros, LazarusIDEStrConsts,
PropEdits, IDEDialogs, TransferMacros, LazarusIDEStrConsts,
EditMsgScannersDlg;
type
@ -363,9 +363,9 @@ begin
if (TitleEdit.Text<>'') and (FilenameEdit.Text<>'') then
SaveToOptions
else begin
MessageDlg(lisEdtExtToolTitleAndFilenameRequired,
IDEMessageDialog(lisEdtExtToolTitleAndFilenameRequired,
lisEdtExtToolAValidToolNeedsAtLeastATitleAndAFilename,
mtError, [mbCancel], 0);
mtError, [mbCancel]);
ModalResult:=mrCancel;
end;
end;

View File

@ -31,7 +31,7 @@ uses
Classes, SysUtils, Math, Forms, Controls, Dialogs, Buttons, StdCtrls,
FileUtil, LResources,
// IDE
LazarusIDEStrConsts, TransferMacros, InputHistory, IDEProcs;
LazarusIDEStrConsts, TransferMacros, InputHistory, IDEProcs, IDEDialogs;
type
TInputFileFlag = (iftDirectory, iftFilename, iftCmdLine,
@ -134,10 +134,10 @@ begin
CurEdit:=GetInputEdit(i);
CurEdit.Text:=CurEdit.Text;
if not FilenameIsValidForFileIndex(CurEdit.Text,i) then begin
if MessageDlg(lisA2PInvalidFile,
if IDEMessageDialog(lisA2PInvalidFile,
Format(lisCodeToolsDefsValueIsInvalid, [GetGroupBox(i).Caption, #13,
CurEdit.Text]), mtInformation,
[mbCancel,mbAbort],0)=mrAbort
[mbCancel,mbAbort])=mrAbort
then
ModalResult:=mrCancel
else

View File

@ -33,7 +33,7 @@ interface
uses
Classes, SysUtils, LCLProc, Forms, Controls, Graphics, Dialogs,
ExtCtrls, StdCtrls, LCLType,
PropEdits, IDECommands, IDEWindowIntf,
PropEdits, IDECommands, IDEWindowIntf, IDEDialogs,
KeyMapping, LazarusIDEStrConsts, Buttons, ButtonPanel;
type
@ -362,10 +362,10 @@ begin
else
ConflictName:=ConflictName
+' ('+KeyAndShiftStateToEditorKeyString(ConflictRelation.ShortcutB);
case MessageDlg(lisPEConflictFound,
case IDEMessageDialog(lisPEConflictFound,
Format(lisTheKeyIsAlreadyAssignedToRemoveTheOldAssignmentAnd, [
KeyAndShiftStateToEditorKeyString(Key), #13, ConflictName, #13, #13,
#13, CurName]), mtConfirmation, [mbYes, mbNo, mbCancel], 0)
#13, CurName]), mtConfirmation, [mbYes, mbNo, mbCancel])
of
mrYes: Result:=mrOK;
mrCancel: Result:=mrCancel;

View File

@ -2930,6 +2930,7 @@ resourcestring
// Build lazarus dialog
lisConfirmLazarusRebuild = 'Do you want to rebuild Lazarus with profile: %s ?';
lisConfirmation = 'Confirmation';
lisConfirmBuildAllProfiles = 'Lazarus will be rebuilt with the following profiles:%sContinue?';
lisNoBuildProfilesSelected = 'No profiles are selected to be built.';
lisCleanLazarusSource = 'Clean Lazarus Source';

View File

@ -1192,7 +1192,7 @@ var
procedure WriteHelp(const AText: string);
begin
if TextRec(Output).Mode = fmClosed then
MessageDlg(AText, mtInformation, [mbOk], 0)
IDEMessageDialog(lisInformation, AText, mtInformation, [mbOk])
else
WriteLn(UTF8ToConsole(AText));
Application.Terminate;
@ -3573,7 +3573,7 @@ function TMainIDE.OnIDEMessageDialog(const aCaption, aMsg: string;
DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; const HelpKeyword: string
): Integer;
begin
Result:=MessageDlg(aCaption,aMsg,DlgType,Buttons,HelpKeyword);
Result:=IDEMessageDialog(aCaption,aMsg,DlgType,Buttons,HelpKeyword);
end;
function TMainIDE.OnIDEQuestionDialog(const aCaption, aMsg: string;
@ -4796,8 +4796,9 @@ procedure TMainIDE.mnuToolBuildLazarusClicked(Sender: TObject);
begin
with MiscellaneousOptions do
if BuildLazProfiles.ConfirmBuild then
if MessageDlg(Format(lisConfirmLazarusRebuild, [BuildLazProfiles.Current.Name]),
mtConfirmation, mbYesNo, 0)<>mrYes then
if IDEMessageDialog(lisConfirmation, Format(lisConfirmLazarusRebuild, [
BuildLazProfiles.Current.Name]),
mtConfirmation, mbYesNo)<>mrYes then
exit;
DoBuildLazarus([]);
end;
@ -4821,8 +4822,8 @@ begin
exit;
end;
if BuildLazProfiles.ConfirmBuild then
if MessageDlg(Format(lisConfirmBuildAllProfiles, [s+sLineBreak]),
mtConfirmation, mbYesNo, 0)<>mrYes then
if IDEMessageDialog(lisConfirmation, Format(lisConfirmBuildAllProfiles, [s
+sLineBreak]), mtConfirmation, mbYesNo)<>mrYes then
exit;
DoBuildAdvancedLazarus(BuildLazProfiles.Selected);
end;
@ -5166,10 +5167,10 @@ var
if (OldTitle <> NewTitle) and (not AProject.TitleIsDefault) then
if not CodeToolBoss.SetApplicationTitleStatement(AProject.MainUnitInfo.Source, NewTitle) then
begin
MessageDlg(lisProjOptsError,
IDEMessageDialog(lisProjOptsError,
Format(lisUnableToChangeProjectTitleInSource, [#13, CodeToolBoss.
ErrorMessage]),
mtWarning, [mbOk], 0);
mtWarning, [mbOk]);
Result := False;
Exit;
end;// set Application.Title:= statement
@ -5177,10 +5178,10 @@ var
if (OldTitle <> '') and AProject.TitleIsDefault then
if not CodeToolBoss.RemoveApplicationTitleStatement(AProject.MainUnitInfo.Source) then
begin
MessageDlg(lisProjOptsError,
IDEMessageDialog(lisProjOptsError,
Format(lisUnableToRemoveProjectTitleFromSource, [#13, CodeToolBoss.
ErrorMessage]),
mtWarning, [mbOk], 0);
mtWarning, [mbOk]);
Result := False;
Exit;
end;// delete title
@ -5213,9 +5214,9 @@ var
if not CodeToolBoss.SetAllCreateFromStatements(AProject.MainUnitInfo.Source,
AProject.TmpAutoCreatedForms) then
begin
MessageDlg(lisProjOptsError,
IDEMessageDialog(lisProjOptsError,
Format(lisProjOptsUnableToChangeTheAutoCreateFormList, [LineEnding]),
mtWarning, [mbOK], 0);
mtWarning, [mbOK]);
Result := False;
Exit;
end;
@ -5235,7 +5236,8 @@ begin
if AProject.ProjResources.Modified and (AProject.MainUnitID >= 0) then
begin
if not AProject.ProjResources.Regenerate(AProject.MainFilename, True, False, '') then
MessageDlg(AProject.ProjResources.Messages.Text, mtWarning, [mbOk], 0);
IDEMessageDialog(lisCCOWarningCaption, AProject.ProjResources.Messages.
Text, mtWarning, [mbOk]);
end;
UpdateCaption;
AProject.DefineTemplates.AllChanged;
@ -6014,8 +6016,8 @@ begin
if PropPath<>'' then
AText := Atext + LineEnding + LineEnding + lisPathToInstance
+ LineEnding + PropPath;
Result:=MessageDlg(ACaption, AText, mtError,
[mbAbort, mbRetry, mbIgnore], 0);
Result:=IDEMessageDialog(ACaption, AText, mtError,
[mbAbort, mbRetry, mbIgnore]);
if Result=mrAbort then exit;
if Result=mrIgnore then Result:=mrOk;
ComponentSavingOk:=false;
@ -6064,7 +6066,7 @@ begin
ACaption:=lisResourceSaveError;
AText:=Format(lisUnableToAddResourceHeaderCommentToResourceFile, [
#13, '"', LRSCode.FileName, '"', #13]);
Result:=MessageDlg(ACaption,AText,mtError,[mbIgnore,mbAbort],0);
Result:=IDEMessageDialog(ACaption,AText,mtError,[mbIgnore,mbAbort]);
if Result<>mrIgnore then exit;
end;
// add resource to resource file
@ -6077,7 +6079,7 @@ begin
AnUnitInfo.ComponentName,
#13, '"', LRSCode.FileName, '"', #13]
);
Result:=MessageDlg(ACaption, AText, mtError, [mbIgnore, mbAbort],0);
Result:=IDEMessageDialog(ACaption, AText, mtError, [mbIgnore, mbAbort]);
if Result<>mrIgnore then exit;
end else begin
AnUnitInfo.ComponentResourceName:=AnUnitInfo.ComponentName;
@ -6147,8 +6149,8 @@ begin
lisUnableToTransformBinaryComponentStreamOfTIntoText, [
AnUnitInfo.ComponentName, AnUnitInfo.ComponentName])
+#13+E.Message;
Result:=MessageDlg(ACaption, AText, mtError,
[mbAbort, mbRetry, mbIgnore], 0);
Result:=IDEMessageDialog(ACaption, AText, mtError,
[mbAbort, mbRetry, mbIgnore]);
if Result=mrAbort then exit;
if Result=mrIgnore then Result:=mrOk;
end;
@ -6307,8 +6309,8 @@ begin
// -> remove lfm file, so that it will not be auto loaded on next open
if (FileExistsUTF8(NewLFMFilename))
and (not DeleteFileUTF8(NewLFMFilename))
and (MessageDlg(lisPkgMangDeleteFailed, Format(lisDeletingOfFileFailed, [
'"', NewLFMFilename, '"']), mtError, [mbIgnore, mbCancel], 0)=mrCancel)
and (IDEMessageDialog(lisPkgMangDeleteFailed, Format(lisDeletingOfFileFailed, [
'"', NewLFMFilename, '"']), mtError, [mbIgnore, mbCancel])=mrCancel)
then
begin
Result:=mrCancel;
@ -6321,9 +6323,9 @@ begin
NewSource:=CodeToolBoss.CreateFile(NewFilename);
NewSource.Source:=OldSourceCode;
if NewSource=nil then begin
Result:=MessageDlg(lisUnableToCreateFile,
Result:=IDEMessageDialog(lisUnableToCreateFile,
Format(lisCanNotCreateFile, ['"', NewFilename, '"']),
mtError,[mbCancel,mbAbort],0);
mtError,[mbCancel,mbAbort]);
exit;
end;
// get final filename
@ -6342,10 +6344,10 @@ begin
if SearchDirectoryInSearchPath(OldUnitPath,NewFilePath,1)<1 then begin
//DebugLn('TMainIDE.DoRenameUnit NewFilePath="',NewFilePath,'" OldUnitPath="',OldUnitPath,'"');
if MessageDlg(lisExtendUnitPath,
if IDEMessageDialog(lisExtendUnitPath,
Format(lisTheDirectoryIsNotYetInTheUnitPathAddIt, ['"', NewFilePath,
'"', #13]),
mtConfirmation,[mbYes,mbNo],0)=mrYes then
mtConfirmation,[mbYes,mbNo])=mrYes then
begin
Project1.CompilerOptions.OtherUnitFiles:=
Project1.CompilerOptions.OtherUnitFiles+';'
@ -6495,8 +6497,8 @@ begin
AmbiguousText:=
Format(lisThereAreOtherFilesInTheDirectoryWithTheSameName,
[#13, #13, AmbiguousFiles.Text, #13]);
Result:=MessageDlg(lisAmbiguousFilesFound, AmbiguousText,
mtWarning,[mbYes,mbNo,mbAbort],0);
Result:=IDEMessageDialog(lisAmbiguousFilesFound, AmbiguousText,
mtWarning,[mbYes,mbNo,mbAbort]);
if Result=mrAbort then exit;
if Result=mrYes then begin
NewFilePath:=AppendPathDelim(ExtractFilePath(NewFilename));
@ -6504,8 +6506,8 @@ begin
AmbiguousFilename:=NewFilePath+AmbiguousFiles[i];
if (FileExistsUTF8(AmbiguousFilename))
and (not DeleteFileUTF8(AmbiguousFilename))
and (MessageDlg(lisPkgMangDeleteFailed, Format(lisDeletingOfFileFailed,
['"', AmbiguousFilename, '"']), mtError, [mbIgnore, mbCancel], 0)=
and (IDEMessageDialog(lisPkgMangDeleteFailed, Format(lisDeletingOfFileFailed,
['"', AmbiguousFilename, '"']), mtError, [mbIgnore, mbCancel])=
mrCancel) then
begin
Result:=mrCancel;
@ -6530,10 +6532,10 @@ begin
if (SearchDirectoryInSearchPath(
Project1.CompilerOptions.GetUnitPath(false),OldFilePath,1)<1)
then begin
if MessageDlg(lisCleanUpUnitPath,
if IDEMessageDialog(lisCleanUpUnitPath,
Format(lisTheDirectoryIsNoLongerNeededInTheUnitPathRemoveIt, ['"',
OldFilePath, '"', #13]),
mtConfirmation,[mbYes,mbNo],0)=mrYes then
mtConfirmation,[mbYes,mbNo])=mrYes then
begin
Project1.CompilerOptions.OtherUnitFiles:=
RemoveSearchPaths(Project1.CompilerOptions.OtherUnitFiles,
@ -6546,9 +6548,9 @@ begin
// delete old pas, .pp, .ppu
if (CompareFilenames(NewFilename,OldFilename)<>0)
and OldFileExisted then begin
if MessageDlg(lisDeleteOldFile2,
if IDEMessageDialog(lisDeleteOldFile2,
Format(lisDeleteOldFile, ['"', OldFilename, '"']),
mtConfirmation,[mbYes,mbNo],0)=mrYes then
mtConfirmation,[mbYes,mbNo])=mrYes then
begin
Result:=DeleteFileInteractive(OldFilename,[mbAbort]);
if Result=mrAbort then exit;
@ -6650,16 +6652,16 @@ begin
if ofOnlyIfExists in Flags
then begin
MessageDlg(lisFileNotFound, Format(lisFileNotFound2, ['"', AFilename, '"',
IDEMessageDialog(lisFileNotFound, Format(lisFileNotFound2, ['"', AFilename, '"',
#13]),
mtInformation,[mbCancel],0);
mtInformation,[mbCancel]);
// cancel loading file
Exit;
end;
if MessageDlg(lisFileNotFound,
if IDEMessageDialog(lisFileNotFound,
Format(lisFileNotFoundDoYouWantToCreateIt, ['"', AFilename, '"', #13, #13])
,mtInformation,[mbYes,mbNo],0)=mrYes then
,mtInformation,[mbYes,mbNo])=mrYes then
begin
// create new file
NewFlags:=[nfOpenInEditor,nfCreateDefaultSrc];
@ -6726,8 +6728,8 @@ begin
AText:=Format(lisTheFileSeemsToBeAProgramCloseCurrentProject, ['"',
AFilename, '"', #13, #13]);
ACaption:=lisProgramDetected;
if MessageDlg(ACaption, AText, mtConfirmation,
[mbYes, mbNo], 0)=mrYes then
if IDEMessageDialog(ACaption, AText, mtConfirmation,
[mbYes, mbNo])=mrYes then
begin
Result:=DoCreateProjectForProgram(PreReadBuf);
Handled:=true;
@ -6865,9 +6867,9 @@ begin
NewClassName,LCLVersion,MissingClasses);
if (NewClassName='') or (LFMType='') then begin
DebugLn(['TMainIDE.DoLoadLFM LFM file corrupt']);
Result:=MessageDlg(lisLFMFileCorrupt,
Result:=IDEMessageDialog(lisLFMFileCorrupt,
Format(lisUnableToFindAValidClassnameIn, ['"', LFMBuf.Filename, '"']),
mtError,[mbIgnore,mbCancel,mbAbort],0);
mtError,[mbIgnore,mbCancel,mbAbort]);
exit;
end;
@ -6938,7 +6940,7 @@ begin
ACaption:=lisFormatError;
AText:=Format(lisUnableToConvertTextFormDataOfFileIntoBinaryStream,
[#13, '"', LFMBuf.Filename, '"', #13, E.Message]);
Result:=MessageDlg(ACaption, AText, mtError, [mbOk, mbCancel], 0);
Result:=IDEMessageDialog(ACaption, AText, mtError, [mbOk, mbCancel]);
if Result=mrCancel then Result:=mrAbort;
exit;
end;
@ -7065,19 +7067,19 @@ begin
if (DescendantClassName<>'')
and (SysUtils.CompareText(AComponentClassName,'TCustomForm')=0) then begin
// this is a common user mistake
MessageDlg(lisCodeTemplError, Format(
IDEMessageDialog(lisCodeTemplError, Format(
lisTheResourceClassDescendsFromProbablyThisIsATypoFor, ['"',
DescendantClassName, '"', '"', AComponentClassName, '"']),
mtError,[mbCancel],0);
mtError,[mbCancel]);
Result:=false;
exit;
end else if (DescendantClassName<>'')
and (SysUtils.CompareText(AComponentClassName,'TComponent')=0) then begin
// this is not yet implemented
MessageDlg(lisCodeTemplError, Format(
IDEMessageDialog(lisCodeTemplError, Format(
lisUnableToOpenDesignerTheClassDoesNotDescendFromADes, [#13,
DescendantClassName]),
mtError,[mbCancel],0);
mtError,[mbCancel]);
Result:=false;
exit;
end else begin
@ -8413,10 +8415,10 @@ begin
// check program name
NewProgramName:=ExtractFileNameOnly(AFilename);
if (NewProgramName='') or (not IsValidUnitName(NewProgramName)) then begin
Result:=MessageDlg(lisInvalidProjectFilename,
Result:=IDEMessageDialog(lisInvalidProjectFilename,
Format(lisisAnInvalidProjectNamePleaseChooseAnotherEGProject, ['"',
SaveDialog.Filename, '"', #13]),
mtInformation,[mbRetry,mbAbort],0);
mtInformation,[mbRetry,mbAbort]);
if Result=mrAbort then exit;
continue; // try again
end;
@ -8450,7 +8452,7 @@ begin
ACaption:=lisChooseADifferentName;
AText:=Format(lisTheProjectInfoFileIsEqualToTheProjectMainSource, [
'"', NewLPIFilename, '"', #13]);
Result:=MessageDlg(ACaption, AText, mtError, [mbAbort,mbRetry],0);
Result:=IDEMessageDialog(ACaption, AText, mtError, [mbAbort,mbRetry]);
if Result=mrAbort then exit;
continue; // try again
end;
@ -8462,7 +8464,7 @@ begin
ACaption:=lisUnitIdentifierExists;
AText:=Format(lisThereIsAUnitWithTheNameInTheProjectPleaseChoose, ['"',
NewProgramName, '"', #13]);
Result:=MessageDlg(ACaption,AText,mtError,[mbRetry,mbAbort],0);
Result:=IDEMessageDialog(ACaption,AText,mtError,[mbRetry,mbAbort]);
if Result=mrAbort then exit;
continue; // try again
end;
@ -8484,7 +8486,7 @@ begin
begin
ACaption:=lisOverwriteFile;
AText:=Format(lisAFileAlreadyExistsReplaceIt, ['"', NewLPIFilename, '"', #13]);
Result:=MessageDlg(ACaption, AText, mtConfirmation, [mbOk, mbCancel], 0);
Result:=IDEMessageDialog(ACaption, AText, mtConfirmation, [mbOk, mbCancel]);
if Result=mrCancel then exit;
end
else
@ -8494,7 +8496,7 @@ begin
ACaption:=lisOverwriteFile;
AText:=Format(lisAFileAlreadyExistsReplaceIt, ['"', NewProgramFilename,
'"', #13]);
Result:=MessageDlg(ACaption, AText, mtConfirmation,[mbOk,mbCancel],0);
Result:=IDEMessageDialog(ACaption, AText, mtConfirmation,[mbOk,mbCancel]);
if Result=mrCancel then exit;
end;
end;
@ -8538,8 +8540,8 @@ begin
// switch MainUnitInfo.Source to new code
NewBuf := CodeToolBoss.CreateFile(NewProgramFilename);
if NewBuf=nil then begin
Result:=MessageDlg(lisErrorCreatingFile, Format(lisUnableToCreateFile3, [
#13, '"', NewProgramFilename, '"']), mtError, [mbCancel], 0);
Result:=IDEMessageDialog(lisErrorCreatingFile, Format(lisUnableToCreateFile3, [
#13, '"', NewProgramFilename, '"']), mtError, [mbCancel]);
exit;
end;
@ -8678,18 +8680,18 @@ procedure TMainIDE.OnCopyError(const ErrorData: TCopyErrorData;
begin
case ErrorData.Error of
ceSrcDirDoesNotExists:
MessageDlg(lisCopyError2,
IDEMessageDialog(lisCopyError2,
Format(lisSourceDirectoryDoesNotExist, ['"', ErrorData.Param1, '"']),
mtError,[mbCancel],0);
mtError,[mbCancel]);
ceCreatingDirectory:
MessageDlg(lisCopyError2,
IDEMessageDialog(lisCopyError2,
Format(lisUnableToCreateDirectory, ['"', ErrorData.Param1, '"']),
mtError,[mbCancel],0);
mtError,[mbCancel]);
ceCopyFileError:
MessageDlg(lisCopyError2,
IDEMessageDialog(lisCopyError2,
Format(lisUnableToCopyFileTo, ['"', ErrorData.Param1, '"', #13, '"',
ErrorData.Param1, '"']),
mtError,[mbCancel],0);
mtError,[mbCancel]);
end;
end;
@ -8776,7 +8778,7 @@ begin
try
NewSrcEdit.EditorComponent.FoldState := FoldState;
except
MessageDlg(lisError, lisFailedToLoadFoldStat, mtError, [mbOK], 0);
IDEMessageDialog(lisError, lisFailedToLoadFoldStat, mtError, [mbOK]);
end;
NewSrcEdit.EditorComponent.CaretXY:=NewCaretXY;
@ -9122,9 +9124,9 @@ begin
// packages
PkgBoss.DoNewPackage;
end else begin
MessageDlg(ueNotImplCap,
IDEMessageDialog(ueNotImplCap,
lisSorryThisTypeIsNotYetImplemented,
mtInformation,[mbOk],0);
mtInformation,[mbOk]);
end;
end;
@ -9705,9 +9707,9 @@ begin
AFileName:=DiskFilename;
if NewUnitInfo.IsVirtual then begin
if (not (ofQuiet in Flags)) then begin
MessageDlg(lisRevertFailed, Format(lisFileIsVirtual, ['"', AFilename,
IDEMessageDialog(lisRevertFailed, Format(lisFileIsVirtual, ['"', AFilename,
'"']),
mtInformation,[mbCancel],0);
mtInformation,[mbCancel]);
end;
Result:=mrCancel;
exit;
@ -9759,9 +9761,9 @@ begin
if (ofRevert in Flags) then begin
// revert failed, due to missing file
if not (ofQuiet in Flags) then begin
MessageDlg(lisRevertFailed, Format(lisPkgMangFileNotFound, ['"',
IDEMessageDialog(lisRevertFailed, Format(lisPkgMangFileNotFound, ['"',
AFilename, '"']),
mtError,[mbCancel],0);
mtError,[mbCancel]);
end;
Result:=mrCancel;
exit;
@ -11143,7 +11145,7 @@ begin
if not FileExistsUTF8(AFilename) then begin
ACaption:=lisFileNotFound;
AText:=Format(lisPkgMangFileNotFound, ['"', AFilename, '"']);
Result:=MessageDlg(ACaption, AText, mtError, [mbAbort], 0);
Result:=IDEMessageDialog(ACaption, AText, mtError, [mbAbort]);
exit;
end;
@ -11172,7 +11174,7 @@ begin
ACaption:=lisFileNotText;
AText:=Format(lisFileDoesNotLookLikeATextFileOpenItAnyway, ['"', AFilename,
'"', #13, #13]);
Result:=MessageDlg(ACaption, AText, mtConfirmation, [mbYes, mbAbort], 0);
Result:=IDEMessageDialog(ACaption, AText, mtConfirmation, [mbYes, mbAbort]);
if Result=mrAbort then exit;
end;
if not FileReadable then begin
@ -11488,9 +11490,9 @@ end;
function TMainIDE.DoSaveProjectIfChanged: TModalResult;
begin
if SomethingOfProjectIsModified then begin
if MessageDlg(lisProjectChanged, Format(lisSaveChangesToProject,
if IDEMessageDialog(lisProjectChanged, Format(lisSaveChangesToProject,
[Project1.GetTitleOrName]),
mtconfirmation, [mbYes, mbNo, mbCancel], 0)=mrYes then
mtconfirmation, [mbYes, mbNo, mbCancel])=mrYes then
begin
if DoSaveProject([])=mrAbort then begin
Result:=mrAbort;
@ -11521,7 +11523,7 @@ begin
else
s:=Format(lisTheFile, ['"', ActiveSourceEditor.PageName, '"']);
s:=Format(lisisAlreadyPartOfTheProject, [s]);
MessageDlg(s,mtInformation,[mbOk],0);
IDEMessageDialog(lisInformation, s, mtInformation, [mbOk]);
exit;
end;
if not ActiveUnitInfo.IsVirtual then
@ -11531,9 +11533,9 @@ begin
if (ActiveUnitInfo.Unit_Name<>'')
and (Project1.IndexOfUnitWithName(ActiveUnitInfo.Unit_Name,true,ActiveUnitInfo)>=0) then
begin
MessageDlg(Format(
IDEMessageDialog(lisInformation, Format(
lisUnableToAddToProjectBecauseThereIsAlreadyAUnitWith, [s]),
mtInformation, [mbOk], 0);
mtInformation, [mbOk]);
exit;
end;
@ -11576,7 +11578,8 @@ begin
end;
end;
if MessageDlg(Format(lisAddToProject, [s]), mtConfirmation, [mbYes,mbCancel], 0) in [mrOk,mrYes]
if IDEMessageDialog(lisConfirmation, Format(lisAddToProject, [s]),
mtConfirmation, [mbYes, mbCancel]) in [mrOk, mrYes]
then begin
DependencyAdded:=false;
if FilenameIsPascalUnit(ActiveUnitInfo.Filename) then
@ -11697,7 +11700,7 @@ begin
exit;
end;
if Project1=nil then Begin
MessageDlg(lisCreateAProjectFirst, mterror, [mbok], 0);
IDEMessageDialog(lisCCOErrorCaption, lisCreateAProjectFirst, mtError, [mbOK]);
Exit;
end;
@ -11731,15 +11734,16 @@ begin
if (TestDir='')
or (not DirPathExists(TestDir)) then begin
if (TestDir<>'') then begin
MessageDlg(Format(lisTheTestDirectoryCouldNotBeFoundSeeIDEOpt, [
IDEMessageDialog(lisCCOErrorCaption, Format(
lisTheTestDirectoryCouldNotBeFoundSeeIDEOpt, [
#13, '"', EnvironmentOptions.TestBuildDirectory, '"', #13]), mtError, [
mbCancel], 0);
mbCancel]);
Result:=mrCancel;
exit;
end;
Result:=MessageDlg(lisBuildNewProject,
Result:=IDEMessageDialog(lisBuildNewProject,
Format(lisTheProjectMustBeSavedBeforeBuildingIfYouSetTheTest, [#13, #13,
#13]), mtInformation, [mbYes, mbNo], 0);
#13]), mtInformation, [mbYes, mbNo]);
if Result<>mrYes then exit;
Result:=DoSaveAll([sfCheckAmbiguousFiles]);
exit;
@ -11846,10 +11850,10 @@ begin
end;
// reason is not handled
if Quiet then exit(mrCancel);
Result:=MessageDlg('Nothing to do',
Result:=IDEMessageDialog('Nothing to do',
'The project''s compiler options has no compile command.'#13
+'See Project / Compiler Options ... / Compilation',mtInformation,
[mbCancel,mbIgnore],0);
[mbCancel,mbIgnore]);
if Result=mrIgnore then
Result:=mrOk;
end;
@ -11903,9 +11907,9 @@ begin
CodeToolBoss.GetFPCVersionForDirectory(
ExtractFilePath(Project1.MainFilename),FPCVersion,FPCRelease,FPCPatch);
if (FPCVersion=2) and (FPCRelease<4) then begin
MessageDlg(lisFPCTooOld,
IDEMessageDialog(lisFPCTooOld,
lisTheProjectUsesTheNewFPCResourcesWhichRequiresAtLea,
mtError,[mbCancel],0);
mtError,[mbCancel]);
exit(mrCancel);
end;
end;
@ -12160,9 +12164,9 @@ begin
DebugLn(['TMainIDE.DoInitProjectRun ProgramFilename=',ProgramFilename]);
if not FileExistsUTF8(ProgramFilename)
then begin
MessageDlg(lisFileNotFound,
IDEMessageDialog(lisFileNotFound,
Format(lisNoProgramFileSFound, ['"', ProgramFilename, '"']),
mtError,[mbCancel], 0);
mtError,[mbCancel]);
Exit;
end;
@ -12459,9 +12463,9 @@ var
ProfileChanged: Boolean;
begin
if ToolStatus<>itNone then begin
MessageDlg(lisNotNow,
IDEMessageDialog(lisNotNow,
lisYouCanNotBuildLazarusWhileDebuggingOrCompiling,
mtError,[mbCancel],0);
mtError,[mbCancel]);
Result:=mrCancel;
exit;
end;
@ -12953,9 +12957,9 @@ begin
begin
if not Quiet then
begin
MessageDlg(lisNoLFMFile,
IDEMessageDialog(lisNoLFMFile,
lisThisFunctionNeedsAnOpenLfmFileInTheSourceEditor,
mtError,[mbCancel],0);
mtError,[mbCancel]);
end;
Result:=mrCancel;
exit;
@ -12969,10 +12973,10 @@ begin
UnitFilename:='';
end;
if UnitFilename='' then begin
MessageDlg(lisNoPascalFile,
IDEMessageDialog(lisNoPascalFile,
Format(lisUnableToFindPascalUnitPasPpForLfmFile, [#13, '"',
LFMUnitInfo.Filename, '"']),
mtError,[mbCancel],0);
mtError,[mbCancel]);
Result:=mrCancel;
exit;
end;
@ -13448,9 +13452,9 @@ var
procedure ShowErrorForCommandAfter;
begin
MessageDlg(lisInvalidCommand,
IDEMessageDialog(lisInvalidCommand,
Format(lisTheCommandAfterIsNotExecutable, ['"', CmdAfterExe, '"']),
mtError,[mbCancel],0);
mtError,[mbCancel]);
end;
begin
@ -13461,19 +13465,19 @@ begin
DestDir:=TrimAndExpandDirectory(DestDirectory);
SrcDir:=TrimAndExpandDirectory(SrcDirectory);
if (DestDir='') then begin
MessageDlg('Invalid publishing Directory',
IDEMessageDialog('Invalid publishing Directory',
'Destination directory for publishing is empty.',mtError,
[mbCancel],0);
[mbCancel]);
Result:=mrCancel;
exit;
end;
//DebugLn('TMainIDE.DoPublishModule A SrcDir="',SrcDir,'" DestDir="',DestDir,'"');
if CompareFilenames(SrcDir,DestDir)=0
then begin
MessageDlg(lisInvalidPublishingDirectory,
IDEMessageDialog(lisInvalidPublishingDirectory,
Format(lisSourceDirectoryAndDestinationDirectoryAreTheSameMa, ['"',
SrcDir, '"', #13, '"', DestDir, '"', #13, #13, #13, #13, #13]),
mtError, [mbCancel], 0);
mtError, [mbCancel]);
Result:=mrCancel;
exit;
end;
@ -13499,9 +13503,9 @@ begin
CmdAfterExe:=TempCmd;
end;
if not FileIsExecutableCached(CmdAfterExe) then begin
MessageDlg(lisCommandAfterInvalid,
IDEMessageDialog(lisCommandAfterInvalid,
Format(lisTheCommandAfterPublishingIsInvalid, [#13, '"', CmdAfterExe,
'"']), mtError, [mbCancel], 0);
'"']), mtError, [mbCancel]);
Result:=mrCancel;
exit;
end;
@ -13510,18 +13514,18 @@ begin
// clear destination directory
if DirPathExists(DestDir) then begin
// ask user, if destination can be delete
if MessageDlg(lisClearDirectory,
if IDEMessageDialog(lisClearDirectory,
Format(lisInOrderToCreateACleanCopyOfTheProjectPackageAllFil, [#13, #13,
'"', DestDir, '"']), mtConfirmation,
[mbYes,mbNo],0)<>mrYes
[mbYes,mbNo])<>mrYes
then
exit(mrCancel);
if (not DeleteDirectory(ChompPathDelim(DestDir),true)) then begin
MessageDlg(lisUnableToCleanUpDestinationDirectory,
IDEMessageDialog(lisUnableToCleanUpDestinationDirectory,
Format(lisUnableToCleanUpPleaseCheckPermissions, ['"', DestDir, '"', #13]
),
mtError,[mbOk],0);
mtError,[mbOk]);
Result:=mrCancel;
exit;
end;
@ -13912,13 +13916,13 @@ begin
end;
end else begin
if FilenameIsAbsolute(Filename) then begin
MessageDlg(Format(lisUnableToFindFile, ['"', Filename, '"']),
mtInformation,[mbOk],0)
IDEMessageDialog(lisInformation, Format(lisUnableToFindFile, ['"',
Filename, '"']), mtInformation,[mbOk])
end else if Filename<>'' then begin
MessageDlg(Format(
IDEMessageDialog(lisInformation, Format(
lisUnableToFindFileCheckSearchPathInProjectCompilerOption, ['"',
Filename, '"', #13, #13]),
mtInformation,[mbOk],0);
mtInformation,[mbOk]);
end;
end;
end;
@ -14024,13 +14028,13 @@ begin
end;
end else if AFilename<>'' then begin
if FilenameIsAbsolute(AFilename) then begin
MessageDlg(Format(lisUnableToFindFile, ['"', AFilename, '"']),
mtInformation,[mbOk],0)
IDEMessageDialog(lisInformation, Format(lisUnableToFindFile, ['"',
AFilename, '"']), mtInformation,[mbOk]);
end else if AFileName<>'' then begin
MessageDlg(Format(
IDEMessageDialog(lisInformation, Format(
lisUnableToFindFileCheckSearchPathInProjectCompilerOption, ['"',
AFilename, '"', #13, #13]),
mtInformation,[mbOk],0);
mtInformation,[mbOk]);
end;
end;
end;//if
@ -14487,19 +14491,19 @@ begin
// check if component class is registered
ARegComp:=IDEComponentPalette.FindComponent(NewClassName);
if ARegComp=nil then begin
MessageDlg(lisClassNotFound,
IDEMessageDialog(lisClassNotFound,
Format(lisClassIsNotARegisteredComponentClassUnableToPaste, ['"',
NewClassName, '"', #13]),
mtError,[mbCancel],0);
mtError,[mbCancel]);
exit;
end;
// check if there is a valid parent
if (ParentControl=nil) and ARegComp.IsTControl then begin
MessageDlg(lisControlNeedsParent,
IDEMessageDialog(lisControlNeedsParent,
Format(lisTheClassIsATControlAndCanNotBePastedOntoANonContro, ['"',
NewClassName, '"', #13]),
mtError,[mbCancel],0);
mtError,[mbCancel]);
exit;
end;
@ -14510,10 +14514,10 @@ begin
LRSObjectTextToBinary(TxtCompStream,BinCompStream);
except
on E: Exception do begin
MessageDlg(lisConversionError,
IDEMessageDialog(lisConversionError,
Format(lisUnableToConvertComponentTextIntoBinaryFormat, [#13,
E.Message]),
mtError,[mbCancel],0);
mtError,[mbCancel]);
exit;
end;
end;
@ -15950,7 +15954,7 @@ begin
NewSource, NewX, NewY, NewTopLine, [jfAddJumpPoint, jfFocusEditor]);
end else begin
if CodeToolBoss.ErrorMessage='' then begin
MessageDlg(lisSuccess, lisAllBlocksLooksOk, mtInformation, [mbOk], 0);
IDEMessageDialog(lisSuccess, lisAllBlocksLooksOk, mtInformation, [mbOk]);
end else
DoJumpToCodeToolBossError;
end;
@ -16057,9 +16061,9 @@ begin
// the codetools have calculated the maximum bounds
if (StartCode=EndCode) and (CompareCaret(StartPos,EndPos)=0) then begin
MessageDlg(lisNoStringConstantFound,
IDEMessageDialog(lisNoStringConstantFound,
Format(lisHintTheMakeResourcestringFunctionExpectsAStringCon, [#13]),
mtError,[mbCancel],0);
mtError,[mbCancel]);
exit;
end;
// the user can shorten this range by selecting text
@ -16071,9 +16075,9 @@ begin
if (StartCode<>ActiveUnitInfo.Source)
or (EndCode<>ActiveUnitInfo.Source)
then begin
MessageDlg(lisNoStringConstantFound, Format(
IDEMessageDialog(lisNoStringConstantFound, Format(
lisInvalidExpressionHintTheMakeResourcestringFunction, [#13]),
mtError,[mbCancel],0);
mtError,[mbCancel]);
exit;
end;
end else begin
@ -16091,9 +16095,9 @@ begin
if (CompareCaret(SelectedStartPos,StartPos)>0)
or (CompareCaret(SelectedEndPos,EndPos)<0)
then begin
MessageDlg(lisSelectionExceedsStringConstant,
IDEMessageDialog(lisSelectionExceedsStringConstant,
Format(lisHintTheMakeResourcestringFunctionExpectsAStringCon2, [#13]),
mtError,[mbCancel],0);
mtError,[mbCancel]);
exit;
end;
StartPos:=SelectedStartPos;
@ -16109,9 +16113,9 @@ begin
exit;
end;
if CodeToolBoss.Positions.Count=0 then begin
MessageDlg(lisNoResourceStringSectionFound,
IDEMessageDialog(lisNoResourceStringSectionFound,
lisUnableToFindAResourceStringSectionInThisOrAnyOfThe,
mtError,[mbCancel],0);
mtError,[mbCancel]);
exit;
end;
@ -17085,7 +17089,7 @@ begin
end;
except
on E: Exception do begin
MessageDlg('Error',E.Message,mtError,[mbCancel],0);
IDEMessageDialog('Error',E.Message,mtError,[mbCancel]);
end;
end;
end;
@ -17710,10 +17714,10 @@ begin
ShortDir:=CurDirectory;
if (not Project1.IsVirtual) then
ShortDir:=CreateRelativePath(ShortDir,Project1.ProjectDirectory);
if MessageDlg(lisAddToUnitSearchPath,
if IDEMessageDialog(lisAddToUnitSearchPath,
Format(lisTheNewUnitIsNotYetInTheUnitSearchPathAddDirectory, [
#13, CurDirectory]),
mtConfirmation,[mbYes,mbNo],0)=mrYes
mtConfirmation,[mbYes,mbNo])=mrYes
then begin
Project1.CompilerOptions.OtherUnitFiles:=
MergeSearchPaths(Project1.CompilerOptions.OtherUnitFiles,ShortDir);
@ -17763,10 +17767,10 @@ begin
ShortDir:=CurDirectory;
if (not Project1.IsVirtual) then
ShortDir:=CreateRelativePath(ShortDir,Project1.ProjectDirectory);
if MessageDlg(lisAddToIncludeSearchPath,
if IDEMessageDialog(lisAddToIncludeSearchPath,
Format(lisTheNewIncludeFileIsNotYetInTheIncludeSearchPathAdd, [#13,
CurDirectory]),
mtConfirmation,[mbYes,mbNo],0)=mrYes
mtConfirmation,[mbYes,mbNo])=mrYes
then begin
Project1.CompilerOptions.IncludePath:=
MergeSearchPaths(Project1.CompilerOptions.IncludePath,ShortDir);
@ -18314,10 +18318,10 @@ begin
Result:=false;
if (not (AParent is TControl))
and (APersistentClass.InheritsFrom(TControl)) then begin
MessageDlg(lisCodeToolsDefsInvalidParent,
IDEMessageDialog(lisCodeToolsDefsInvalidParent,
Format(lisACanNotHoldTControlsYouCanOnlyPutNonVisualComponen, [
AParent.ClassName, #13]),
mtError,[mbCancel],0);
mtError,[mbCancel]);
UpdateIDEComponentPalette;
exit;
end;

View File

@ -60,7 +60,7 @@ uses
LazarusIDEStrConsts, CompilerOptions,
TransferMacros, EditorOptions, IDEProcs, RunParamsOpts, ProjectDefs,
FileReferenceList, EditDefineTree, PackageDefs, PackageSystem, IDEOptionsIntf,
SrcEditorIntf, SynEdit;
SrcEditorIntf, IDEDialogs, SynEdit;
type
TUnitInfo = class;
@ -2834,10 +2834,10 @@ begin
except
on E: Exception do begin
DebugLn('Error: ', E.Message);
MessageDlg(lisCodeToolsDefsWriteError,
IDEMessageDialog(lisCodeToolsDefsWriteError,
Format(lisUnableToWriteTheProjectInfoFileError, [#13, '"',
ProjectInfoFile, '"', #13, E.Message])
,mtError,[mbOk],0);
,mtError,[mbOk]);
Result:=mrCancel;
exit;
end;
@ -2920,9 +2920,9 @@ begin
Result:=mrOk;
except
on E: Exception do begin
Result:=MessageDlg(lisCodeToolsDefsWriteError, Format(
Result:=IDEMessageDialog(lisCodeToolsDefsWriteError, Format(
lisUnableToWriteToFile, ['"', CfgFilename, '"']),
mtError,[mbRetry,mbAbort],0);
mtError,[mbRetry,mbAbort]);
end;
end;
if CompareFilenames(ProjectInfoFile,xmlconfig.Filename)=0 then begin
@ -2959,10 +2959,10 @@ begin
except
on E: Exception do begin
DebugLn('ERROR: ',E.Message);
MessageDlg(lisCodeToolsDefsWriteError,
IDEMessageDialog(lisCodeToolsDefsWriteError,
Format(lisUnableToWriteTheProjectSessionFileError, [#13,
ProjectSessionFile, #13, E.Message])
,mtError,[mbOk],0);
,mtError,[mbOk]);
Result:=mrCancel;
exit;
end;
@ -2993,9 +2993,9 @@ begin
SessionSaveResult:=mrOk;
except
on E: Exception do begin
SessionSaveResult:=MessageDlg(lisCodeToolsDefsWriteError,
SessionSaveResult:=IDEMessageDialog(lisCodeToolsDefsWriteError,
Format(lisUnableToWriteToFile2, [CurSessionFilename]),
mtError,[mbRetry,mbAbort],0);
mtError,[mbRetry,mbAbort]);
end;
end;
try
@ -3346,10 +3346,10 @@ begin
xmlconfig := TCodeBufXMLConfig.CreateWithCache(NewProjectInfoFile,true)
except
on E: Exception do begin
MessageDlg(lisUnableToReadLpi,
IDEMessageDialog(lisUnableToReadLpi,
Format(lisUnableToReadTheProjectInfoFile, [#13, '"',NewProjectInfoFile, '"'])+#13
+E.Message
,mtError,[mbOk],0);
,mtError,[mbOk]);
Result:=mrCancel;
exit;
end;
@ -3373,10 +3373,10 @@ begin
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TProject.ReadProject B done lpi');{$ENDIF}
except
on E: Exception do begin
MessageDlg(lisUnableToReadLpi,
IDEMessageDialog(lisUnableToReadLpi,
Format(lisUnableToReadTheProjectInfoFile, [#13, '"',ProjectInfoFile, '"'])+#13
+E.Message
,mtError,[mbOk],0);
,mtError,[mbOk]);
Result:=mrCancel;
exit;
end;
@ -3399,9 +3399,9 @@ begin
if (Fileversion=0) and (not LoadParts)
and (xmlconfig.GetValue(Path+'Units/Count',0)=0) then
begin
if MessageDlg(lisStrangeLpiFile,
if IDEMessageDialog(lisStrangeLpiFile,
Format(lisTheFileDoesNotLookLikeALpiFile, [ProjectInfoFile]),
mtConfirmation,[mbIgnore,mbAbort],0)<>mrIgnore then exit;
mtConfirmation,[mbIgnore,mbAbort])<>mrIgnore then exit;
end;
if not LoadParts then begin
@ -3526,9 +3526,10 @@ begin
OnLoadProjectInfo(Self,XMLConfig,true);
end;
except
MessageDlg(Format(lisUnableToReadTheProjectInfoFile2, [#13, '"',
IDEMessageDialog(lisCCOErrorCaption, Format(
lisUnableToReadTheProjectInfoFile2, [#13, '"',
ProjectInfoFile, '"'])
,mtError,[mbOk],0);
,mtError,[mbOk]);
Result:=mrCancel;
exit;
end;
@ -5000,10 +5001,10 @@ begin
if IgnoreErrors then begin
Result:=mrOk;
end else begin
Result:=MessageDlg(lisPkgMangErrorReadingFile,
Result:=IDEMessageDialog(lisPkgMangErrorReadingFile,
Format(lisProjMangUnableToReadStateFileOfProjectError, [StateFile,
IDAsString, #13, E.Message]),
mtError,[mbAbort],0);
mtError,[mbAbort]);
end;
exit;
end;
@ -5042,10 +5043,10 @@ begin
StateFlags:=StateFlags+[lpsfStateFileLoaded];
except
on E: Exception do begin
Result:=MessageDlg(lisPkgMangErrorWritingFile,
Result:=IDEMessageDialog(lisPkgMangErrorWritingFile,
Format(lisProjMangUnableToWriteStateFileForProjectError, [IDAsString,
#13, E.Message]),
mtError,[mbAbort,mbCancel],0);
mtError,[mbAbort,mbCancel]);
exit;
end;
end;

View File

@ -48,8 +48,8 @@ uses
MemCheck,
{$ENDIF}
Classes, SysUtils, LCLProc, Controls, Forms, Buttons, StdCtrls, ComCtrls,
Dialogs, ExtCtrls, BaseIDEIntf, IDEHelpIntf, ProjectIntf, IDEProcs,
SysVarUserOverrideDlg, InputHistory, LazarusIDEStrConsts, FileUtil,
Dialogs, ExtCtrls, BaseIDEIntf, IDEHelpIntf, ProjectIntf, IDEDialogs,
IDEProcs, SysVarUserOverrideDlg, InputHistory, LazarusIDEStrConsts, FileUtil,
Laz2_XMLCfg, ButtonPanel;
{ The xml format version:
@ -471,9 +471,9 @@ begin
if OpenDialog.Execute then
begin
if (FileIsExecutable(OpenDialog.Filename)) or
(MessageDlg(lisRunParamsFileNotExecutable,
(IDEMessageDialog(lisRunParamsFileNotExecutable,
Format(lisRunParamsTheHostApplicationIsNotExecutable,
['"', OpenDialog.Filename, '"']), mtWarning, [mbCancel, mbIgnore], 0) =
['"', OpenDialog.Filename, '"']), mtWarning, [mbCancel, mbIgnore]) =
mrIgnore) then
begin
HostApplicationEdit.Text := OpenDialog.Filename;