IDE: external tools: started options ShowConsole and HideWindow

git-svn-id: trunk@53016 -
This commit is contained in:
mattias 2016-09-22 08:44:36 +00:00
parent b934d7aa02
commit e2ac7a9645
5 changed files with 156 additions and 98 deletions

View File

@ -652,10 +652,12 @@ type
FCustomMacroFunction: TETMacroFunction; FCustomMacroFunction: TETMacroFunction;
FEnvironmentOverrides: TStringList; FEnvironmentOverrides: TStringList;
FExecutable: string; FExecutable: string;
FHideWindow: boolean;
FHint: string; FHint: string;
FQuiet: boolean; FQuiet: boolean;
FResolveMacros: boolean; FResolveMacros: boolean;
FScanners: TStrings; FScanners: TStrings;
FShowConsole: boolean;
fTitle: string; fTitle: string;
fWorkingDirectory: string; fWorkingDirectory: string;
procedure SetEnvironmentOverrides(AValue: TStringList); procedure SetEnvironmentOverrides(AValue: TStringList);
@ -675,6 +677,8 @@ type
property WorkingDirectory: string read fWorkingDirectory write fWorkingDirectory; property WorkingDirectory: string read fWorkingDirectory write fWorkingDirectory;
property EnvironmentOverrides: TStringList read FEnvironmentOverrides write SetEnvironmentOverrides; property EnvironmentOverrides: TStringList read FEnvironmentOverrides write SetEnvironmentOverrides;
property Scanners: TStrings read FScanners write SetScanners; property Scanners: TStrings read FScanners write SetScanners;
property ShowConsole: boolean read FShowConsole write FShowConsole default false; // sets poNoConsole/poNewConsole, works only on MSWindows
property HideWindow: boolean read FHideWindow write FHideWindow default true; // sets/unsets swoHide/swoShow, works only on MSWindows
property ResolveMacros: boolean read FResolveMacros write FResolveMacros default true; property ResolveMacros: boolean read FResolveMacros write FResolveMacros default true;
property CustomMacroFunction: TETMacroFunction read FCustomMacroFunction write FCustomMacroFunction; property CustomMacroFunction: TETMacroFunction read FCustomMacroFunction write FCustomMacroFunction;
property Quiet: boolean read FQuiet write FQuiet; // no user dialogs about errors property Quiet: boolean read FQuiet write FQuiet; // no user dialogs about errors
@ -810,6 +814,8 @@ begin
WorkingDirectory:=Source.WorkingDirectory; WorkingDirectory:=Source.WorkingDirectory;
EnvironmentOverrides:=Source.EnvironmentOverrides; EnvironmentOverrides:=Source.EnvironmentOverrides;
Scanners:=Source.Scanners; Scanners:=Source.Scanners;
ShowConsole:=Source.ShowConsole;
HideWindow:=Source.HideWindow;
ResolveMacros:=Source.ResolveMacros; ResolveMacros:=Source.ResolveMacros;
CustomMacroFunction:=Source.CustomMacroFunction; CustomMacroFunction:=Source.CustomMacroFunction;
Quiet:=Source.Quiet; Quiet:=Source.Quiet;
@ -828,6 +834,8 @@ begin
and (WorkingDirectory=Source.WorkingDirectory) and (WorkingDirectory=Source.WorkingDirectory)
and EnvironmentOverrides.Equals(Source.EnvironmentOverrides) and EnvironmentOverrides.Equals(Source.EnvironmentOverrides)
and Scanners.Equals(Source.Scanners) and Scanners.Equals(Source.Scanners)
and (ShowConsole=Source.ShowConsole)
and (HideWindow=Source.HideWindow)
and (ResolveMacros=Source.ResolveMacros) and (ResolveMacros=Source.ResolveMacros)
and CompareMethods(TMethod(CustomMacroFunction),TMethod(Source.CustomMacroFunction)) and CompareMethods(TMethod(CustomMacroFunction),TMethod(Source.CustomMacroFunction))
and (Quiet=Source.Quiet); and (Quiet=Source.Quiet);
@ -841,6 +849,8 @@ begin
FCustomMacroFunction:=nil; FCustomMacroFunction:=nil;
FEnvironmentOverrides.Clear; FEnvironmentOverrides.Clear;
FExecutable:=''; FExecutable:='';
FShowConsole:=false;
FHideWindow:=true;
FResolveMacros:=true; FResolveMacros:=true;
FScanners.Clear; FScanners.Clear;
fTitle:=''; fTitle:='';

