mirror of https://gitlab.com/basile.b/dexed.git
dcd, port num can be set in the option editor
This commit is contained in:
parent
5f8cb1a679
commit
0c4510cad4
|
|
@ -12,6 +12,8 @@ uses
|
||||||
ce_common, ce_writableComponent, ce_interfaces, ce_observer, ce_synmemo;
|
ce_common, ce_writableComponent, ce_interfaces, ce_observer, ce_synmemo;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
|
||||||
(**
|
(**
|
||||||
* Wrap the dcd-server and dcd-client processes.
|
* Wrap the dcd-server and dcd-client processes.
|
||||||
*
|
*
|
||||||
|
|
@ -24,7 +26,7 @@ type
|
||||||
fTempLines: TStringList;
|
fTempLines: TStringList;
|
||||||
fInputSource: string;
|
fInputSource: string;
|
||||||
fImportCache: TStringList;
|
fImportCache: TStringList;
|
||||||
//fPortNum: Word;
|
fPortNum: Word;
|
||||||
fServerWasRunning: boolean;
|
fServerWasRunning: boolean;
|
||||||
fClient, fServer: TProcess;
|
fClient, fServer: TProcess;
|
||||||
fAvailable: boolean;
|
fAvailable: boolean;
|
||||||
|
|
@ -48,6 +50,8 @@ type
|
||||||
procedure docFocused(aDoc: TCESynMemo);
|
procedure docFocused(aDoc: TCESynMemo);
|
||||||
procedure docChanged(aDoc: TCESynMemo);
|
procedure docChanged(aDoc: TCESynMemo);
|
||||||
procedure docClosing(aDoc: TCESynMemo);
|
procedure docClosing(aDoc: TCESynMemo);
|
||||||
|
published
|
||||||
|
property port: word read fPortNum write fPortNum default 0;
|
||||||
public
|
public
|
||||||
constructor create(aOwner: TComponent); override;
|
constructor create(aOwner: TComponent); override;
|
||||||
destructor destroy; override;
|
destructor destroy; override;
|
||||||
|
|
@ -70,12 +74,19 @@ implementation
|
||||||
const
|
const
|
||||||
clientName = 'dcd-client' + exeExt;
|
clientName = 'dcd-client' + exeExt;
|
||||||
serverName = 'dcd-server' + exeExt;
|
serverName = 'dcd-server' + exeExt;
|
||||||
|
optsname = 'dcdoptions.txt';
|
||||||
|
|
||||||
{$REGION Standard Comp/Obj------------------------------------------------------}
|
{$REGION Standard Comp/Obj------------------------------------------------------}
|
||||||
constructor TCEDcdWrapper.create(aOwner: TComponent);
|
constructor TCEDcdWrapper.create(aOwner: TComponent);
|
||||||
|
var
|
||||||
|
fname: string;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
//
|
//
|
||||||
|
fname := getCoeditDocPath + optsname;
|
||||||
|
if fname.fileExists then
|
||||||
|
loadFromFile(fname);
|
||||||
|
//
|
||||||
fAvailable := exeInSysPath(clientName) and exeInSysPath(serverName);
|
fAvailable := exeInSysPath(clientName) and exeInSysPath(serverName);
|
||||||
if not fAvailable then
|
if not fAvailable then
|
||||||
exit;
|
exit;
|
||||||
|
|
@ -93,6 +104,8 @@ begin
|
||||||
{$IFNDEF DEBUG}
|
{$IFNDEF DEBUG}
|
||||||
fServer.ShowWindow := swoHIDE;
|
fServer.ShowWindow := swoHIDE;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
if fPortNum <> 0 then
|
||||||
|
fServer.Parameters.Add('-p' + intToStr(port));
|
||||||
end;
|
end;
|
||||||
fTempLines := TStringList.Create;
|
fTempLines := TStringList.Create;
|
||||||
fImportCache := TStringList.Create;
|
fImportCache := TStringList.Create;
|
||||||
|
|
@ -111,6 +124,7 @@ end;
|
||||||
|
|
||||||
destructor TCEDcdWrapper.destroy;
|
destructor TCEDcdWrapper.destroy;
|
||||||
begin
|
begin
|
||||||
|
saveToFile(getCoeditDocPath + optsname);
|
||||||
EntitiesConnector.removeObserver(self);
|
EntitiesConnector.removeObserver(self);
|
||||||
fImportCache.Free;
|
fImportCache.Free;
|
||||||
if fTempLines.isNotNil then
|
if fTempLines.isNotNil then
|
||||||
|
|
|
||||||
|
|
@ -379,11 +379,13 @@ type
|
||||||
fReloadLastDocuments: boolean;
|
fReloadLastDocuments: boolean;
|
||||||
fMaxRecentProjs: integer;
|
fMaxRecentProjs: integer;
|
||||||
fMaxRecentDocs: integer;
|
fMaxRecentDocs: integer;
|
||||||
|
fDcdPort: word;
|
||||||
function getDubCompiler: TCECompiler;
|
function getDubCompiler: TCECompiler;
|
||||||
function getNativeProjecCompiler: TCECompiler;
|
function getNativeProjecCompiler: TCECompiler;
|
||||||
procedure setDubCompiler(value: TCECompiler);
|
procedure setDubCompiler(value: TCECompiler);
|
||||||
procedure setNativeProjecCompiler(value: TCECompiler);
|
procedure setNativeProjecCompiler(value: TCECompiler);
|
||||||
published
|
published
|
||||||
|
property dcdPort: word read fDcdPort write fDcdPort;
|
||||||
property floatingWidgetOnTop: boolean read fFloatingWidgetOnTop write fFloatingWidgetOnTop;
|
property floatingWidgetOnTop: boolean read fFloatingWidgetOnTop write fFloatingWidgetOnTop;
|
||||||
property reloadLastDocuments: boolean read fReloadLastDocuments write fReloadLastDocuments;
|
property reloadLastDocuments: boolean read fReloadLastDocuments write fReloadLastDocuments;
|
||||||
property maxRecentProjects: integer read fMaxRecentProjs write fMaxRecentProjs;
|
property maxRecentProjects: integer read fMaxRecentProjs write fMaxRecentProjs;
|
||||||
|
|
@ -464,8 +466,10 @@ begin
|
||||||
begin
|
begin
|
||||||
fMaxRecentProjs:= CEMainForm.fProjMru.maxCount;
|
fMaxRecentProjs:= CEMainForm.fProjMru.maxCount;
|
||||||
fMaxRecentDocs:= CEMainForm.fFileMru.maxCount;
|
fMaxRecentDocs:= CEMainForm.fFileMru.maxCount;
|
||||||
|
fDcdPort := DcdWrapper.port;
|
||||||
end else if src = fBackup then
|
end else if src = fBackup then
|
||||||
begin
|
begin
|
||||||
|
fDcdPort:=fBackup.fDcdPort;
|
||||||
fMaxRecentDocs:= fBackup.fMaxRecentDocs;
|
fMaxRecentDocs:= fBackup.fMaxRecentDocs;
|
||||||
fMaxRecentProjs:= fBackup.fMaxRecentProjs;
|
fMaxRecentProjs:= fBackup.fMaxRecentProjs;
|
||||||
fReloadLastDocuments:=fBackup.fReloadLastDocuments;
|
fReloadLastDocuments:=fBackup.fReloadLastDocuments;
|
||||||
|
|
@ -481,12 +485,14 @@ begin
|
||||||
CEMainForm.fProjMru.maxCount := fMaxRecentProjs;
|
CEMainForm.fProjMru.maxCount := fMaxRecentProjs;
|
||||||
CEMainForm.fFileMru.maxCount := fMaxRecentDocs;
|
CEMainForm.fFileMru.maxCount := fMaxRecentDocs;
|
||||||
CEMainForm.updateFloatingWidgetOnTop(fFloatingWidgetOnTop);
|
CEMainForm.updateFloatingWidgetOnTop(fFloatingWidgetOnTop);
|
||||||
|
DcdWrapper.port:=fDcdPort;
|
||||||
end else if dst = fBackup then
|
end else if dst = fBackup then
|
||||||
begin
|
begin
|
||||||
fBackup.fMaxRecentDocs:= fMaxRecentDocs;
|
fBackup.fMaxRecentDocs:= fMaxRecentDocs;
|
||||||
fBackup.fMaxRecentProjs:= fMaxRecentProjs;
|
fBackup.fMaxRecentProjs:= fMaxRecentProjs;
|
||||||
fBackup.fReloadLastDocuments:=fReloadLastDocuments;
|
fBackup.fReloadLastDocuments:=fReloadLastDocuments;
|
||||||
fBackup.fFloatingWidgetOnTop:=fFloatingWidgetOnTop;
|
fBackup.fFloatingWidgetOnTop:=fFloatingWidgetOnTop;
|
||||||
|
fBackup.fDcdPort:=fDcdPort;
|
||||||
end
|
end
|
||||||
else inherited;
|
else inherited;
|
||||||
end;
|
end;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue