IDE: removed old workaround global SrcPath

git-svn-id: trunk@41908 -
This commit is contained in:
mattias 2013-06-26 12:47:16 +00:00
parent 2568311155
commit e935766ee6
4 changed files with 31 additions and 117 deletions

View File

@ -58,7 +58,6 @@ type
FIdentComplShowHelp: boolean;
// General
FSrcPath: string;
FAdjustTopLineDueToComment: boolean;
FJumpCentered: boolean;
FCursorBeyondEOL: boolean;
@ -129,7 +128,6 @@ type
procedure CreateDefaultIndentationFile;
// General
property SrcPath: string read FSrcPath write FSrcPath;
property AdjustTopLineDueToComment: boolean
read FAdjustTopLineDueToComment write FAdjustTopLineDueToComment;
property JumpCentered: boolean read FJumpCentered write FJumpCentered;
@ -375,7 +373,6 @@ begin
debugln(lisCompilerNOTELoadingOldCodetoolsOptionsFile, FFileName);
// General
FSrcPath:=XMLConfig.GetValue('CodeToolsOptions/SrcPath/Value','');
FAdjustTopLineDueToComment:=XMLConfig.GetValue(
'CodeToolsOptions/AdjustTopLineDueToComment/Value',true);
FJumpCentered:=XMLConfig.GetValue('CodeToolsOptions/JumpCentered/Value',
@ -507,7 +504,6 @@ begin
CodeToolsOptionsVersion);
// General
XMLConfig.SetDeleteValue('CodeToolsOptions/SrcPath/Value',FSrcPath,'');
XMLConfig.SetDeleteValue('CodeToolsOptions/AdjustTopLineDueToComment/Value',
FAdjustTopLineDueToComment,true);
XMLConfig.SetDeleteValue('CodeToolsOptions/JumpCentered/Value',
@ -655,7 +651,6 @@ begin
if CodeToolsOpts <> nil then
begin
// General
FSrcPath:=CodeToolsOpts.FSrcPath;
FAdjustTopLineDueToComment:=CodeToolsOpts.FAdjustTopLineDueToComment;
FJumpCentered:=CodeToolsOpts.FJumpCentered;
FCursorBeyondEOL:=CodeToolsOpts.FCursorBeyondEOL;
@ -714,7 +709,6 @@ procedure TCodeToolsOptions.Clear;
// !!! Does not reset Filename !!!
begin
// General
FSrcPath:='';
FAdjustTopLineDueToComment:=true;
FJumpCentered:=true;
FCursorBeyondEOL:=true;
@ -781,8 +775,7 @@ function TCodeToolsOptions.IsEqual(CodeToolsOpts: TCodeToolsOptions): boolean;
begin
Result:=
// General
(FSrcPath=CodeToolsOpts.FSrcPath)
and (FAdjustTopLineDueToComment=CodeToolsOpts.FAdjustTopLineDueToComment)
(FAdjustTopLineDueToComment=CodeToolsOpts.FAdjustTopLineDueToComment)
and (FJumpCentered=CodeToolsOpts.FJumpCentered)
and (FCursorBeyondEOL=CodeToolsOpts.FCursorBeyondEOL)
and (AddInheritedCodeToOverrideMethod=CodeToolsOpts.AddInheritedCodeToOverrideMethod)
@ -882,7 +875,6 @@ begin
if Dest is TCodeToolManager then
begin
// General - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SetAdditionalGlobalSrcPathToCodeToolBoss(SrcPath);
Boss.AdjustTopLineDueToComment:=AdjustTopLineDueToComment;
Boss.JumpCentered:=JumpCentered;
Boss.CursorBeyondEOL:=CursorBeyondEOL;

View File

@ -44,7 +44,6 @@ uses
// global
function FindRootTemplate(AName: string): TDefineTemplate;
procedure SetAdditionalGlobalSrcPathToCodeToolBoss(const SrcPath: string);
// global defaults
function FindUseDefaultsFlagTemplate: TDefineTemplate;
@ -423,22 +422,6 @@ begin
Result:=nil;
end;
procedure SetAdditionalGlobalSrcPathToCodeToolBoss(const SrcPath: string);
var DefTempl: TDefineTemplate;
begin
if SrcPath<>'' then begin
DefTempl:=TDefineTemplate.Create('GlobalSrcPathAdd',
lisEdtDefGlobalSourcePathAddition, ExternalMacroStart+'SRCPATH',
ConvertTransferMacrosToExternalMacros(SrcPath)+';'
+'$('+ExternalMacroStart+'SRCPATH)',
da_DefineRecurse);
DefTempl.Flags:=[dtfAutoGenerated];
CodeToolBoss.DefineTree.ReplaceRootSameName(DefTempl);
end else begin
CodeToolBoss.DefineTree.RemoveRootDefineTemplateByName('GlobalSrcPathAdd');
end;
end;
function FindUseDefaultsFlagTemplate: TDefineTemplate;
begin
Result:=FindRootTemplate(UseDefaultsFlagTemplName);

View File

@ -9,53 +9,12 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
Visible = False
DesignLeft = 302
DesignTop = 344
object SrcPathGroupBox: TGroupBox
Left = 0
Height = 54
Top = 0
Width = 552
Align = alTop
AutoSize = True
Caption = 'SrcPathGroupBox'
ClientHeight = 37
ClientWidth = 548
TabOrder = 0
object SrcPathEdit: TEdit
AnchorSideLeft.Control = SrcPathGroupBox
AnchorSideRight.Control = SrcPathButton
Left = 6
Height = 25
Top = 6
Width = 513
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
BorderSpacing.Bottom = 6
TabOrder = 0
Text = 'SrcPathEdit'
end
object SrcPathButton: TSpeedButton
AnchorSideTop.Control = SrcPathEdit
AnchorSideRight.Control = SrcPathGroupBox
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = SrcPathEdit
AnchorSideBottom.Side = asrBottom
Left = 519
Height = 25
Top = 6
Width = 23
Anchors = [akTop, akRight, akBottom]
BorderSpacing.Right = 6
Caption = '...'
OnClick = SrcPathButtonClick
end
end
object JumpingGroupBox: TGroupBox
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
Left = 0
Height = 125
Top = 60
Height = 127
Top = 6
Width = 552
Align = alTop
AutoSize = True
@ -65,14 +24,14 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
ChildSizing.TopBottomSpacing = 6
ClientHeight = 108
ClientWidth = 548
TabOrder = 1
TabOrder = 0
object AdjustTopLineDueToCommentCheckBox: TCheckBox
AnchorSideLeft.Control = JumpingGroupBox
AnchorSideTop.Control = JumpingGroupBox
Left = 6
Height = 24
Top = 6
Width = 247
Width = 297
Caption = 'AdjustTopLineDueToCommentCheckBox'
TabOrder = 0
end
@ -83,7 +42,7 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
Left = 6
Height = 24
Top = 30
Width = 162
Width = 191
Caption = 'JumpCenteredCheckBox'
TabOrder = 1
end
@ -94,7 +53,7 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
Left = 6
Height = 24
Top = 54
Width = 179
Width = 213
Caption = 'CursorBeyondEOLCheckBox'
TabOrder = 2
end
@ -105,15 +64,15 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
Left = 6
Height = 24
Top = 78
Width = 216
Width = 263
Caption = 'SkipForwardDeclarationsCheckBox'
TabOrder = 3
end
end
object IndentationGroupBox: TGroupBox
Left = 0
Height = 149
Top = 191
Height = 155
Top = 139
Width = 552
Align = alTop
AutoSize = True
@ -121,17 +80,17 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
Caption = 'IndentationGroupBox'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ClientHeight = 132
ClientHeight = 136
ClientWidth = 548
TabOrder = 2
TabOrder = 1
object IndentFileLabel: TLabel
AnchorSideLeft.Control = IndentationGroupBox
AnchorSideTop.Control = IndentFileEdit
AnchorSideTop.Side = asrCenter
Left = 6
Height = 15
Top = 105
Width = 84
Height = 17
Top = 107
Width = 104
BorderSpacing.Left = 6
Caption = 'IndentFileLabel'
ParentColor = False
@ -142,10 +101,10 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
AnchorSideTop.Control = IndentFileButton
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = IndentFileButton
Left = 96
Height = 25
Top = 100
Width = 340
Left = 116
Height = 27
Top = 102
Width = 301
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
@ -158,10 +117,10 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = IndentationGroupBox
AnchorSideRight.Side = asrBottom
Left = 436
Height = 27
Top = 99
Width = 106
Left = 417
Height = 29
Top = 101
Width = 125
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Top = 6
@ -177,8 +136,8 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
AnchorSideTop.Side = asrBottom
Left = 6
Height = 24
Top = 69
Width = 209
Top = 71
Width = 249
Caption = 'IndentContextSensitiveCheckBox'
TabOrder = 2
end
@ -188,8 +147,8 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
AnchorSideTop.Side = asrBottom
Left = 6
Height = 24
Top = 21
Width = 187
Top = 23
Width = 221
Caption = 'IndentOnLineBreakCheckBox'
OnChange = IndentOnLineBreakCheckBoxChange
TabOrder = 3
@ -200,8 +159,8 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
AnchorSideTop.Side = asrBottom
Left = 6
Height = 24
Top = 45
Width = 162
Top = 47
Width = 192
Caption = 'IndentOnPasteCheckBox'
OnChange = IndentOnPasteCheckBoxChange
TabOrder = 4
@ -209,9 +168,9 @@ object CodetoolsGeneralOptionsFrame: TCodetoolsGeneralOptionsFrame
object GeneralAutoIndent: TLabel
Cursor = crHandPoint
Left = 6
Height = 15
Height = 17
Top = 6
Width = 106
Width = 128
Caption = 'GeneralAutoIndent'
Font.Color = clBlue
ParentColor = False

View File

@ -48,16 +48,12 @@ type
JumpingGroupBox: TGroupBox;
IndentFileLabel: TLabel;
SkipForwardDeclarationsCheckBox: TCheckBox;
SrcPathButton: TSpeedButton;
SrcPathEdit: TEdit;
SrcPathGroupBox: TGroupBox;
procedure GeneralAutoIndentClick(Sender: TObject);
procedure GeneralAutoIndentMouseEnter(Sender: TObject);
procedure GeneralAutoIndentMouseLeave(Sender: TObject);
procedure IndentOnLineBreakCheckBoxChange(Sender: TObject);
procedure IndentFileButtonClick(Sender: TObject);
procedure IndentOnPasteCheckBoxChange(Sender: TObject);
procedure SrcPathButtonClick(Sender: TObject);
private
FDialog: TAbstractOptionsEditorDialog;
procedure VisualizeIndentEnabled;
@ -96,19 +92,6 @@ begin
VisualizeIndentEnabled;
end;
procedure TCodetoolsGeneralOptionsFrame.SrcPathButtonClick(Sender: TObject);
begin
with TPathEditorDialog.Create(Self) do
try
Path := SrcPathEdit.Text;
Templates:=SetDirSeparators('/home/username/buggypackage');
if (ShowModal = mrOK) then
SrcPathEdit.Text := Path;
finally
Free;
end;
end;
procedure TCodetoolsGeneralOptionsFrame.VisualizeIndentEnabled;
var
e: Boolean;
@ -151,7 +134,6 @@ end;
procedure TCodetoolsGeneralOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
begin
FDialog:=ADialog;
SrcPathGroupBox.Caption:=dlgAdditionalSrcPath;
JumpingGroupBox.Caption:=dlgJumpingETC;
AdjustTopLineDueToCommentCheckBox.Caption:=dlgAdjustTopLine;
@ -175,7 +157,6 @@ procedure TCodetoolsGeneralOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptio
begin
with AOptions as TCodeToolsOptions do
begin
SrcPathEdit.Text := SrcPath;
AdjustTopLineDueToCommentCheckBox.Checked := AdjustTopLineDueToComment;
JumpCenteredCheckBox.Checked := JumpCentered;
CursorBeyondEOLCheckBox.Checked := CursorBeyondEOL;
@ -192,7 +173,6 @@ procedure TCodetoolsGeneralOptionsFrame.WriteSettings(AOptions: TAbstractIDEOpti
begin
with AOptions as TCodeToolsOptions do
begin
SrcPath := SrcPathEdit.Text;
AdjustTopLineDueToComment := AdjustTopLineDueToCommentCheckBox.Checked;
JumpCentered := JumpCenteredCheckBox.Checked;
CursorBeyondEOL := CursorBeyondEOLCheckBox.Checked;