From a9499f1de3ba305e0ec38ea9412438ed401a481f Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 3 May 2010 09:14:12 +0000 Subject: [PATCH] IDE: compiler options: show options with target file name git-svn-id: trunk@25148 - --- ide/compileroptions.pp | 8 +++++- ide/frames/compiler_path_options.pas | 33 +++++++++++++++++++++- ide/frames/project_application_options.pas | 2 +- ideintf/projectintf.pas | 4 ++- 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/ide/compileroptions.pp b/ide/compileroptions.pp index 8ecb2cdd67..b784a30322 100644 --- a/ide/compileroptions.pp +++ b/ide/compileroptions.pp @@ -2759,7 +2759,7 @@ begin } // append -o Option if neccessary - //DebugLn(['TBaseCompilerOptions.MakeOptionsString ',ccloDoNotAppendOutFileOption in Flags,' TargetFilename="',TargetFilename,'" CurMainSrcFile="',CurMainSrcFile,'" CurOutputDir="',CurOutputDir,'"']); + //DebugLn(['TBaseCompilerOptions.MakeOptionsString ',DbgSName(Self),' ',ccloDoNotAppendOutFileOption in Flags,' TargetFilename="',TargetFilename,'" CurMainSrcFile="',CurMainSrcFile,'" CurOutputDir="',CurOutputDir,'"']); if (not (ccloDoNotAppendOutFileOption in Flags)) and ((TargetFilename<>'') or (CurMainSrcFile<>'') or (CurOutputDir<>'')) then begin @@ -2981,6 +2981,9 @@ begin fOptionsString := CompOpts.fOptionsString; fLoaded := CompOpts.fLoaded; + // Target + TargetFilename := CompOpts.TargetFilename; + // Search Paths StorePathDelim := CompOpts.StorePathDelim; IncludePath := CompOpts.fIncludePaths; @@ -3110,6 +3113,9 @@ begin Tool.AddPathsDiff('StorePathDelim',PathDelimSwitchToDelim[FStorePathDelim], PathDelimSwitchToDelim[CompOpts.FStorePathDelim]); + // target + Tool.AddDiff('TargetFilename',fTargetFilename,CompOpts.fTargetFilename); + // search paths Tool.Path:='Paths'; Tool.AddPathsDiff('IncludePaths',fIncludePaths,CompOpts.fIncludePaths); diff --git a/ide/frames/compiler_path_options.pas b/ide/frames/compiler_path_options.pas index 4bfbead74e..878adcdf8c 100644 --- a/ide/frames/compiler_path_options.pas +++ b/ide/frames/compiler_path_options.pas @@ -8,7 +8,8 @@ uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Buttons, StdCtrls, LCLType, InterfaceBase, IDEOptionsIntf, Project, CompilerOptions, LazarusIDEStrConsts, PathEditorDlg, LazConf, IDEProcs, - CheckCompilerOpts, MacroIntf, ShowCompilerOpts, MainIntf; + CheckCompilerOpts, MacroIntf, ShowCompilerOpts, MainIntf, + project_application_options; type @@ -51,6 +52,7 @@ type procedure DoLoadSave(Sender: TObject); protected procedure DoSaveSettings(AOptions: TAbstractIDEOptions); + function GetTargetFilename: string; public constructor Create(TheOwner: TComponent); override; function Check: boolean; override; @@ -132,6 +134,7 @@ begin Options := TBaseCompilerOptionsClass(FCompilerOpts.ClassType).Create(FCompilerOpts.Owner); try DoSaveSettings(Options); + Options.TargetFilename:=GetTargetFilename; ShowCompilerOptionsDialog(Self, Options); finally Options.Free; @@ -184,6 +187,34 @@ begin OnSaveIDEOptions(Self, AOptions); end; +function TCompilerPathOptionsFrame.GetTargetFilename: string; + + function Search(Control: TWinControl): string; + var + i: Integer; + begin + if Control is TProjectApplicationOptionsFrame then begin + Result:=TProjectApplicationOptionsFrame(Control).TargetFileEdit.Text; + exit; + end; + for i:=0 to Control.ControlCount-1 do begin + if Control.Controls[i] is TWinControl then begin + Result:=Search(TWinControl(Control.Controls[i])); + if Result<>'' then exit; + end; + end; + end; + +begin + if FCompilerOpts is TProjectCompilerOptions then begin + // the target filename is on the project options page + Result:=Search(GetParentForm(Self)); + if Result<>'' then exit; + // project options frame not shown, use default + Result:=FCompilerOpts.TargetFilename; + end; +end; + constructor TCompilerPathOptionsFrame.Create(TheOwner: TComponent); begin inherited Create(TheOwner); diff --git a/ide/frames/project_application_options.pas b/ide/frames/project_application_options.pas index 124ff31ac2..c0aeb5327d 100644 --- a/ide/frames/project_application_options.pas +++ b/ide/frames/project_application_options.pas @@ -5,7 +5,7 @@ unit project_application_options; interface uses - Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, + Classes, SysUtils, LCLProc, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, Buttons, ComCtrls, ExtDlgs, Math, LCLType, IDEOptionsIntf, Project, LazarusIDEStrConsts, EnvironmentOpts, ApplicationBundle, ProjectIcon, W32Manifest; diff --git a/ideintf/projectintf.pas b/ideintf/projectintf.pas index 8c54116194..a13c1bbe6a 100644 --- a/ideintf/projectintf.pas +++ b/ideintf/projectintf.pas @@ -357,6 +357,9 @@ type // Beware: eventually LCLWidgetType will be replaced by a more generic solution property LCLWidgetType: string read fLCLWidgetType write fLCLWidgetType; + // target: + property TargetFilename: String read fTargetFilename write SetTargetFilename; + // parsing: property SyntaxMode: string read FSyntaxMode write FSyntaxMode; property AssemblerStyle: Integer read fAssemblerStyle write fAssemblerStyle; @@ -404,7 +407,6 @@ type property ExecutableType: TCompilationExecutableType read FExecutableType write FExecutableType; property UseExternalDbgSyms: Boolean read FUseExternalDbgSyms write FUseExternalDbgSyms; - property TargetFilename: String read fTargetFilename write SetTargetFilename; // messages: property ShowErrors: Boolean read fShowErrors write fShowErrors;