View File

@ -1,7 +1,7 @@
object ExternalToolOptionDlg: TExternalToolOptionDlg object ExternalToolOptionDlg: TExternalToolOptionDlg
Left = 348 Left = 350
Height = 592 Height = 592
Top = 119 Top = 163
Width = 661 Width = 661
Caption = 'ExternalToolOptionDlg' Caption = 'ExternalToolOptionDlg'
ClientHeight = 592 ClientHeight = 592
@ -12,15 +12,15 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
OnCreate = FormCreate OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '1.5' LCLVersion = '1.7'
object TitleLabel: TLabel object TitleLabel: TLabel
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideTop.Control = TitleEdit AnchorSideTop.Control = TitleEdit
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 15 Height = 13
Top = 10 Top = 11
Width = 51 Width = 54
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'TitleLabel' Caption = 'TitleLabel'
ParentColor = False ParentColor = False
@ -30,9 +30,9 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
AnchorSideTop.Control = FileNameEdit AnchorSideTop.Control = FileNameEdit
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 15 Height = 13
Top = 39 Top = 40
Width = 76 Width = 78
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'FilenameLabel' Caption = 'FilenameLabel'
ParentColor = False ParentColor = False
@ -42,9 +42,9 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
AnchorSideTop.Control = MemoParameters AnchorSideTop.Control = MemoParameters
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 15 Height = 13
Top = 102 Top = 103
Width = 87 Width = 92
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'ParametersLabel' Caption = 'ParametersLabel'
ParentColor = False ParentColor = False
@ -54,9 +54,9 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
AnchorSideTop.Control = WorkingDirEdit AnchorSideTop.Control = WorkingDirEdit
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 15 Height = 13
Top = 164 Top = 165
Width = 88 Width = 92
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'WorkingDirLabel' Caption = 'WorkingDirLabel'
ParentColor = False ParentColor = False
@ -67,10 +67,10 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
AnchorSideTop.Control = Owner AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 112 Left = 114
Height = 23 Height = 23
Top = 6 Top = 6
Width = 543 Width = 541
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 24 BorderSpacing.Left = 24
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -84,7 +84,7 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 6 Left = 6
Height = 107 Height = 112
Top = 189 Top = 189
Width = 649 Width = 649
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
@ -92,54 +92,60 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'OptionsGroupBox' Caption = 'OptionsGroupBox'
ChildSizing.Layout = cclTopToBottomThenLeftToRight ChildSizing.Layout = cclTopToBottomThenLeftToRight
ChildSizing.ControlsPerLine = 5 ChildSizing.ControlsPerLine = 3
ClientHeight = 87 ClientHeight = 97
ClientWidth = 645 ClientWidth = 645
TabOrder = 4 TabOrder = 4
object OptionScanOutputForFPCMessagesCheckBox: TCheckBox object ScanOutputForFPCMessagesCheckBox: TCheckBox
AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 19 Height = 24
Top = 6 Top = 6
Width = 269 Width = 244
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'OptionScanOutputForFPCMessagesCheckBox' Caption = 'ScanOutputForFPCMessagesCheckBox'
TabOrder = 0 TabOrder = 0
end end
object OptionScanOutputForMakeMessagesCheckBox: TCheckBox object ScanOutputForMakeMessagesCheckBox: TCheckBox
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 19 Height = 24
Top = 31 Top = 36
Width = 269 Width = 244
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'OptionScanOutputForMakeMessagesCheckBox' Caption = 'ScanOutputForMakeMessagesCheckBox'
TabOrder = 1 TabOrder = 1
end end
object ScannersButton: TButton object ScannersButton: TButton
AnchorSideLeft.Control = OptionsGroupBox
AnchorSideTop.Control = OptionScanOutputForMakeMessagesCheckBox
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 25 Height = 25
Top = 56 Top = 66
Width = 323 Width = 244
AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'ScannersButton' Caption = 'ScannersButton'
TabOrder = 3
end
object chkHideMainForm: TCheckBox
AnchorSideLeft.Control = OptionScanOutputForFPCMessagesCheckBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = OptionScanOutputForFPCMessagesCheckBox
Left = 281
Height = 19
Top = 6
Width = 119
BorderSpacing.Left = 6
Caption = 'chkHideMainForm'
TabOrder = 2 TabOrder = 2
end end
object ShowConsoleCheckBox: TCheckBox
Left = 256
Height = 24
Top = 6
Width = 152
Caption = 'ShowConsoleCheckBox'
TabOrder = 3
Visible = False
end
object HideWindowCheckBox: TCheckBox
Left = 256
Height = 24
Top = 36
Width = 152
Caption = 'HideWindowCheckBox'
TabOrder = 4
Visible = False
end
end end
object KeyGroupBox: TGroupBox object KeyGroupBox: TGroupBox
AnchorSideLeft.Control = OptionsGroupBox AnchorSideLeft.Control = OptionsGroupBox
@ -149,7 +155,7 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 6 Left = 6
Height = 25 Height = 25
Top = 302 Top = 307
Width = 649 Width = 649
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
AutoSize = True AutoSize = True
@ -166,13 +172,13 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ButtonPanel AnchorSideBottom.Control = ButtonPanel
Left = 6 Left = 6
Height = 221 Height = 214
Top = 333 Top = 338
Width = 649 Width = 649
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'MacrosGroupbox' Caption = 'MacrosGroupbox'
ClientHeight = 201 ClientHeight = 199
ClientWidth = 645 ClientWidth = 645
TabOrder = 6 TabOrder = 6
object MacrosListbox: TListBox object MacrosListbox: TListBox
@ -182,9 +188,9 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
AnchorSideBottom.Control = MacrosGroupbox AnchorSideBottom.Control = MacrosGroupbox
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 193 Height = 191
Top = 2 Top = 2
Width = 497 Width = 505
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Right = 6 BorderSpacing.Right = 6
@ -192,16 +198,18 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
ItemHeight = 0 ItemHeight = 0
OnClick = MacrosListboxClick OnClick = MacrosListboxClick
OnDblClick = MacrosListboxDblClick OnDblClick = MacrosListboxDblClick
ScrollWidth = 503
TabOrder = 0 TabOrder = 0
TopIndex = -1
end end
object MacrosInsertButton: TButton object MacrosInsertButton: TButton
AnchorSideTop.Control = MacrosGroupbox AnchorSideTop.Control = MacrosGroupbox
AnchorSideRight.Control = MacrosGroupbox AnchorSideRight.Control = MacrosGroupbox
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 509 Left = 517
Height = 25 Height = 25
Top = 2 Top = 2
Width = 130 Width = 122
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
AutoSize = True AutoSize = True
BorderSpacing.Top = 2 BorderSpacing.Top = 2
@ -214,8 +222,8 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
end end
object ButtonPanel: TButtonPanel object ButtonPanel: TButtonPanel
Left = 6 Left = 6
Height = 26 Height = 28
Top = 560 Top = 558
Width = 649 Width = 649
OKButton.Name = 'OKButton' OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True OKButton.DefaultCaption = True
@ -238,10 +246,10 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = TitleEdit AnchorSideRight.Control = TitleEdit
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 112 Left = 114
Height = 90 Height = 90
Top = 64 Top = 64
Width = 543 Width = 541
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6 BorderSpacing.Top = 6
ScrollBars = ssAutoBoth ScrollBars = ssAutoBoth
@ -254,10 +262,10 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = TitleEdit AnchorSideRight.Control = TitleEdit
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 112 Left = 114
Height = 23 Height = 23
Top = 35 Top = 35
Width = 543 Width = 541
DialogOptions = [ofPathMustExist, ofFileMustExist, ofEnableSizing, ofViewDetail] DialogOptions = [ofPathMustExist, ofFileMustExist, ofEnableSizing, ofViewDetail]
FilterIndex = 1 FilterIndex = 1
HideDirectories = False HideDirectories = False
@ -277,10 +285,10 @@ object ExternalToolOptionDlg: TExternalToolOptionDlg
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = TitleEdit AnchorSideRight.Control = TitleEdit
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 112 Left = 114
Height = 23 Height = 23
Top = 160 Top = 160
Width = 543 Width = 541
ShowHidden = False ShowHidden = False
ButtonWidth = 45 ButtonWidth = 45
NumGlyphs = 1 NumGlyphs = 1

