#99, rename class name + add hints

This commit is contained in:
Basile Burg 2016-11-10 20:38:43 +01:00
parent fce411e09d
commit fb56207c35
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
3 changed files with 45 additions and 39 deletions

View File

@ -525,7 +525,7 @@
<Unit54> <Unit54>
<Filename Value="..\src\ce_compilers.pas"/> <Filename Value="..\src\ce_compilers.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/> <ComponentName Value="CmopilersPathsEditor"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
</Unit54> </Unit54>

View File

@ -1,9 +1,9 @@
object Form1: TForm1 object CompilersPathsEditor: TCompilersPathsEditor
Left = 749 Left = 749
Height = 869 Height = 869
Top = 128 Top = 128
Width = 460 Width = 460
Caption = 'Form1' Caption = 'CompilersPathsEditor'
ClientHeight = 869 ClientHeight = 869
ClientWidth = 460 ClientWidth = 460
LCLVersion = '1.6.0.4' LCLVersion = '1.6.0.4'
@ -138,7 +138,7 @@ object Form1: TForm1
object selGDCrt: TDirectoryEdit object selGDCrt: TDirectoryEdit
Left = 2 Left = 2
Height = 20 Height = 20
Hint = 'select the root of LDC runtime & phobos sources (can be a common folder)' Hint = 'select the root of druntime sources'
Top = 60 Top = 60
Width = 448 Width = 448
ShowHidden = False ShowHidden = False
@ -154,7 +154,7 @@ object Form1: TForm1
object selGDCstd: TDirectoryEdit object selGDCstd: TDirectoryEdit
Left = 2 Left = 2
Height = 20 Height = 20
Hint = 'select the root of LDC runtime & phobos sources (can be a common folder)' Hint = 'select the root of phobos sources'
Top = 101 Top = 101
Width = 448 Width = 448
ShowHidden = False ShowHidden = False
@ -228,7 +228,7 @@ object Form1: TForm1
object selLDCrt: TDirectoryEdit object selLDCrt: TDirectoryEdit
Left = 2 Left = 2
Height = 20 Height = 20
Hint = 'select the root of druntime sources' Hint = 'select the root of LDC runtime & phobos sources (can be a common folder)'
Top = 60 Top = 60
Width = 448 Width = 448
ShowHidden = False ShowHidden = False
@ -244,7 +244,7 @@ object Form1: TForm1
object selLDCstd: TDirectoryEdit object selLDCstd: TDirectoryEdit
Left = 2 Left = 2
Height = 20 Height = 20
Hint = 'select the root of phobos sources' Hint = 'select the root of phobos sources (can be empty)'
Top = 101 Top = 101
Width = 448 Width = 448
ShowHidden = False ShowHidden = False
@ -301,6 +301,7 @@ object Form1: TForm1
object selUSER1exe: TFileNameEdit object selUSER1exe: TFileNameEdit
Left = 2 Left = 2
Height = 20 Height = 20
Hint = 'select the compiler'
Top = 19 Top = 19
Width = 448 Width = 448
FilterIndex = 0 FilterIndex = 0
@ -317,6 +318,7 @@ object Form1: TForm1
object selUSER1rt: TDirectoryEdit object selUSER1rt: TDirectoryEdit
Left = 2 Left = 2
Height = 20 Height = 20
Hint = 'select the root of druntime sources'
Top = 60 Top = 60
Width = 448 Width = 448
ShowHidden = False ShowHidden = False
@ -332,6 +334,7 @@ object Form1: TForm1
object selUSER1std: TDirectoryEdit object selUSER1std: TDirectoryEdit
Left = 2 Left = 2
Height = 20 Height = 20
Hint = 'select the root of phobos sources'
Top = 101 Top = 101
Width = 448 Width = 448
ShowHidden = False ShowHidden = False
@ -388,6 +391,7 @@ object Form1: TForm1
object selUSER2exe: TFileNameEdit object selUSER2exe: TFileNameEdit
Left = 2 Left = 2
Height = 20 Height = 20
Hint = 'select the compiler'
Top = 19 Top = 19
Width = 448 Width = 448
FilterIndex = 0 FilterIndex = 0
@ -404,6 +408,7 @@ object Form1: TForm1
object selUSER2rt: TDirectoryEdit object selUSER2rt: TDirectoryEdit
Left = 2 Left = 2
Height = 20 Height = 20
Hint = 'select the root of druntime sources'
Top = 60 Top = 60
Width = 448 Width = 448
ShowHidden = False ShowHidden = False
@ -419,6 +424,7 @@ object Form1: TForm1
object selUSER2std: TDirectoryEdit object selUSER2std: TDirectoryEdit
Left = 2 Left = 2
Height = 20 Height = 20
Hint = 'select the root of phobos sources'
Top = 101 Top = 101
Width = 448 Width = 448
ShowHidden = False ShowHidden = False
@ -475,7 +481,7 @@ object Form1: TForm1
object selDefault: TComboBox object selDefault: TComboBox
Left = 2 Left = 2
Height = 30 Height = 30
Hint = 'select which compiler paths are used by the completion daemon' Hint = 'select which the compiler for which the library paths are used by the completion daemon'
Top = 2 Top = 2
Width = 448 Width = 448
Align = alClient Align = alClient

