mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 20:50:40 +02:00
IDE: build modes: error message when duplicate name
git-svn-id: trunk@41496 -
This commit is contained in:
parent
c79b6e04a3
commit
688a2e73fe
@ -7,7 +7,7 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
Grids, Buttons, Menus, ButtonPanel, LCLProc,
|
||||
ProjectIntf, IDEImagesIntf, IDEOptionsIntf, CompOptsIntf,
|
||||
ProjectIntf, IDEImagesIntf, IDEOptionsIntf, CompOptsIntf, IDEDialogs,
|
||||
PackageDefs, TransferMacros, PathEditorDlg, Project, LazarusIDEStrConsts,
|
||||
CompilerOptions, IDEProcs, BuildModeDiffDlg;
|
||||
|
||||
@ -355,8 +355,8 @@ begin
|
||||
if b and (i=0) then
|
||||
begin
|
||||
NewValue:=OldValue;
|
||||
MessageDlg(lisCCOErrorCaption,lisTheFirstBuildModeIsTheDefaultModeAndMustBeStoredIn,
|
||||
mtError,[mbCancel],0);
|
||||
IDEMessageDialog(lisCCOErrorCaption,lisTheFirstBuildModeIsTheDefaultModeAndMustBeStoredIn,
|
||||
mtError,[mbCancel]);
|
||||
exit;
|
||||
end;
|
||||
CurMode.InSession:=b;
|
||||
@ -368,8 +368,18 @@ begin
|
||||
for i:=1 to length(s) do
|
||||
if s[i]<' ' then
|
||||
s[i]:=' ';
|
||||
CurMode.Identifier:=s;
|
||||
NewValue:=s;
|
||||
if CurMode.Identifier<>s then begin
|
||||
for i:=0 to fBuildModes.Count-1 do begin
|
||||
if (fBuildModes[i]<>CurMode)
|
||||
and (Comparetext(fBuildModes[i].Identifier,NewValue)=0) then begin
|
||||
IDEMessageDialog(lisDuplicateEntry,
|
||||
lisThereIsAlreadyABuildModeWithThisName, mtError, [mbCancel]);
|
||||
NewValue:=CurMode.Identifier;
|
||||
end;
|
||||
end;
|
||||
CurMode.Identifier:=s;
|
||||
end;
|
||||
end;
|
||||
UpdateDialogCaption;
|
||||
end;
|
||||
|
@ -5365,6 +5365,9 @@ resourcestring
|
||||
lisThereMustBeAtLeastOneBuildMode = 'There must be at least one build mode.';
|
||||
lisTheFirstBuildModeIsTheDefaultModeAndMustBeStoredIn = 'The first build '
|
||||
+'mode is the default mode and must be stored in the project, not in the session.';
|
||||
lisDuplicateEntry = 'Duplicate entry';
|
||||
lisThereIsAlreadyABuildModeWithThisName = 'There is already a build mode '
|
||||
+'with this name.';
|
||||
lisAddNewBuildModeCopyingSettingsFrom = 'Add new build mode, copying '
|
||||
+'settings from "%s"';
|
||||
lisDeleteMode = 'Delete mode "%s"';
|
||||
|
Loading…
Reference in New Issue
Block a user