View File

@ -61,10 +61,11 @@ type
fCmdLineParams: string; fCmdLineParams: string;
FEnvironmentOverrides: TStringList; FEnvironmentOverrides: TStringList;
fFilename: string; fFilename: string;
FHideMainForm: boolean; FHideWindow: boolean;
FKey: word; FKey: word;
FScanners: TStrings; FScanners: TStrings;
FShift: TShiftState; FShift: TShiftState;
FShowConsole: boolean;
fTitle: string; fTitle: string;
fWorkingDirectory: string; fWorkingDirectory: string;
fSavedChangeStamp: integer; fSavedChangeStamp: integer;
@ -75,9 +76,10 @@ type
procedure SetEnvironmentOverrides(AValue: TStringList); procedure SetEnvironmentOverrides(AValue: TStringList);
procedure SetFilename(AValue: string); procedure SetFilename(AValue: string);
procedure SetHasScanner(aName: string; AValue: boolean); procedure SetHasScanner(aName: string; AValue: boolean);
procedure SetHideMainForm(AValue: boolean); procedure SetHideWindow(AValue: boolean);
procedure SetModified(AValue: boolean); procedure SetModified(AValue: boolean);
procedure SetScanners(AValue: TStrings); procedure SetScanners(AValue: TStrings);
procedure SetShowConsole(AValue: boolean);
procedure SetTitle(AValue: string); procedure SetTitle(AValue: string);
procedure SetWorkingDirectory(AValue: string); procedure SetWorkingDirectory(AValue: string);
public public
@ -88,17 +90,18 @@ type
procedure Assign(Source: TPersistent); override; procedure Assign(Source: TPersistent); override;
function Load(Config: TConfigStorage; CfgVersion: integer): TModalResult; virtual; function Load(Config: TConfigStorage; CfgVersion: integer): TModalResult; virtual;
function Save(Config: TConfigStorage): TModalResult; virtual; function Save(Config: TConfigStorage): TModalResult; virtual;
procedure IncreaseChangeStamp; inline;
property CmdLineParams: string read fCmdLineParams write SetCmdLineParams; property CmdLineParams: string read fCmdLineParams write SetCmdLineParams;
property Filename: string read fFilename write SetFilename; property Filename: string read fFilename write SetFilename;
property Title: string read fTitle write SetTitle; property Title: string read fTitle write SetTitle;
property WorkingDirectory: string read fWorkingDirectory write SetWorkingDirectory; property WorkingDirectory: string read fWorkingDirectory write SetWorkingDirectory;
property EnvironmentOverrides: TStringList read FEnvironmentOverrides write SetEnvironmentOverrides; property EnvironmentOverrides: TStringList read FEnvironmentOverrides write SetEnvironmentOverrides;
property HideMainForm: boolean read FHideMainForm write SetHideMainForm default true;
property Scanners: TStrings read FScanners write SetScanners; property Scanners: TStrings read FScanners write SetScanners;
property HasScanner[aName: string]: boolean read GetHasScanner write SetHasScanner; property HasScanner[aName: string]: boolean read GetHasScanner write SetHasScanner;
property ShowConsole: boolean read FShowConsole write SetShowConsole;
property HideWindow: boolean read FHideWindow write SetHideWindow;
property Modified: boolean read GetModified write SetModified; property Modified: boolean read GetModified write SetModified;
property ChangeStamp: integer read FChangeStamp write SetChangeStamp; property ChangeStamp: integer read FChangeStamp write SetChangeStamp;
procedure IncreaseChangeStamp; inline;
public public
// these properties are saved in the keymappings, not in the config // these properties are saved in the keymappings, not in the config
property Key: word read FKey write FKey; property Key: word read FKey write FKey;
@ -144,23 +147,24 @@ type
TExternalToolOptionDlg = class(TForm) TExternalToolOptionDlg = class(TForm)
ButtonPanel: TButtonPanel; ButtonPanel: TButtonPanel;
WorkingDirEdit: TDirectoryEdit;
FileNameEdit: TFileNameEdit; FileNameEdit: TFileNameEdit;
MemoParameters: TMemo;
ScannersButton: TButton;
TitleLabel: TLabel;
TitleEdit: TEdit;
FilenameLabel: TLabel; FilenameLabel: TLabel;
ParametersLabel: TLabel; HideWindowCheckBox: TCheckBox;
WorkingDirLabel: TLabel;
OptionsGroupBox: TGroupBox;
OptionScanOutputForFPCMessagesCheckBox: TCheckBox;
OptionScanOutputForMakeMessagesCheckBox: TCheckBox;
KeyGroupBox: TGroupBox; KeyGroupBox: TGroupBox;
MacrosGroupbox: TGroupbox; MacrosGroupbox: TGroupbox;
MacrosListbox: TListbox;
MacrosInsertButton: TButton; MacrosInsertButton: TButton;
chkHideMainForm: TCheckBox; MacrosListbox: TListbox;
MemoParameters: TMemo;
OptionsGroupBox: TGroupBox;
ParametersLabel: TLabel;
ScannersButton: TButton;
ScanOutputForFPCMessagesCheckBox: TCheckBox;
ScanOutputForMakeMessagesCheckBox: TCheckBox;
ShowConsoleCheckBox: TCheckBox;
TitleEdit: TEdit;
TitleLabel: TLabel;
WorkingDirEdit: TDirectoryEdit;
WorkingDirLabel: TLabel;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure HelpButtonClick(Sender: TObject); procedure HelpButtonClick(Sender: TObject);
@ -280,10 +284,10 @@ begin
IncreaseChangeStamp; IncreaseChangeStamp;
end; end;
procedure TExternalUserTool.SetHideMainForm(AValue: boolean); procedure TExternalUserTool.SetHideWindow(AValue: boolean);
begin begin
if FHideMainForm=AValue then Exit; if FHideWindow=AValue then Exit;
FHideMainForm:=AValue; FHideWindow:=AValue;
IncreaseChangeStamp; IncreaseChangeStamp;
end; end;
@ -302,6 +306,13 @@ begin
IncreaseChangeStamp; IncreaseChangeStamp;
end; end;
procedure TExternalUserTool.SetShowConsole(AValue: boolean);
begin
if FShowConsole=AValue then Exit;
FShowConsole:=AValue;
IncreaseChangeStamp;
end;
procedure TExternalUserTool.SetTitle(AValue: string); procedure TExternalUserTool.SetTitle(AValue: string);
begin begin
AValue:=UTF8Trim(AValue,[]); AValue:=UTF8Trim(AValue,[]);
@ -343,7 +354,6 @@ begin
FEnvironmentOverrides.Clear; FEnvironmentOverrides.Clear;
end; end;
Filename:=''; Filename:='';
HideMainForm:=true;
if FScanners.Count>0 then if FScanners.Count>0 then
begin begin
FScanners.Clear; FScanners.Clear;
@ -351,6 +361,8 @@ begin
end; end;
Title:=''; Title:='';
WorkingDirectory:=''; WorkingDirectory:='';
ShowConsole:=false;
HideWindow:=true;
end; end;
function TExternalUserTool.Equals(Obj: TObject): boolean; function TExternalUserTool.Equals(Obj: TObject): boolean;
@ -362,8 +374,9 @@ begin
Result:=(CmdLineParams=Src.CmdLineParams) Result:=(CmdLineParams=Src.CmdLineParams)
and EnvironmentOverrides.Equals(Src.EnvironmentOverrides) and EnvironmentOverrides.Equals(Src.EnvironmentOverrides)
and (Filename=Src.Filename) and (Filename=Src.Filename)
and (HideMainForm=Src.HideMainForm)
and Scanners.Equals(Src.Scanners) and Scanners.Equals(Src.Scanners)
and (ShowConsole=Src.ShowConsole)
and (HideWindow=Src.HideWindow)
and (Title=Src.Title) and (Title=Src.Title)
and (WorkingDirectory=Src.WorkingDirectory) and (WorkingDirectory=Src.WorkingDirectory)
and (Key=Src.Key) and (Key=Src.Key)
@ -383,8 +396,9 @@ begin
WorkingDirectory:=Src.WorkingDirectory; WorkingDirectory:=Src.WorkingDirectory;
EnvironmentOverrides:=Src.EnvironmentOverrides; EnvironmentOverrides:=Src.EnvironmentOverrides;
Filename:=Src.Filename; Filename:=Src.Filename;
HideMainForm:=Src.HideMainForm;
Scanners:=Src.Scanners; Scanners:=Src.Scanners;
ShowConsole:=Src.ShowConsole;
HideWindow:=Src.HideWindow;
Title:=Src.Title; Title:=Src.Title;
Key:=Src.Key; Key:=Src.Key;
Shift:=Src.Shift; Shift:=Src.Shift;
@ -401,7 +415,8 @@ begin
fCmdLineParams:=Config.GetValue('CmdLineParams/Value',''); fCmdLineParams:=Config.GetValue('CmdLineParams/Value','');
fWorkingDirectory:=Config.GetValue('WorkingDirectory/Value',''); fWorkingDirectory:=Config.GetValue('WorkingDirectory/Value','');
Config.GetValue('EnvironmentOverrides/',FEnvironmentOverrides); Config.GetValue('EnvironmentOverrides/',FEnvironmentOverrides);
HideMainForm:=Config.GetValue('HideMainForm/Value',true); ShowConsole:=Config.GetValue('ShowConsole/Value',false);
HideWindow:=Config.GetValue('HideWindow/Value',true);
if CfgVersion<3 then if CfgVersion<3 then
begin begin
@ -426,7 +441,8 @@ begin
Config.SetDeleteValue('WorkingDirectory/Value',WorkingDirectory,''); Config.SetDeleteValue('WorkingDirectory/Value',WorkingDirectory,'');
Config.SetValue('EnvironmentOverrides/',FEnvironmentOverrides); Config.SetValue('EnvironmentOverrides/',FEnvironmentOverrides);
Config.SetValue('Scanners/',FScanners); Config.SetValue('Scanners/',FScanners);
Config.SetDeleteValue('HideMainForm/Value',HideMainForm,true); Config.SetDeleteValue('ShowConsole/Value',ShowConsole,false);
Config.SetDeleteValue('HideWindow/Value',HideWindow,true);
Modified:=false; Modified:=false;
Result:=mrOk; Result:=mrOk;
end; end;
@ -535,6 +551,8 @@ begin
Tool.CmdLineParams:=Item.CmdLineParams; Tool.CmdLineParams:=Item.CmdLineParams;
Tool.EnvironmentOverrides:=Item.EnvironmentOverrides; Tool.EnvironmentOverrides:=Item.EnvironmentOverrides;
Tool.Scanners:=Item.Scanners; Tool.Scanners:=Item.Scanners;
Tool.ShowConsole:=Item.ShowConsole;
Tool.HideWindow:=Item.HideWindow;
Tool.ResolveMacros:=true; Tool.ResolveMacros:=true;
if not RunExternalTool(Tool) then exit; if not RunExternalTool(Tool) then exit;
finally finally
@ -660,9 +678,10 @@ begin
WorkingDirEdit.Text:=fOptions.WorkingDirectory; WorkingDirEdit.Text:=fOptions.WorkingDirectory;
fKeyBox.Key:=fOptions.Key; fKeyBox.Key:=fOptions.Key;
fKeyBox.ShiftState:=fOptions.Shift; fKeyBox.ShiftState:=fOptions.Shift;
OptionScanOutputForFPCMessagesCheckBox.Checked:=fOptions.HasScanner[SubToolFPC]; ScanOutputForFPCMessagesCheckBox.Checked:=fOptions.HasScanner[SubToolFPC];
OptionScanOutputForMakeMessagesCheckBox.Checked:=fOptions.HasScanner[SubToolMake]; ScanOutputForMakeMessagesCheckBox.Checked:=fOptions.HasScanner[SubToolMake];
chkHideMainForm.Checked:=FOptions.HideMainForm; ShowConsoleCheckBox.Checked:=FOptions.ShowConsole;
HideWindowCheckBox.Checked:=FOptions.HideWindow;
fScanners.Assign(fOptions.Scanners); fScanners.Assign(fOptions.Scanners);
UpdateButtons; UpdateButtons;
end; end;
@ -675,14 +694,21 @@ begin
fOptions.WorkingDirectory:=WorkingDirEdit.Text; fOptions.WorkingDirectory:=WorkingDirEdit.Text;
fOptions.Key:=fKeyBox.Key; fOptions.Key:=fKeyBox.Key;
fOptions.Shift:=fKeyBox.ShiftState; fOptions.Shift:=fKeyBox.ShiftState;
FOptions.HideMainForm := chkHideMainForm.Checked; FOptions.ShowConsole := ShowConsoleCheckBox.Checked;
fOptions.HasScanner[SubToolFPC]:=OptionScanOutputForFPCMessagesCheckBox.Checked; FOptions.HideWindow := HideWindowCheckBox.Checked;
fOptions.HasScanner[SubToolMake]:=OptionScanOutputForMakeMessagesCheckBox.Checked; fOptions.HasScanner[SubToolFPC]:=ScanOutputForFPCMessagesCheckBox.Checked;
fOptions.HasScanner[SubToolMake]:=ScanOutputForMakeMessagesCheckBox.Checked;
end; end;
procedure TExternalToolOptionDlg.UpdateButtons; procedure TExternalToolOptionDlg.UpdateButtons;
begin begin
ScannersButton.Visible:=false; ScannersButton.Visible:=false;
{$IFDEF EnableDetach}
{$IFDEF Windows}
HideWindowCheckBox.Visible:=true;
ShowConsoleCheckBox.Visible:=true;
{$ENDIF}
{$ENDIF}
end; end;
function TExternalToolOptionDlg.ScannersToString(List: TStrings): string; function TExternalToolOptionDlg.ScannersToString(List: TStrings): string;
@ -721,13 +747,13 @@ begin
WorkingDirLabel.Caption:=lisEdtExtToolWorkingDirectory; WorkingDirLabel.Caption:=lisEdtExtToolWorkingDirectory;
OptionsGroupBox.Caption:=lisLazBuildOptions; OptionsGroupBox.Caption:=lisLazBuildOptions;
with OptionScanOutputForFPCMessagesCheckBox do // ToDo: add hints
with ScanOutputForFPCMessagesCheckBox do
Caption:=lisEdtExtToolScanOutputForFreePascalCompilerMessages; Caption:=lisEdtExtToolScanOutputForFreePascalCompilerMessages;
with ScanOutputForMakeMessagesCheckBox do
with OptionScanOutputForMakeMessagesCheckBox do
Caption:=lisEdtExtToolScanOutputForMakeMessages; Caption:=lisEdtExtToolScanOutputForMakeMessages;
ShowConsoleCheckBox.Caption:='Show console';
chkHideMainForm.Caption := lisEdtExtToolHideMainForm; HideWindowCheckBox.Caption:='Hide window';
with KeyGroupBox do with KeyGroupBox do
Caption:=lisEdtExtToolKey; Caption:=lisEdtExtToolKey;

