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