From 4fc39a931e97e5900511c61aa341eb8ab5728da4 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Mon, 29 Feb 2016 12:40:44 +0100 Subject: [PATCH] added additional search PATHs in the options, close #19 --- src/ce_common.pas | 9 +++++++++ src/ce_main.pas | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/ce_common.pas b/src/ce_common.pas index 7b258315..9a6f109e 100644 --- a/src/ce_common.pas +++ b/src/ce_common.pas @@ -260,9 +260,16 @@ type *) procedure deleteDups(str: TStrings); +var + // supplementatl directories to find background tools + additionalPath: string; + implementation +uses + ce_main; + procedure TCEPersistentShortcut.assign(aValue: TPersistent); var src: TCEPersistentShortcut; @@ -790,6 +797,8 @@ begin // maybe in current dir if anExeName.fileExists then env += PathSeparator + GetCurrentDir; + if additionalPath.isNotEmpty then + env += PathSeparator + additionalPath; {$IFNDEF CEBUILD} if Application <> nil then env += PathSeparator + ExtractFileDir(application.ExeName.ExtractFilePath); diff --git a/src/ce_main.pas b/src/ce_main.pas index a70cf743..22cddcaa 100644 --- a/src/ce_main.pas +++ b/src/ce_main.pas @@ -8,7 +8,7 @@ uses Classes, SysUtils, LazFileUtils, SynEditKeyCmds, SynHighlighterLFM, Forms, StdCtrls, AnchorDocking, AnchorDockStorage, AnchorDockOptionsDlg, Controls, Graphics, strutils, Dialogs, Menus, ActnList, ExtCtrls, process, XMLPropStorage, SynExportHTML, - ce_common, ce_dmdwrap, ce_nativeproject, ce_dcd, ce_synmemo, ce_writableComponent, + ce_common, ce_dmdwrap, ce_nativeproject, ce_synmemo, ce_writableComponent, ce_widget, ce_messages, ce_interfaces, ce_editor, ce_projinspect, ce_projconf, ce_search, ce_miniexplorer, ce_libman, ce_libmaneditor, ce_todolist, ce_observer, ce_toolseditor, ce_procinput, ce_optionseditor, ce_symlist, ce_mru, ce_processes, @@ -384,11 +384,14 @@ type fMaxRecentProjs: integer; fMaxRecentDocs: integer; fDcdPort: word; + function getAdditionalPATH: string; + procedure setAdditionalPATH(const value: string); function getDubCompiler: TCECompiler; function getNativeProjecCompiler: TCECompiler; procedure setDubCompiler(value: TCECompiler); procedure setNativeProjecCompiler(value: TCECompiler); published + property additionalPATH: string read getAdditionalPATH write setAdditionalPath; property coverModuleTests: boolean read fCovModUt write fCovModUt; property floatingWidgetOnTop: boolean read fFloatingWidgetOnTop write fFloatingWidgetOnTop; property reloadLastDocuments: boolean read fReloadLastDocuments write fReloadLastDocuments; @@ -424,7 +427,7 @@ implementation {$R *.lfm} uses - SynMacroRecorder, ce_symstring; + SynMacroRecorder, ce_symstring, ce_dcd; {$REGION TCEApplicationOptions ------------------------------------------------------} constructor TCEApplicationOptions.Create(AOwner: TComponent); @@ -461,6 +464,31 @@ begin ce_nativeproject.setNativeProjectCompiler(value); end; +function TCEApplicationOptionsBase.getAdditionalPATH: string; +begin + exit(ce_common.additionalPath); +end; + +procedure TCEApplicationOptionsBase.setAdditionalPath(const value: string); +var + str: TStringList; + cat: string; + i: integer; +begin + str := TStringList.Create; + try + str.Delimiter:= PathSeparator; + str.DelimitedText:= value; + for i := str.Count-1 downto 0 do + if not str[i].dirExists then + str.Delete(i); + cat := str.DelimitedText; + ce_common.additionalPath := cat; + finally + str.Free; + end; +end; + destructor TCEApplicationOptions.Destroy; begin EntitiesConnector.removeObserver(self);