View File

@ -73,7 +73,7 @@ type
procedure assign(source: TPersistent); override; procedure assign(source: TPersistent); override;
end; end;
TForm1 = class(TForm, ICEEditableOptions, ICECompilerSelector, ICEProjectObserver) TCompilersPathsEditor = class(TForm, ICEEditableOptions, ICECompilerSelector, ICEProjectObserver)
selDefault: TComboBox; selDefault: TComboBox;
selDMDrt: TDirectoryEdit; selDMDrt: TDirectoryEdit;
selUSER2std: TDirectoryEdit; selUSER2std: TDirectoryEdit;
@ -156,13 +156,13 @@ uses
ce_libman; ce_libman;
var var
Form1: TForm1; CompilersPathsEditor: TCompilersPathsEditor;
const const
optFname = 'compilerspaths.txt'; optFname = 'compilerspaths.txt';
{$REGION Standard Object/Components things -------------------------------------} {$REGION Standard Object/Components things -------------------------------------}
constructor TForm1.create(aOwner: TComponent); constructor TCompilersPathsEditor.create(aOwner: TComponent);
var var
fname: string; fname: string;
begin begin
@ -208,7 +208,7 @@ begin
EntitiesConnector.addObserver(self); EntitiesConnector.addObserver(self);
end; end;
destructor TForm1.destroy; destructor TCompilersPathsEditor.destroy;
begin begin
fPaths.saveToFile(getCoeditDocPath + optFname); fPaths.saveToFile(getCoeditDocPath + optFname);
EntitiesConnector.removeObserver(self); EntitiesConnector.removeObserver(self);
@ -400,52 +400,52 @@ end;
{$ENDREGION} {$ENDREGION}
{$REGION ICEProjectObserver ----------------------------------------------------} {$REGION ICEProjectObserver ----------------------------------------------------}
procedure TForm1.projNew(project: ICECommonProject); procedure TCompilersPathsEditor.projNew(project: ICECommonProject);
begin begin
end; end;
procedure TForm1.projChanged(project: ICECommonProject); procedure TCompilersPathsEditor.projChanged(project: ICECommonProject);
begin begin
end; end;
procedure TForm1.projClosing(project: ICECommonProject); procedure TCompilersPathsEditor.projClosing(project: ICECommonProject);
begin begin
if fProj = project then if fProj = project then
fProj := nil; fProj := nil;
end; end;
procedure TForm1.projFocused(project: ICECommonProject); procedure TCompilersPathsEditor.projFocused(project: ICECommonProject);
begin begin
fProj := project; fProj := project;
end; end;
procedure TForm1.projCompiling(project: ICECommonProject); procedure TCompilersPathsEditor.projCompiling(project: ICECommonProject);
begin begin
end; end;
procedure TForm1.projCompiled(project: ICECommonProject; success: boolean); procedure TCompilersPathsEditor.projCompiled(project: ICECommonProject; success: boolean);
begin begin
end; end;
{$ENDREGION} {$ENDREGION}
{$REGION ICEEditableOptions ----------------------------------------------------} {$REGION ICEEditableOptions ----------------------------------------------------}
function TForm1.optionedWantCategory(): string; function TCompilersPathsEditor.optionedWantCategory(): string;
begin begin
exit('Compilers paths'); exit('Compilers paths');
end; end;
function TForm1.optionedWantEditorKind: TOptionEditorKind; function TCompilersPathsEditor.optionedWantEditorKind: TOptionEditorKind;
begin begin
exit(oekForm); exit(oekForm);
end; end;
function TForm1.optionedWantContainer: TPersistent; function TCompilersPathsEditor.optionedWantContainer: TPersistent;
begin begin
fPathsBackup.assign(fPaths); fPathsBackup.assign(fPaths);
exit(self); exit(self);
end; end;
procedure TForm1.optionedEvent(event: TOptionEditorEvent); procedure TCompilersPathsEditor.optionedEvent(event: TOptionEditorEvent);
begin begin
case event of case event of
oeeAccept: oeeAccept:
@ -477,19 +477,19 @@ begin
end; end;
end; end;
function TForm1.optionedOptionsModified: boolean; function TCompilersPathsEditor.optionedOptionsModified: boolean;
begin begin
exit(fPaths.modified); exit(fPaths.modified);
end; end;
{$ENDREGION} {$ENDREGION}
{$REGION ICECompilerSelector ---------------------------------------------------} {$REGION ICECompilerSelector ---------------------------------------------------}
function TForm1.singleServiceName: string; function TCompilersPathsEditor.singleServiceName: string;
begin begin
exit('ICECompilerSelector'); exit('ICECompilerSelector');
end; end;
function TForm1.isCompilerValid(value: DCompiler): boolean; function TCompilersPathsEditor.isCompilerValid(value: DCompiler): boolean;
begin begin
result := false; result := false;
with fPaths do case value of with fPaths do case value of
@ -503,7 +503,7 @@ begin
end; end;
end; end;
function TForm1.getCompilerPath(value: DCompiler): string; function TCompilersPathsEditor.getCompilerPath(value: DCompiler): string;
begin begin
result := ''; result := '';
with fPaths do case value of with fPaths do case value of
@ -517,7 +517,7 @@ begin
end; end;
end; end;
procedure TForm1.getCompilerImports(value: DCompiler; paths: TStrings); procedure TCompilersPathsEditor.getCompilerImports(value: DCompiler; paths: TStrings);
procedure tryAdd(const pth: string); procedure tryAdd(const pth: string);
begin begin
if pth.isNotEmpty then if pth.isNotEmpty then
@ -539,7 +539,7 @@ end;
{$ENDREGION} {$ENDREGION}
{$REGION Compilers paths things ------------------------------------------------} {$REGION Compilers paths things ------------------------------------------------}
procedure TForm1.updateDCD; procedure TCompilersPathsEditor.updateDCD;
var var
imprt: TStringList; imprt: TStringList;
begin begin
@ -552,7 +552,7 @@ begin
end; end;
end; end;
procedure TForm1.dataToGui; procedure TCompilersPathsEditor.dataToGui;
begin begin
with fPaths do with fPaths do
begin begin
@ -580,7 +580,7 @@ begin
end; end;
end; end;
procedure TForm1.dialogOpen(sender: TObject); procedure TCompilersPathsEditor.dialogOpen(sender: TObject);
var var
fne: TFileNameEdit; fne: TFileNameEdit;
dre: TDirectoryEdit; dre: TDirectoryEdit;
@ -600,7 +600,7 @@ begin
end; end;
end; end;
procedure TForm1.selectedExe(sender: TObject; var value: string); procedure TCompilersPathsEditor.selectedExe(sender: TObject; var value: string);
var var
ctrl: TWinControl; ctrl: TWinControl;
begin begin
@ -617,7 +617,7 @@ begin
fPaths.User2ExeName:=value; fPaths.User2ExeName:=value;
end; end;
procedure TForm1.selectedRt(sender: TObject; var value: string); procedure TCompilersPathsEditor.selectedRt(sender: TObject; var value: string);
var var
ctrl: TWinControl; ctrl: TWinControl;
begin begin
@ -634,7 +634,7 @@ begin
fPaths.User2RuntimePath:=value; fPaths.User2RuntimePath:=value;
end; end;
procedure TForm1.selectedStd(sender: TObject; var value: string); procedure TCompilersPathsEditor.selectedStd(sender: TObject; var value: string);
var var
ctrl: TWinControl; ctrl: TWinControl;
begin begin
@ -651,12 +651,12 @@ begin
fPaths.User2PhobosPath:=value; fPaths.User2PhobosPath:=value;
end; end;
procedure TForm1.selectedDefault(sender: TObject); procedure TCompilersPathsEditor.selectedDefault(sender: TObject);
begin begin
fPaths.defaultCompiler:= DCompiler(selDefault.ItemIndex); fPaths.defaultCompiler:= DCompiler(selDefault.ItemIndex);
end; end;
procedure TForm1.autoDetectDMD; procedure TCompilersPathsEditor.autoDetectDMD;
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
var var
path: string; path: string;
@ -692,20 +692,20 @@ begin
{$ENDIF} {$ENDIF}
end; end;
procedure TForm1.autoDetectGDC; procedure TCompilersPathsEditor.autoDetectGDC;
begin begin
//TODO-cCompilerPaths: detect GDC //TODO-cCompilerPaths: detect GDC
end; end;
procedure TForm1.autoDetectLDC; procedure TCompilersPathsEditor.autoDetectLDC;
begin begin
//TODO-cCompilerPaths: detect LDC //TODO-cCompilerPaths: detect LDC
end; end;
{$ENDREGION} {$ENDREGION}
initialization initialization
Form1 := TForm1.create(nil); CompilersPathsEditor := TCompilersPathsEditor.create(nil);
finalization finalization
Form1.free; CompilersPathsEditor.free;
end. end.