mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-04 15:16:15 +02:00
Revert r41936 #ab277e68c5 because Run Parameters dialog lost its existing history lists.
git-svn-id: trunk@41940 -
This commit is contained in:
parent
eaef69c3e5
commit
ce8c8f7881
@ -534,51 +534,26 @@ var
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ListToString(AList : TStringList) : String;
|
|
||||||
Var
|
|
||||||
I : Integer;
|
|
||||||
Begin
|
|
||||||
Result := '';
|
|
||||||
For I := 0 To AList.Count - 1 Do
|
|
||||||
If I < AList.Count - 1 Then
|
|
||||||
Result := Result + AList[I] + ' '
|
|
||||||
Else
|
|
||||||
Result := Result + AList[I];
|
|
||||||
end;
|
|
||||||
|
|
||||||
Var
|
|
||||||
AStrList : TStringList;
|
|
||||||
AStr : String;
|
|
||||||
begin
|
begin
|
||||||
AStrList := TStringList.Create;
|
Result := '';
|
||||||
AStr := '';
|
|
||||||
|
|
||||||
if Project1=nil then exit;
|
if Project1=nil then exit;
|
||||||
|
if Project1.RunParameterOptions.UseLaunchingApplication then
|
||||||
|
Result := Project1.RunParameterOptions.LaunchingApplicationPathPlusParams;
|
||||||
|
|
||||||
if Project1.RunParameterOptions.UseLaunchingApplication then Begin
|
if Result=''
|
||||||
AStrList.Text := Project1.RunParameterOptions.LaunchingApplicationPathPlusParams;
|
|
||||||
AStr := ListToString(AStrList);
|
|
||||||
end;
|
|
||||||
|
|
||||||
if AStr=''
|
|
||||||
then begin
|
then begin
|
||||||
AStrList.Text := Project1.RunParameterOptions.CmdLineParams;
|
Result:=Project1.RunParameterOptions.CmdLineParams;
|
||||||
AStr:= ListToString(AStrList);
|
if GlobalMacroList.SubstituteStr(Result) then begin
|
||||||
if GlobalMacroList.SubstituteStr(AStr) then begin
|
|
||||||
TargetFileName:='"'+GetTargetFilename+'"';
|
TargetFileName:='"'+GetTargetFilename+'"';
|
||||||
if AStr='' then
|
if Result='' then
|
||||||
AStr:=TargetFileName
|
Result:=TargetFileName
|
||||||
else
|
else
|
||||||
AStr:=TargetFilename+' '+AStr;
|
Result:=TargetFilename+' '+Result;
|
||||||
end else
|
end else
|
||||||
AStr:='';
|
Result:='';
|
||||||
end else begin
|
end else begin
|
||||||
if not GlobalMacroList.SubstituteStr(AStr) then AStr:='';
|
if not GlobalMacroList.SubstituteStr(Result) then Result:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result := AStr;
|
|
||||||
|
|
||||||
FreeAndNil(AStrList);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildManager.GetProjectPublishDir: string;
|
function TBuildManager.GetProjectPublishDir: string;
|
||||||
|
@ -69,32 +69,29 @@ type
|
|||||||
|
|
||||||
|
|
||||||
{ THistoryList - a TStringList to store a history list }
|
{ THistoryList - a TStringList to store a history list }
|
||||||
THistoryListClass = class of THistoryList;
|
|
||||||
THistoryList = class(TStringList)
|
THistoryList = class(TStringList)
|
||||||
private
|
private
|
||||||
|
FListType: TRecentListType;
|
||||||
FMaxCount: integer;
|
FMaxCount: integer;
|
||||||
FName: string;
|
FName: string;
|
||||||
procedure SetMaxCount(const AValue: integer);
|
procedure SetMaxCount(const AValue: integer);
|
||||||
procedure SetName(const AValue: string);
|
procedure SetName(const AValue: string);
|
||||||
protected
|
|
||||||
FListType: TRecentListType;
|
|
||||||
procedure AssignValues(Source : TPersistent);virtual;
|
|
||||||
public
|
public
|
||||||
constructor Create(TheListType: TRecentListType);virtual;
|
constructor Create(TheListType: TRecentListType);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function Push(const Entry: string): integer;
|
function Push(const Entry: string): integer;
|
||||||
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);virtual;
|
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
||||||
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);virtual;
|
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
||||||
procedure AppendEntry(const Entry: string);
|
procedure AppendEntry(const Entry: string);
|
||||||
function IndexOf(const S: string): Integer; override;
|
function IndexOf(const S: string): Integer; override;
|
||||||
class function CreateMe(ATheListType : TRecentListType; AName : String) : THistoryList;virtual;
|
|
||||||
procedure Assign(Source: TPersistent); override;
|
|
||||||
public
|
public
|
||||||
property Name: string read FName write SetName;
|
property Name: string read FName write SetName;
|
||||||
property MaxCount: integer read FMaxCount write SetMaxCount;
|
property MaxCount: integer read FMaxCount write SetMaxCount;
|
||||||
property ListType: TRecentListType read FListType;
|
property ListType: TRecentListType read FListType;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ THistoryLists - list of THistoryList }
|
{ THistoryLists - list of THistoryList }
|
||||||
|
|
||||||
THistoryLists = class
|
THistoryLists = class
|
||||||
@ -113,8 +110,6 @@ type
|
|||||||
function GetList(const Name: string;
|
function GetList(const Name: string;
|
||||||
CreateIfNotExists: boolean; ListType: TRecentListType): THistoryList;
|
CreateIfNotExists: boolean; ListType: TRecentListType): THistoryList;
|
||||||
procedure Add(const ListName, Entry: string; ListType: TRecentListType);
|
procedure Add(const ListName, Entry: string; ListType: TRecentListType);
|
||||||
class procedure RegisterHistoryListClass(AHistoryListClass : THistoryListClass; AHistoryListName : String);
|
|
||||||
class function GetHistoryListClass(AHistoryListName : String) : THistoryListClass;
|
|
||||||
property Items[Index: integer]: THistoryList read GetItems;
|
property Items[Index: integer]: THistoryList read GetItems;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -775,16 +770,6 @@ end;
|
|||||||
|
|
||||||
{ THistoryList }
|
{ THistoryList }
|
||||||
|
|
||||||
class function THistoryList.CreateMe(ATheListType : TRecentListType; AName : String) : THistoryList;
|
|
||||||
Var
|
|
||||||
AHistoryList : THistoryList;
|
|
||||||
begin
|
|
||||||
AHistoryList := THistoryList.Create(ATheListType);
|
|
||||||
AHistoryList.Name:= AName;
|
|
||||||
|
|
||||||
Result := AHistoryList;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure THistoryList.SetMaxCount(const AValue: integer);
|
procedure THistoryList.SetMaxCount(const AValue: integer);
|
||||||
begin
|
begin
|
||||||
if FMaxCount=AValue then exit;
|
if FMaxCount=AValue then exit;
|
||||||
@ -808,25 +793,6 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure THistoryList.Assign(Source: TPersistent);
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
If Source is THistoryList Then Begin
|
|
||||||
Self.FMaxCount := THistoryList(Source).FMaxCount;
|
|
||||||
Self.FName := THistoryList(Source).FName;
|
|
||||||
Self.FListType := THistoryList(Source).FListType;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure THistoryList.AssignValues(Source : TPersistent);
|
|
||||||
Begin
|
|
||||||
If Source is THistoryList Then Begin
|
|
||||||
Self.FMaxCount := THistoryList(Source).FMaxCount;
|
|
||||||
Self.FName := THistoryList(Source).FName;
|
|
||||||
Self.FListType := THistoryList(Source).FListType;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function THistoryList.Push(const Entry: string): integer;
|
function THistoryList.Push(const Entry: string): integer;
|
||||||
begin
|
begin
|
||||||
AddToRecentList(Entry,Self,MaxCount,ListType);
|
AddToRecentList(Entry,Self,MaxCount,ListType);
|
||||||
@ -870,26 +836,6 @@ end;
|
|||||||
|
|
||||||
{ THistoryLists }
|
{ THistoryLists }
|
||||||
|
|
||||||
Var
|
|
||||||
AHistoryListClasses : TStringToPointerTree = NIL;
|
|
||||||
|
|
||||||
class procedure THistoryLists.RegisterHistoryListClass(AHistoryListClass : THistoryListClass; AHistoryListName : String);
|
|
||||||
Var
|
|
||||||
BHistoryListClass : Pointer;
|
|
||||||
Begin
|
|
||||||
If Not AHistoryListClasses.GetData(AHistoryListName, BHistoryListClass) Then
|
|
||||||
AHistoryListClasses.Values[AHistoryListName] := AHistoryListClass;
|
|
||||||
end;
|
|
||||||
|
|
||||||
class function THistoryLists.GetHistoryListClass(AHistoryListName : String) : THistoryListClass;
|
|
||||||
Var
|
|
||||||
BHistoryListClass : Pointer;
|
|
||||||
Begin
|
|
||||||
Result := NIL;
|
|
||||||
If AHistoryListClasses.GetData(AHistoryListName, BHistoryListClass) Then
|
|
||||||
Result := THistoryListClass(BHistoryListClass);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function THistoryLists.GetItems(Index: integer): THistoryList;
|
function THistoryLists.GetItems(Index: integer): THistoryList;
|
||||||
begin
|
begin
|
||||||
Result:=THistoryList(FItems[Index]);
|
Result:=THistoryList(FItems[Index]);
|
||||||
@ -968,16 +914,13 @@ function THistoryLists.GetList(const Name: string; CreateIfNotExists: boolean;
|
|||||||
ListType: TRecentListType): THistoryList;
|
ListType: TRecentListType): THistoryList;
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
AClass : THistoryListClass;
|
|
||||||
begin
|
begin
|
||||||
i:=IndexOfName(Name);
|
i:=IndexOfName(Name);
|
||||||
if i>=0 then
|
if i>=0 then
|
||||||
Result:=Items[i]
|
Result:=Items[i]
|
||||||
else if CreateIfNotExists then begin
|
else if CreateIfNotExists then begin
|
||||||
AClass := Self.GetHistoryListClass(Name);
|
Result:=THistoryList.Create(ListType);
|
||||||
If AClass = NIL Then
|
Result.Name:=Name;
|
||||||
AClass := THistoryList;
|
|
||||||
Result:= AClass.CreateMe(ListType, Name);
|
|
||||||
FItems.Add(Result);
|
FItems.Add(Result);
|
||||||
end else
|
end else
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
@ -1283,10 +1226,6 @@ end;
|
|||||||
|
|
||||||
initialization
|
initialization
|
||||||
InputHistories:= nil;
|
InputHistories:= nil;
|
||||||
AHistoryListClasses := TStringToPointerTree.Create(True);
|
|
||||||
|
|
||||||
finalization
|
|
||||||
FreeAndNil(AHistoryListClasses);
|
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
object RunParamsOptsDlg: TRunParamsOptsDlg
|
object RunParamsOptsDlg: TRunParamsOptsDlg
|
||||||
Left = 411
|
Left = 443
|
||||||
Height = 597
|
Height = 501
|
||||||
Top = 122
|
Top = 176
|
||||||
Width = 496
|
Width = 500
|
||||||
Caption = 'RunParamsOptsDlg'
|
Caption = 'RunParamsOptsDlg'
|
||||||
ClientHeight = 597
|
ClientHeight = 501
|
||||||
ClientWidth = 496
|
ClientWidth = 500
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.1'
|
LCLVersion = '1.1'
|
||||||
object Notebook: TPageControl
|
object Notebook: TPageControl
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 552
|
Height = 456
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 496
|
Width = 500
|
||||||
ActivePage = GeneralPage
|
ActivePage = GeneralPage
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Bottom = 6
|
BorderSpacing.Bottom = 6
|
||||||
@ -20,152 +20,110 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object GeneralPage: TTabSheet
|
object GeneralPage: TTabSheet
|
||||||
Caption = 'GeneralPage'
|
Caption = 'GeneralPage'
|
||||||
ClientHeight = 527
|
ClientHeight = 423
|
||||||
ClientWidth = 492
|
ClientWidth = 496
|
||||||
object DisplayGroupBox: TGroupBox
|
object DisplayGroupBox: TGroupBox
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 71
|
Height = 86
|
||||||
Top = 374
|
Top = 234
|
||||||
Width = 480
|
Width = 484
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'DisplayGroupBox'
|
Caption = 'DisplayGroupBox'
|
||||||
ClientHeight = 52
|
ClientHeight = 65
|
||||||
ClientWidth = 476
|
ClientWidth = 476
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
object DisplayEdit: TEdit
|
object DisplayEdit: TEdit
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 27
|
Top = 34
|
||||||
Width = 464
|
Width = 464
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Around = 6
|
||||||
BorderSpacing.Top = 3
|
|
||||||
BorderSpacing.Right = 6
|
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Text = 'DisplayEdit'
|
Text = 'DisplayEdit'
|
||||||
end
|
end
|
||||||
object UseDisplayCheckBox: TCheckBox
|
object UseDisplayCheckBox: TCheckBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 21
|
Height = 22
|
||||||
Top = 3
|
Top = 6
|
||||||
Width = 464
|
Width = 464
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Top = 3
|
BorderSpacing.Top = 6
|
||||||
BorderSpacing.Right = 6
|
BorderSpacing.Right = 6
|
||||||
|
BorderSpacing.Bottom = 6
|
||||||
Caption = 'UseDisplayCheckBox'
|
Caption = 'UseDisplayCheckBox'
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object CmdLineParametersGroupBox: TGroupBox
|
object CmdLineParametersGroupBox: TGroupBox
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 135
|
Height = 62
|
||||||
Top = 68
|
Top = 70
|
||||||
Width = 480
|
Width = 484
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'CmdLineParametersGroupBox'
|
Caption = 'CmdLineParametersGroupBox'
|
||||||
ClientHeight = 116
|
ClientHeight = 41
|
||||||
ClientWidth = 476
|
ClientWidth = 476
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object CmdLineParametersComboBox: TComboBox
|
object CmdLineParametersComboBox: TComboBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 25
|
Height = 29
|
||||||
Top = 3
|
Top = 6
|
||||||
Width = 464
|
Width = 464
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Around = 6
|
||||||
BorderSpacing.Top = 3
|
|
||||||
BorderSpacing.Right = 6
|
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnSelect = CmdLineParametersComboBoxSelect
|
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Text = 'CmdLineParametersComboBox'
|
Text = 'CmdLineParametersComboBox'
|
||||||
end
|
end
|
||||||
object CmdLineParametersMemo: TMemo
|
|
||||||
AnchorSideTop.Control = CmdLineParametersComboBox
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
Left = 6
|
|
||||||
Height = 82
|
|
||||||
Top = 31
|
|
||||||
Width = 464
|
|
||||||
Anchors = [akTop, akLeft, akRight]
|
|
||||||
BorderSpacing.Top = 3
|
|
||||||
BorderSpacing.Bottom = 3
|
|
||||||
OnChange = CmdLineParametersMemoChange
|
|
||||||
ScrollBars = ssAutoBoth
|
|
||||||
TabOrder = 1
|
|
||||||
WordWrap = False
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
object UseLaunchingApplicationGroupBox: TGroupBox
|
object UseLaunchingApplicationGroupBox: TGroupBox
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 159
|
Height = 90
|
||||||
Top = 209
|
Top = 138
|
||||||
Width = 480
|
Width = 484
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'UseLaunchingApplicationGroupBox'
|
Caption = 'UseLaunchingApplicationGroupBox'
|
||||||
ClientHeight = 140
|
ClientHeight = 69
|
||||||
ClientWidth = 476
|
ClientWidth = 476
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
object UseLaunchingApplicationCheckBox: TCheckBox
|
object UseLaunchingApplicationCheckBox: TCheckBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 21
|
Height = 22
|
||||||
Top = 3
|
Top = 6
|
||||||
Width = 464
|
Width = 464
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Top = 3
|
BorderSpacing.Top = 6
|
||||||
BorderSpacing.Right = 6
|
BorderSpacing.Right = 6
|
||||||
|
BorderSpacing.Bottom = 6
|
||||||
Caption = 'UseLaunchingApplicationCheckBox'
|
Caption = 'UseLaunchingApplicationCheckBox'
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object UseLaunchingApplicationComboBox: TComboBox
|
object UseLaunchingApplicationComboBox: TComboBox
|
||||||
AnchorSideTop.Control = UseLaunchingApplicationCheckBox
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 25
|
Height = 29
|
||||||
Top = 27
|
Top = 34
|
||||||
Width = 464
|
Width = 464
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Align = alTop
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Around = 6
|
||||||
BorderSpacing.Top = 3
|
|
||||||
BorderSpacing.Right = 6
|
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnSelect = UseLaunchingApplicationComboBoxSelect
|
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Text = 'UseLaunchingApplicationComboBox'
|
Text = 'UseLaunchingApplicationComboBox'
|
||||||
end
|
end
|
||||||
object UseLaunchingApplicationMemo: TMemo
|
|
||||||
AnchorSideTop.Control = UseLaunchingApplicationComboBox
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
Left = 6
|
|
||||||
Height = 82
|
|
||||||
Top = 55
|
|
||||||
Width = 464
|
|
||||||
Anchors = [akTop, akLeft, akRight]
|
|
||||||
BorderSpacing.Top = 3
|
|
||||||
BorderSpacing.Bottom = 3
|
|
||||||
OnChange = UseLaunchingApplicationMemoChange
|
|
||||||
ScrollBars = ssAutoBoth
|
|
||||||
TabOrder = 2
|
|
||||||
WordWrap = False
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
object HostApplicationGroupBox: TGroupBox
|
object HostApplicationGroupBox: TGroupBox
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 56
|
Height = 58
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 480
|
Width = 484
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -179,10 +137,10 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = HostApplicationEdit
|
AnchorSideBottom.Control = HostApplicationEdit
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 292
|
Left = 288
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 178
|
Width = 182
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
@ -199,7 +157,7 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
Left = 6
|
Left = 6
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 280
|
Width = 276
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
@ -207,16 +165,15 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
object WorkingDirectoryGroupBox: TGroupBox
|
object WorkingDirectoryGroupBox: TGroupBox
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 50
|
Height = 62
|
||||||
Top = 451
|
Top = 326
|
||||||
Width = 480
|
Width = 484
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'WorkingDirectoryGroupBox'
|
Caption = 'WorkingDirectoryGroupBox'
|
||||||
ClientHeight = 31
|
ClientHeight = 41
|
||||||
ClientWidth = 476
|
ClientWidth = 476
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
object WorkingDirectoryBtn: TButton
|
object WorkingDirectoryBtn: TButton
|
||||||
@ -225,10 +182,10 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = WorkingDirectoryComboBox
|
AnchorSideBottom.Control = WorkingDirectoryComboBox
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 330
|
Left = 327
|
||||||
Height = 22
|
Height = 29
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 140
|
Width = 143
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
@ -242,14 +199,11 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
AnchorSideTop.Control = WorkingDirectoryGroupBox
|
AnchorSideTop.Control = WorkingDirectoryGroupBox
|
||||||
AnchorSideRight.Control = WorkingDirectoryBtn
|
AnchorSideRight.Control = WorkingDirectoryBtn
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 25
|
Height = 29
|
||||||
Top = 3
|
Top = 6
|
||||||
Width = 318
|
Width = 315
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Around = 6
|
||||||
BorderSpacing.Top = 3
|
|
||||||
BorderSpacing.Right = 6
|
|
||||||
BorderSpacing.Bottom = 3
|
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Text = 'WorkingDirectoryComboBox'
|
Text = 'WorkingDirectoryComboBox'
|
||||||
@ -258,16 +212,16 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
end
|
end
|
||||||
object EnvVarsPage: TTabSheet
|
object EnvVarsPage: TTabSheet
|
||||||
Caption = 'EnvVarsPage'
|
Caption = 'EnvVarsPage'
|
||||||
ClientHeight = 527
|
ClientHeight = 423
|
||||||
ClientWidth = 489
|
ClientWidth = 496
|
||||||
OnResize = EnvVarsPageResize
|
OnResize = EnvVarsPageResize
|
||||||
object IncludeSystemVariablesCheckBox: TCheckBox
|
object IncludeSystemVariablesCheckBox: TCheckBox
|
||||||
AnchorSideLeft.Control = EnvVarsPage
|
AnchorSideLeft.Control = EnvVarsPage
|
||||||
AnchorSideBottom.Control = EnvVarsPage
|
AnchorSideBottom.Control = EnvVarsPage
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 21
|
Height = 22
|
||||||
Top = 500
|
Top = 395
|
||||||
Width = 477
|
Width = 484
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'IncludeSystemVariablesCheckBox'
|
Caption = 'IncludeSystemVariablesCheckBox'
|
||||||
@ -281,14 +235,14 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = IncludeSystemVariablesCheckBox
|
AnchorSideBottom.Control = IncludeSystemVariablesCheckBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 265
|
Height = 160
|
||||||
Top = 229
|
Top = 229
|
||||||
Width = 477
|
Width = 484
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'UserOverridesGroupBox'
|
Caption = 'UserOverridesGroupBox'
|
||||||
ClientHeight = 246
|
ClientHeight = 139
|
||||||
ClientWidth = 473
|
ClientWidth = 476
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object UserOverridesListView: TListView
|
object UserOverridesListView: TListView
|
||||||
AnchorSideLeft.Control = UserOverridesGroupBox
|
AnchorSideLeft.Control = UserOverridesGroupBox
|
||||||
@ -296,14 +250,12 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
AnchorSideRight.Control = UserOverridesGroupBox
|
AnchorSideRight.Control = UserOverridesGroupBox
|
||||||
AnchorSideBottom.Control = UserOverridesAddButton
|
AnchorSideBottom.Control = UserOverridesAddButton
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 205
|
Height = 93
|
||||||
Top = 3
|
Top = 6
|
||||||
Width = 461
|
Width = 464
|
||||||
Align = alTop
|
Align = alTop
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Around = 6
|
||||||
BorderSpacing.Top = 3
|
|
||||||
BorderSpacing.Right = 6
|
|
||||||
Columns = <
|
Columns = <
|
||||||
item
|
item
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
@ -325,9 +277,9 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
AnchorSideBottom.Control = UserOverridesGroupBox
|
AnchorSideBottom.Control = UserOverridesGroupBox
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 26
|
Height = 28
|
||||||
Top = 214
|
Top = 105
|
||||||
Width = 168
|
Width = 173
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -340,10 +292,10 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideBottom.Control = UserOverridesGroupBox
|
AnchorSideBottom.Control = UserOverridesGroupBox
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 371
|
Left = 381
|
||||||
Height = 26
|
Height = 28
|
||||||
Top = 214
|
Top = 105
|
||||||
Width = 168
|
Width = 172
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -356,10 +308,10 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideBottom.Control = UserOverridesGroupBox
|
AnchorSideBottom.Control = UserOverridesGroupBox
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 180
|
Left = 185
|
||||||
Height = 26
|
Height = 28
|
||||||
Top = 214
|
Top = 105
|
||||||
Width = 185
|
Width = 190
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -373,13 +325,13 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
Left = 6
|
Left = 6
|
||||||
Height = 217
|
Height = 217
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 477
|
Width = 484
|
||||||
Align = alTop
|
Align = alTop
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'SystemVariablesGroupBox'
|
Caption = 'SystemVariablesGroupBox'
|
||||||
ClientHeight = 198
|
ClientHeight = 196
|
||||||
ClientWidth = 473
|
ClientWidth = 476
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object SystemVariablesListView: TListView
|
object SystemVariablesListView: TListView
|
||||||
AnchorSideLeft.Control = SystemVariablesGroupBox
|
AnchorSideLeft.Control = SystemVariablesGroupBox
|
||||||
@ -387,13 +339,11 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
AnchorSideRight.Control = SystemVariablesGroupBox
|
AnchorSideRight.Control = SystemVariablesGroupBox
|
||||||
AnchorSideBottom.Control = SystemVariablesGroupBox
|
AnchorSideBottom.Control = SystemVariablesGroupBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 195
|
Height = 184
|
||||||
Top = 3
|
Top = 6
|
||||||
Width = 461
|
Width = 464
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Around = 6
|
||||||
BorderSpacing.Top = 3
|
|
||||||
BorderSpacing.Right = 6
|
|
||||||
Columns = <
|
Columns = <
|
||||||
item
|
item
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
@ -416,8 +366,8 @@ object RunParamsOptsDlg: TRunParamsOptsDlg
|
|||||||
object ButtonPanel: TButtonPanel
|
object ButtonPanel: TButtonPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 33
|
Height = 33
|
||||||
Top = 558
|
Top = 462
|
||||||
Width = 484
|
Width = 488
|
||||||
OKButton.Name = 'OKButton'
|
OKButton.Name = 'OKButton'
|
||||||
OKButton.DefaultCaption = True
|
OKButton.DefaultCaption = True
|
||||||
OKButton.OnClick = OkButtonClick
|
OKButton.OnClick = OkButtonClick
|
||||||
|
@ -50,17 +50,16 @@ uses
|
|||||||
Classes, SysUtils, LCLProc, Controls, Forms, Buttons, StdCtrls, ComCtrls,
|
Classes, SysUtils, LCLProc, Controls, Forms, Buttons, StdCtrls, ComCtrls,
|
||||||
Dialogs, ExtCtrls, BaseIDEIntf, IDEHelpIntf, ProjectIntf, IDEDialogs,
|
Dialogs, ExtCtrls, BaseIDEIntf, IDEHelpIntf, ProjectIntf, IDEDialogs,
|
||||||
IDEProcs, SysVarUserOverrideDlg, InputHistory, LazarusIDEStrConsts, FileUtil,
|
IDEProcs, SysVarUserOverrideDlg, InputHistory, LazarusIDEStrConsts, FileUtil,
|
||||||
Laz2_XMLCfg, ButtonPanel, AdvHistoryList;
|
Laz2_XMLCfg, ButtonPanel;
|
||||||
|
|
||||||
{ The xml format version:
|
{ The xml format version:
|
||||||
When the format changes (new values, changed formats) we can distinguish old
|
When the format changes (new values, changed formats) we can distinguish old
|
||||||
files and are able to convert them.
|
files and are able to convert them.
|
||||||
}
|
}
|
||||||
const
|
const
|
||||||
RunParamsOptionsVersion = 2;
|
RunParamsOptionsVersion = '1';
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{
|
{
|
||||||
the storage object for run parameters
|
the storage object for run parameters
|
||||||
}
|
}
|
||||||
@ -68,9 +67,6 @@ type
|
|||||||
{ TRunParamsOptions }
|
{ TRunParamsOptions }
|
||||||
|
|
||||||
TRunParamsOptions = class(TAbstractRunParamsOptions)
|
TRunParamsOptions = class(TAbstractRunParamsOptions)
|
||||||
private
|
|
||||||
FCmdLineParamsHistoryList,
|
|
||||||
FLaunchingApplicationHistoryList : TAdvHistoryList;
|
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -80,8 +76,6 @@ type
|
|||||||
function Save(XMLConfig: TXMLConfig; const Path: string;
|
function Save(XMLConfig: TXMLConfig; const Path: string;
|
||||||
UsePathDelim: TPathDelimSwitch): TModalResult;
|
UsePathDelim: TPathDelimSwitch): TModalResult;
|
||||||
procedure AssignEnvironmentTo(Strings: TStrings); override;
|
procedure AssignEnvironmentTo(Strings: TStrings); override;
|
||||||
property CmdLineParamsHistoryList : TAdvHistoryList read FCmdLineParamsHistoryList;
|
|
||||||
property LaunchingApplicationHistoryList : TAdvHistoryList read FLaunchingApplicationHistoryList;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -93,8 +87,6 @@ type
|
|||||||
TRunParamsOptsDlg = class(TForm)
|
TRunParamsOptsDlg = class(TForm)
|
||||||
ButtonPanel: TButtonPanel;
|
ButtonPanel: TButtonPanel;
|
||||||
CmdLineParametersComboBox: TComboBox;
|
CmdLineParametersComboBox: TComboBox;
|
||||||
CmdLineParametersMemo: TMemo;
|
|
||||||
UseLaunchingApplicationMemo: TMemo;
|
|
||||||
UseDisplayCheckBox: TCheckBox;
|
UseDisplayCheckBox: TCheckBox;
|
||||||
DisplayEdit: TEdit;
|
DisplayEdit: TEdit;
|
||||||
DisplayGroupBox: TGroupBox;
|
DisplayGroupBox: TGroupBox;
|
||||||
@ -119,14 +111,10 @@ type
|
|||||||
Notebook: TPageControl;
|
Notebook: TPageControl;
|
||||||
GeneralPage: TTabSheet;
|
GeneralPage: TTabSheet;
|
||||||
EnvVarsPage: TTabSheet;
|
EnvVarsPage: TTabSheet;
|
||||||
procedure CmdLineParametersComboBoxSelect(Sender: TObject);
|
|
||||||
procedure CmdLineParametersMemoChange(Sender: TObject);
|
|
||||||
procedure EnvVarsPageResize(Sender: TObject);
|
procedure EnvVarsPageResize(Sender: TObject);
|
||||||
procedure HelpButtonClick(Sender: TObject);
|
procedure HelpButtonClick(Sender: TObject);
|
||||||
procedure OkButtonClick(Sender: TObject);
|
procedure OkButtonClick(Sender: TObject);
|
||||||
procedure HostApplicationBrowseBtnClick(Sender: TObject);
|
procedure HostApplicationBrowseBtnClick(Sender: TObject);
|
||||||
procedure UseLaunchingApplicationComboBoxSelect(Sender: TObject);
|
|
||||||
procedure UseLaunchingApplicationMemoChange(Sender: TObject);
|
|
||||||
procedure WorkingDirectoryBtnClick(Sender: TObject);
|
procedure WorkingDirectoryBtnClick(Sender: TObject);
|
||||||
procedure UserOverridesAddButtonClick(Sender: TObject);
|
procedure UserOverridesAddButtonClick(Sender: TObject);
|
||||||
procedure UserOverridesEditButtonClick(Sender: TObject);
|
procedure UserOverridesEditButtonClick(Sender: TObject);
|
||||||
@ -142,7 +130,7 @@ type
|
|||||||
procedure FillUserOverridesListView;
|
procedure FillUserOverridesListView;
|
||||||
procedure SaveToOptions;
|
procedure SaveToOptions;
|
||||||
procedure SaveUserOverrides;
|
procedure SaveUserOverrides;
|
||||||
procedure SetComboBoxText(AComboBox: TComboBox; AText: string);
|
procedure SetComboBoxText(AComboBox: TComboBox; AText: ansistring);
|
||||||
public
|
public
|
||||||
constructor Create(AnOwner: TComponent); override;
|
constructor Create(AnOwner: TComponent); override;
|
||||||
property Options: TRunParamsOptions Read fOptions Write SetOptions;
|
property Options: TRunParamsOptions Read fOptions Write SetOptions;
|
||||||
@ -227,24 +215,16 @@ end;
|
|||||||
constructor TRunParamsOptions.Create;
|
constructor TRunParamsOptions.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
fUserOverrides := TStringList.Create;
|
fUserOverrides := TStringList.Create;
|
||||||
|
|
||||||
FCmdLineParamsHistoryList := TAdvHistoryList(TAdvHistoryList.CreateMe(rltCaseSensitive, hlCmdLineParamsHistoryList));
|
|
||||||
FLaunchingApplicationHistoryList := TAdvHistoryList(TAdvHistoryList.CreateMe(rltCaseSensitive, hlLaunchingApplicationHistoryList));
|
|
||||||
|
|
||||||
Clear;
|
Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TRunParamsOptions.Destroy;
|
destructor TRunParamsOptions.Destroy;
|
||||||
begin
|
begin
|
||||||
fUserOverrides.Free;
|
fUserOverrides.Free;
|
||||||
FreeAndNil(FCmdLineParamsHistoryList);
|
|
||||||
FreeAndNil(FLaunchingApplicationHistoryList);
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TRunParamsOptions.Clear;
|
procedure TRunParamsOptions.Clear;
|
||||||
begin
|
begin
|
||||||
// local options
|
// local options
|
||||||
@ -260,9 +240,6 @@ begin
|
|||||||
// environment options
|
// environment options
|
||||||
fUserOverrides.Clear;
|
fUserOverrides.Clear;
|
||||||
fIncludeSystemVariables := False;
|
fIncludeSystemVariables := False;
|
||||||
|
|
||||||
FCmdLineParamsHistoryList.Clear;
|
|
||||||
FLaunchingApplicationHistoryList.Clear;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TRunParamsOptions.Load(XMLConfig: TXMLConfig; const Path: string;
|
function TRunParamsOptions.Load(XMLConfig: TXMLConfig; const Path: string;
|
||||||
@ -286,52 +263,20 @@ function TRunParamsOptions.Load(XMLConfig: TXMLConfig; const Path: string;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Var
|
|
||||||
ARunParamsOptionsVersion : Integer;
|
|
||||||
begin
|
begin
|
||||||
// get format version to distinguish old formats
|
|
||||||
ARunParamsOptionsVersion := XMLConfig.GetValue(Path + 'RunParams/local/FormatVersion/Value',
|
|
||||||
RunParamsOptionsVersion);
|
|
||||||
|
|
||||||
// local options
|
// local options
|
||||||
fHostApplicationFilename := f(XMLConfig.GetValue(
|
fHostApplicationFilename := f(XMLConfig.GetValue(
|
||||||
Path + 'RunParams/local/HostApplicationFilename/Value',
|
Path + 'RunParams/local/HostApplicationFilename/Value',
|
||||||
fHostApplicationFilename));
|
fHostApplicationFilename));
|
||||||
|
fCmdLineParams := f(XMLConfig.GetValue(
|
||||||
|
Path + 'RunParams/local/CommandLineParams/Value', fCmdLineParams));
|
||||||
fUseLaunchingApplication := XMLConfig.GetValue(
|
fUseLaunchingApplication := XMLConfig.GetValue(
|
||||||
Path + 'RunParams/local/LaunchingApplication/Use', fUseLaunchingApplication);
|
Path + 'RunParams/local/LaunchingApplication/Use', fUseLaunchingApplication);
|
||||||
|
fLaunchingApplicationPathPlusParams :=
|
||||||
Case ARunParamsOptionsVersion Of
|
f(XMLConfig.GetValue(Path + 'RunParams/local/LaunchingApplication/PathPlusParams',
|
||||||
1 : Begin
|
f(GetDefaultLaunchingApplicationPathPlusParams)));
|
||||||
fCmdLineParams := f(XMLConfig.GetValue(
|
|
||||||
Path + 'RunParams/local/CommandLineParams/Value', fCmdLineParams));
|
|
||||||
|
|
||||||
CmdLineParamsHistoryList.Values['Old value'] := fCmdLineParams;
|
|
||||||
CmdLineParamsHistoryList.Selected := 'Old value';
|
|
||||||
|
|
||||||
fLaunchingApplicationPathPlusParams :=
|
|
||||||
f(XMLConfig.GetValue(Path + 'RunParams/local/LaunchingApplication/PathPlusParams',
|
|
||||||
f(GetDefaultLaunchingApplicationPathPlusParams)));
|
|
||||||
|
|
||||||
LaunchingApplicationHistoryList.Values['Old value'] := fLaunchingApplicationPathPlusParams;
|
|
||||||
LaunchingApplicationHistoryList.Selected := 'Old value';
|
|
||||||
End;
|
|
||||||
2 : begin
|
|
||||||
FCmdLineParamsHistoryList.AdvLoadFromXMLConfig(XMLConfig, Path + 'RunParams/local/CommandLineParamsList');
|
|
||||||
If FCmdLineParamsHistoryList.Selected <> '' Then
|
|
||||||
fCmdLineParams := f(FCmdLineParamsHistoryList.Values[FCmdLineParamsHistoryList.Selected]);
|
|
||||||
FLaunchingApplicationHistoryList.AdvLoadFromXMLConfig(XMLConfig, Path + 'RunParams/local/LaunchingApplication/PathPlusParams/List');
|
|
||||||
if FLaunchingApplicationHistoryList.Selected <> '' Then
|
|
||||||
fLaunchingApplicationPathPlusParams := f(FLaunchingApplicationHistoryList.Values[FLaunchingApplicationHistoryList.Selected])
|
|
||||||
else
|
|
||||||
fLaunchingApplicationPathPlusParams := f(GetDefaultLaunchingApplicationPathPlusParams);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
fWorkingDirectory := f(XMLConfig.GetValue(
|
fWorkingDirectory := f(XMLConfig.GetValue(
|
||||||
Path + 'RunParams/local/WorkingDirectory/Value', fWorkingDirectory));
|
Path + 'RunParams/local/WorkingDirectory/Value', fWorkingDirectory));
|
||||||
|
|
||||||
fUseDisplay := XMLConfig.GetValue(Path + 'RunParams/local/Display/Use',
|
fUseDisplay := XMLConfig.GetValue(Path + 'RunParams/local/Display/Use',
|
||||||
fUseDisplay);
|
fUseDisplay);
|
||||||
fDisplay := XMLConfig.GetValue(Path + 'RunParams/local/Display/Value', fDisplay);
|
fDisplay := XMLConfig.GetValue(Path + 'RunParams/local/Display/Value', fDisplay);
|
||||||
@ -367,8 +312,6 @@ function TRunParamsOptions.Save(XMLConfig: TXMLConfig; const Path: string;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Var
|
|
||||||
APrevValue : String;
|
|
||||||
begin
|
begin
|
||||||
// save a format version to distinguish old formats
|
// save a format version to distinguish old formats
|
||||||
XMLConfig.SetValue(Path + 'RunParams/local/FormatVersion/Value',
|
XMLConfig.SetValue(Path + 'RunParams/local/FormatVersion/Value',
|
||||||
@ -377,26 +320,12 @@ begin
|
|||||||
// local options
|
// local options
|
||||||
XMLConfig.SetDeleteValue(Path + 'RunParams/local/HostApplicationFilename/Value',
|
XMLConfig.SetDeleteValue(Path + 'RunParams/local/HostApplicationFilename/Value',
|
||||||
f(fHostApplicationFilename), '');
|
f(fHostApplicationFilename), '');
|
||||||
|
|
||||||
APrevValue := fCmdLineParams;
|
|
||||||
fCmdLineParams := '';
|
|
||||||
|
|
||||||
XMLConfig.SetDeleteValue(Path + 'RunParams/local/CommandLineParams/Value',
|
XMLConfig.SetDeleteValue(Path + 'RunParams/local/CommandLineParams/Value',
|
||||||
f(fCmdLineParams), '');
|
f(fCmdLineParams), '');
|
||||||
|
|
||||||
fCmdLineParams := APrevValue;
|
|
||||||
|
|
||||||
XMLConfig.SetDeleteValue(Path + 'RunParams/local/LaunchingApplication/Use',
|
XMLConfig.SetDeleteValue(Path + 'RunParams/local/LaunchingApplication/Use',
|
||||||
fUseLaunchingApplication, False);
|
fUseLaunchingApplication, False);
|
||||||
|
|
||||||
APrevValue := fLaunchingApplicationPathPlusParams;
|
|
||||||
fLaunchingApplicationPathPlusParams := '';
|
|
||||||
|
|
||||||
XMLConfig.SetDeleteValue(Path + 'RunParams/local/LaunchingApplication/PathPlusParams',
|
XMLConfig.SetDeleteValue(Path + 'RunParams/local/LaunchingApplication/PathPlusParams',
|
||||||
f(fLaunchingApplicationPathPlusParams), '');
|
f(fLaunchingApplicationPathPlusParams), f(GetDefaultLaunchingApplicationPathPlusParams));
|
||||||
|
|
||||||
fLaunchingApplicationPathPlusParams := APrevValue;
|
|
||||||
|
|
||||||
XMLConfig.SetDeleteValue(Path + 'RunParams/local/WorkingDirectory/Value',
|
XMLConfig.SetDeleteValue(Path + 'RunParams/local/WorkingDirectory/Value',
|
||||||
f(fWorkingDirectory), '');
|
f(fWorkingDirectory), '');
|
||||||
XMLConfig.SetDeleteValue(Path + 'RunParams/local/Display/Use',
|
XMLConfig.SetDeleteValue(Path + 'RunParams/local/Display/Use',
|
||||||
@ -409,9 +338,6 @@ begin
|
|||||||
XMLConfig.SetDeleteValue(Path + 'RunParams/environment/IncludeSystemVariables/Value',
|
XMLConfig.SetDeleteValue(Path + 'RunParams/environment/IncludeSystemVariables/Value',
|
||||||
fIncludeSystemVariables, False);
|
fIncludeSystemVariables, False);
|
||||||
|
|
||||||
CmdLineParamsHistoryList.AdvSaveToXMLConfig(XMLConfig, Path + 'RunParams/local/CommandLineParamsList');
|
|
||||||
LaunchingApplicationHistoryList.AdvSaveToXMLConfig(XMLConfig, Path + 'RunParams/local/LaunchingApplication/PathPlusParams/List');
|
|
||||||
|
|
||||||
Result := mrOk;
|
Result := mrOk;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -473,9 +399,6 @@ begin
|
|||||||
DisplayGroupBox.Caption := dlgRunODisplay;
|
DisplayGroupBox.Caption := dlgRunODisplay;
|
||||||
UseDisplayCheckBox.Caption := dlgRunOUsedisplay;
|
UseDisplayCheckBox.Caption := dlgRunOUsedisplay;
|
||||||
DisplayEdit.Parent := DisplayGroupBox;
|
DisplayEdit.Parent := DisplayGroupBox;
|
||||||
|
|
||||||
CmdLineParametersComboBox.Text := '';
|
|
||||||
UseLaunchingApplicationComboBox.Text := '';
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRunParamsOptsDlg.SetupEnvironmentPage;
|
procedure TRunParamsOptsDlg.SetupEnvironmentPage;
|
||||||
@ -527,29 +450,6 @@ begin
|
|||||||
UserOverridesListView.Column[1].Width := UserOverridesListView.Column[0].Width;
|
UserOverridesListView.Column[1].Width := UserOverridesListView.Column[0].Width;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRunParamsOptsDlg.CmdLineParametersMemoChange(Sender: TObject);
|
|
||||||
Var
|
|
||||||
AValue : String;
|
|
||||||
begin
|
|
||||||
AValue := CmdLineParametersComboBox.Text;
|
|
||||||
If AValue = '' Then Begin
|
|
||||||
SetComboBoxText(CmdLineParametersComboBox, 'Default');
|
|
||||||
AValue := CmdLineParametersComboBox.Text;
|
|
||||||
end;
|
|
||||||
If AValue <> '' Then Begin
|
|
||||||
fOptions.CmdLineParamsHistoryList.Values[AValue] := CmdLineParametersMemo.Lines.Text;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TRunParamsOptsDlg.CmdLineParametersComboBoxSelect(Sender: TObject);
|
|
||||||
Var
|
|
||||||
AValue : String;
|
|
||||||
begin
|
|
||||||
AValue := CmdLineParametersComboBox.Text;
|
|
||||||
If AValue <> '' Then
|
|
||||||
CmdLineParametersMemo.Lines.Text := Foptions.CmdLineParamsHistoryList.Values[AValue];
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TRunParamsOptsDlg.HelpButtonClick(Sender: TObject);
|
procedure TRunParamsOptsDlg.HelpButtonClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
LazarusHelp.ShowHelpForIDEControl(Self);
|
LazarusHelp.ShowHelpForIDEControl(Self);
|
||||||
@ -581,29 +481,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRunParamsOptsDlg.UseLaunchingApplicationComboBoxSelect(
|
|
||||||
Sender: TObject);
|
|
||||||
Var
|
|
||||||
AValue : String;
|
|
||||||
begin
|
|
||||||
AValue := UseLaunchingApplicationComboBox.Text;
|
|
||||||
If AValue <> '' Then
|
|
||||||
UseLaunchingApplicationMemo.Text := Foptions.LaunchingApplicationHistoryList.Values[AValue];
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TRunParamsOptsDlg.UseLaunchingApplicationMemoChange(Sender: TObject);
|
|
||||||
Var
|
|
||||||
AValue : String;
|
|
||||||
begin
|
|
||||||
AValue := UseLaunchingApplicationComboBox.Text;
|
|
||||||
If AValue = '' Then Begin
|
|
||||||
SetComboBoxText(UseLaunchingApplicationComboBox, 'Default');
|
|
||||||
AValue := UseLaunchingApplicationComboBox.Text;
|
|
||||||
end;
|
|
||||||
If AValue <> '' Then
|
|
||||||
fOptions.LaunchingApplicationHistoryList.Values[AValue] := UseLaunchingApplicationMemo.Lines.Text;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TRunParamsOptsDlg.WorkingDirectoryBtnClick(Sender: TObject);
|
procedure TRunParamsOptsDlg.WorkingDirectoryBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
NewDirectory: String;
|
NewDirectory: String;
|
||||||
@ -683,36 +560,14 @@ procedure TRunParamsOptsDlg.SaveToOptions;
|
|||||||
InputHistories.HistoryLists.GetList(History,true,ListType).Assign(AComboBox.Items);
|
InputHistories.HistoryLists.GetList(History,true,ListType).Assign(AComboBox.Items);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SaveHistoryList(AHistoryList : THistoryList; History : String; ListType : TRecentListType);
|
|
||||||
begin
|
|
||||||
InputHistories.HistoryLists.GetList(History,true,ListType).Assign(AHistoryList);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure SaveAdvHistoryList(AComboBox : TComboBox; AHistoryList : TAdvHistoryList; AMemo : TMemo);
|
|
||||||
Var
|
|
||||||
AValue : String;
|
|
||||||
begin
|
|
||||||
AValue := AComboBox.Text;
|
|
||||||
If (AValue = '') And (AMemo.Lines.Text <> '') Then
|
|
||||||
AValue := 'Default';
|
|
||||||
If AValue <> '' Then Begin
|
|
||||||
AHistoryList.Values[AValue] := AMemo.Lines.Text;
|
|
||||||
AHistoryList.Selected := AValue;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// local
|
// local
|
||||||
fOptions.HostApplicationFilename := Trim(HostApplicationEdit.Text);
|
fOptions.HostApplicationFilename := Trim(HostApplicationEdit.Text);
|
||||||
|
fOptions.CmdLineParams := Trim(CmdLineParametersComboBox.Text);
|
||||||
fOptions.CmdLineParams := Trim(CmdLineParametersMemo.Lines.Text);
|
|
||||||
|
|
||||||
fOptions.UseLaunchingApplication := UseLaunchingApplicationCheckBox.Checked;
|
fOptions.UseLaunchingApplication := UseLaunchingApplicationCheckBox.Checked;
|
||||||
fOptions.LaunchingApplicationPathPlusParams :=
|
fOptions.LaunchingApplicationPathPlusParams :=
|
||||||
Trim(UseLaunchingApplicationMemo.Lines.Text);
|
Trim(UseLaunchingApplicationComboBox.Text);
|
||||||
|
|
||||||
fOptions.WorkingDirectory := Trim(WorkingDirectoryComboBox.Text);
|
fOptions.WorkingDirectory := Trim(WorkingDirectoryComboBox.Text);
|
||||||
|
|
||||||
fOptions.UseDisplay := UseDisplayCheckBox.Checked;
|
fOptions.UseDisplay := UseDisplayCheckBox.Checked;
|
||||||
fOptions.Display := Trim(DisplayEdit.Text);
|
fOptions.Display := Trim(DisplayEdit.Text);
|
||||||
|
|
||||||
@ -720,16 +575,10 @@ begin
|
|||||||
SaveComboHistory(WorkingDirectoryComboBox,hlWorkingDirectory,rltFile);
|
SaveComboHistory(WorkingDirectoryComboBox,hlWorkingDirectory,rltFile);
|
||||||
|
|
||||||
// history list: UseLaunchingApplicationComboBox
|
// history list: UseLaunchingApplicationComboBox
|
||||||
//SaveComboHistory(UseLaunchingApplicationComboBox,hlLaunchingApplication,rltFile);
|
SaveComboHistory(UseLaunchingApplicationComboBox,hlLaunchingApplication,rltFile);
|
||||||
|
|
||||||
SaveAdvHistoryList(CmdLineParametersComboBox, fOptions.CmdLineParamsHistoryList, CmdLineParametersMemo);
|
|
||||||
SaveAdvHistoryList(UseLaunchingApplicationComboBox, fOptions.LaunchingApplicationHistoryList, UseLaunchingApplicationMemo);
|
|
||||||
|
|
||||||
SaveHistoryList(fOptions.CmdLineParamsHistoryList, hlCmdLineParamsHistoryList, rltCaseSensitive);
|
|
||||||
SaveHistoryList(fOptions.LaunchingApplicationHistoryList, hlLaunchingApplicationHistoryList, rltCaseSensitive);
|
|
||||||
|
|
||||||
// history list: CmdLineParametersComboBox
|
// history list: CmdLineParametersComboBox
|
||||||
//SaveComboHistory(CmdLineParametersComboBox,hlCmdLineParameters,rltCaseSensitive);
|
SaveComboHistory(CmdLineParametersComboBox,hlCmdLineParameters,rltCaseSensitive);
|
||||||
|
|
||||||
// environment
|
// environment
|
||||||
SaveUserOverrides;
|
SaveUserOverrides;
|
||||||
@ -749,7 +598,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRunParamsOptsDlg.SetComboBoxText(AComboBox: TComboBox; AText: string);
|
procedure TRunParamsOptsDlg.SetComboBoxText(AComboBox: TComboBox; AText: ansistring);
|
||||||
var
|
var
|
||||||
a: integer;
|
a: integer;
|
||||||
begin
|
begin
|
||||||
@ -758,10 +607,8 @@ begin
|
|||||||
AComboBox.ItemIndex := a
|
AComboBox.ItemIndex := a
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
If AText <> '' Then Begin
|
AComboBox.Items.Add(AText);
|
||||||
AComboBox.Items.Add(AText);
|
AComboBox.ItemIndex := AComboBox.Items.IndexOf(AText);
|
||||||
AComboBox.ItemIndex := AComboBox.Items.IndexOf(AText);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -769,9 +616,6 @@ procedure TRunParamsOptsDlg.SetOptions(NewOptions: TRunParamsOptions);
|
|||||||
var
|
var
|
||||||
List: THistoryList;
|
List: THistoryList;
|
||||||
S: String;
|
S: String;
|
||||||
I : Integer;
|
|
||||||
AValue : String;
|
|
||||||
AAdvHistoryList : TAdvHistoryList;
|
|
||||||
begin
|
begin
|
||||||
fOptions := NewOptions;
|
fOptions := NewOptions;
|
||||||
|
|
||||||
@ -786,9 +630,8 @@ begin
|
|||||||
|
|
||||||
// UseLaunchingApplicationComboBox
|
// UseLaunchingApplicationComboBox
|
||||||
UseLaunchingApplicationCheckBox.Checked := fOptions.UseLaunchingApplication;
|
UseLaunchingApplicationCheckBox.Checked := fOptions.UseLaunchingApplication;
|
||||||
|
|
||||||
List := InputHistories.HistoryLists.GetList(hlLaunchingApplication,true,rltFile);
|
List := InputHistories.HistoryLists.GetList(hlLaunchingApplication,true,rltFile);
|
||||||
|
List.AppendEntry(fOptions.LaunchingApplicationPathPlusParams);
|
||||||
S := FindTerminalInPath;
|
S := FindTerminalInPath;
|
||||||
if S <> '' then
|
if S <> '' then
|
||||||
List.AppendEntry(S);
|
List.AppendEntry(S);
|
||||||
@ -800,39 +643,14 @@ begin
|
|||||||
if S <> '' then
|
if S <> '' then
|
||||||
List.AppendEntry(S);
|
List.AppendEntry(S);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
For I := 0 To List.Count - 1 Do Begin
|
UseLaunchingApplicationComboBox.Items.Assign(List);
|
||||||
AValue := Format('Old value #%d', [I + 1]);
|
UseLaunchingApplicationComboBox.Text:=fOptions.LaunchingApplicationPathPlusParams;
|
||||||
fOptions.LaunchingApplicationHistoryList.Values[AValue] := List[I];
|
|
||||||
end;
|
|
||||||
|
|
||||||
AAdvHistoryList := TAdvHistoryList(InputHistories.HistoryLists.GetList(hlLaunchingApplicationHistoryList,true,rltCaseSensitive));
|
|
||||||
|
|
||||||
If AAdvHistoryList.Count > 0 Then
|
|
||||||
fOptions.LaunchingApplicationHistoryList.AssignKeyValue(AAdvHistoryList);
|
|
||||||
|
|
||||||
fOptions.LaunchingApplicationHistoryList.SetComboBox(UseLaunchingApplicationComboBox);
|
|
||||||
SetComboBoxText(UseLaunchingApplicationComboBox, fOptions.LaunchingApplicationHistoryList.Selected);
|
|
||||||
|
|
||||||
UseLaunchingApplicationMemo.Lines.Text:= fOptions.LaunchingApplicationHistoryList.Values[fOptions.FLaunchingApplicationHistoryList.Selected];
|
|
||||||
|
|
||||||
// CmdLineParametersComboBox
|
// CmdLineParametersComboBox
|
||||||
List:=InputHistories.HistoryLists.GetList(hlCmdLineParameters,true,rltCaseSensitive);
|
List:=InputHistories.HistoryLists.GetList(hlCmdLineParameters,true,rltCaseSensitive);
|
||||||
|
List.AppendEntry(fOptions.CmdLineParams);
|
||||||
For I := 0 To List.Count - 1 Do Begin
|
CmdLineParametersComboBox.Items.Assign(List);
|
||||||
AValue := Format('Old value #%d', [I + 1]);
|
CmdLineParametersComboBox.Text := fOptions.CmdLineParams;
|
||||||
fOptions.CmdLineParamsHistoryList.Values[AValue] := List[I];
|
|
||||||
end;
|
|
||||||
|
|
||||||
AAdvHistoryList := TAdvHistoryList(InputHistories.HistoryLists.GetList(hlCmdLineParamsHistoryList,true,rltCaseSensitive));
|
|
||||||
|
|
||||||
If AAdvHistoryList.Count > 0 Then
|
|
||||||
fOptions.CmdLineParamsHistoryList.AssignKeyValue(AAdvHistoryList);
|
|
||||||
|
|
||||||
fOptions.CmdLineParamsHistoryList.SetComboBox(CmdLineParametersComboBox);
|
|
||||||
AValue := fOptions.CmdLineParamsHistoryList.Selected;
|
|
||||||
SetComboBoxText(CmdLineParametersComboBox, AValue);
|
|
||||||
|
|
||||||
CmdLineParametersMemo.Lines.Text := fOptions.CmdLineParamsHistoryList.Values[fOptions.CmdLineParamsHistoryList.Selected];
|
|
||||||
|
|
||||||
UseDisplayCheckBox.Checked := fOptions.UseDisplay;
|
UseDisplayCheckBox.Checked := fOptions.UseDisplay;
|
||||||
DisplayEdit.Text := fOptions.Display;
|
DisplayEdit.Text := fOptions.Display;
|
||||||
|
Loading…
Reference in New Issue
Block a user