mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 08:19:53 +02:00
ide: some improvements for editing of compiler option in the common dialog
git-svn-id: trunk@23355 -
This commit is contained in:
parent
199795b4c1
commit
bf67a1aaf6
@ -559,6 +559,7 @@ type
|
||||
fOptionsString: String;
|
||||
FParsedOpts: TParsedCompilerOptions;
|
||||
FStorePathDelim: TPathDelimSwitch;
|
||||
FUseAsDefault: Boolean;
|
||||
fXMLFile: String;
|
||||
FXMLConfig: TXMLConfig;
|
||||
|
||||
@ -697,6 +698,9 @@ type
|
||||
property CompilerMessages: TCompilerMessagesList read fCompilerMessages;
|
||||
property UseMsgFile: Boolean read fUseMsgFile write fUseMsgFile;
|
||||
property MsgFileName: String read fMsgFileName write fMsgFileName;
|
||||
|
||||
// for dialog only
|
||||
property UseAsDefault: Boolean read FUseAsDefault write FUseAsDefault;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -580,6 +580,7 @@ begin
|
||||
LCLWidgetType := ''
|
||||
else
|
||||
LCLWidgetType := LCLPlatformDirNames[TLCLPlatform(i - 1)];
|
||||
UseAsDefault := chkUseAsDefault.Checked;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1778,6 +1778,7 @@ resourcestring
|
||||
|
||||
// project options dialog
|
||||
dlgProjectOptions = 'Project Options';
|
||||
dlgProjectOptionsFor = 'Options for Project: %s';
|
||||
dlgPOApplication = 'Application';
|
||||
lisApplicationAGraphicalLclFreepascalProgramTheProgra = 'Application%sA '
|
||||
+'graphical lcl/freepascal program. The program file is automatically '
|
||||
|
20
ide/main.pp
20
ide/main.pp
@ -285,7 +285,6 @@ type
|
||||
procedure mnuProjectOptionsClicked(Sender: TObject);
|
||||
procedure mnuProjectCompilerSettingsClicked(Sender: TObject);
|
||||
|
||||
|
||||
// run menu
|
||||
procedure mnuBuildProjectClicked(Sender: TObject);
|
||||
procedure mnuBuildAllProjectClicked(Sender: TObject);
|
||||
@ -3708,8 +3707,13 @@ begin
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuProjectOptionsClicked(Sender: TObject);
|
||||
var
|
||||
NewCaption: String;
|
||||
begin
|
||||
DoOpenIDEOptions(nil, dlgProjectOptions, TAbstractIDEProjectOptions);
|
||||
NewCaption := Project1.Title;
|
||||
if NewCaption = '' then
|
||||
NewCaption := ExtractFilenameOnly(Project1.ProjectInfoFile);
|
||||
DoOpenIDEOptions(nil, Format(dlgProjectOptionsFor, [NewCaption]), TAbstractIDEProjectOptions);
|
||||
end;
|
||||
|
||||
function TMainIDE.UpdateProjectPOFile(AProject: TProject): TModalResult;
|
||||
@ -4353,6 +4357,11 @@ var
|
||||
ActiveUnitInfo: TUnitInfo;
|
||||
begin
|
||||
BeginCodeTool(ActiveSrcEdit, ActiveUnitInfo, []);
|
||||
with Sender as TProject do
|
||||
begin
|
||||
UpdateExecutableType;
|
||||
CompilerOptions.UseAsDefault := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.DoProjectOptionsAfterWrite(Sender: TObject);
|
||||
@ -4451,6 +4460,10 @@ begin
|
||||
MessageDlg(Project.Resources.Messages.Text, mtWarning, [mbOk], 0);
|
||||
end;
|
||||
UpdateCaption;
|
||||
Project.DefineTemplates.AllChanged;
|
||||
// save to primary config directory
|
||||
if Project.CompilerOptions.UseAsDefault then
|
||||
Project.CompilerOptions.SaveCompilerOptions(False);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.DoCompilerOptionsBeforeWrite(Sender: TObject);
|
||||
@ -4465,6 +4478,9 @@ begin
|
||||
begin
|
||||
TBaseCompilerOptions(Sender).Modified := True;
|
||||
IncreaseCompilerParseStamp;
|
||||
MainBuildBoss.RescanCompilerDefines(True, True);
|
||||
IncreaseCompilerParseStamp;
|
||||
UpdateHighlighters; // because of FPC/Delphi mode
|
||||
end;
|
||||
OldCompOpts.Free;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user