View File

@ -1212,7 +1212,14 @@ begin
{$IF FPC_FULLVERSION<20604} {$IF FPC_FULLVERSION<20604}
Proc.InheritHandles:=false; Proc.InheritHandles:=false;
{$ENDIF} {$ENDIF}
Proc.Options:=Proc.Options+[poNoConsole]; if ToolOptions.ShowConsole then
Proc.Options:=Proc.Options+[poNewConsole]-[poNoConsole]
else
Proc.Options:=Proc.Options-[poNewConsole]+[poNoConsole];
if ToolOptions.HideWindow then
Proc.ShowWindow:=swoHide
else
Proc.ShowWindow:=swoShow;
try try
Proc.Execute; Proc.Execute;
except except
@ -1236,6 +1243,14 @@ begin
if ExtToolConsole=nil then if ExtToolConsole=nil then
for i:=0 to ToolOptions.Scanners.Count-1 do for i:=0 to ToolOptions.Scanners.Count-1 do
Tool.AddParsers(ToolOptions.Scanners[i]); Tool.AddParsers(ToolOptions.Scanners[i]);
if ToolOptions.ShowConsole then
Tool.Process.Options:=Proc.Options+[poNewConsole]-[poNoConsole]
else
Tool.Process.Options:=Proc.Options-[poNewConsole]+[poNoConsole];
if ToolOptions.HideWindow then
Tool.Process.ShowWindow:=swoHide
else
Tool.Process.ShowWindow:=swoShow;
if ToolOptions.ResolveMacros then begin if ToolOptions.ResolveMacros then begin
if not Tool.ResolveMacros then begin if not Tool.ResolveMacros then begin
debugln(['Error: (lazarus) [TExternalTools.OnRunExternalTool] failed to resolve macros']); debugln(['Error: (lazarus) [TExternalTools.OnRunExternalTool] failed to resolve macros']);

View File

@ -4031,7 +4031,6 @@ resourcestring
lisEdtExtToolScanOutputForFreePascalCompilerMessages = 'Scan output for ' lisEdtExtToolScanOutputForFreePascalCompilerMessages = 'Scan output for '
+'Free Pascal Compiler messages'; +'Free Pascal Compiler messages';
lisEdtExtToolScanOutputForMakeMessages = 'Scan output for make messages'; lisEdtExtToolScanOutputForMakeMessages = 'Scan output for make messages';
lisEdtExtToolHideMainForm = 'Hide main form';
lisEdtExtToolKey = 'Key'; lisEdtExtToolKey = 'Key';
lisAlternativeKey = 'Alternative key'; lisAlternativeKey = 'Alternative key';
lisEdtExtToolMacros = 'Macros'; lisEdtExtToolMacros = 'Macros';