mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 18:40:29 +02:00
* Lhelp: cosmetic/debug output naming
git-svn-id: trunk@46285 -
This commit is contained in:
parent
fe92b2272b
commit
9bd102dcdf
@ -76,7 +76,8 @@ type
|
|||||||
function ServerRunning: Boolean;
|
function ServerRunning: Boolean;
|
||||||
// Starts remote server (help viewer); if Hide specified, asks the help server to hide itself/run minimized while starting
|
// Starts remote server (help viewer); if Hide specified, asks the help server to hide itself/run minimized while starting
|
||||||
// Server must support a switch --ipcname that accepts the NameForServer argument to identify it for SimpleIPC
|
// Server must support a switch --ipcname that accepts the NameForServer argument to identify it for SimpleIPC
|
||||||
function StartHelpServer(NameForServer: String; ServerEXE: String = '';Hide: boolean=false): Boolean;
|
function StartHelpServer(NameForServer: String;
|
||||||
|
ServerEXE: String = ''; Hide: boolean=false): Boolean;
|
||||||
// Shows URL in the HelpFileName file by sending a TUrlRequest
|
// Shows URL in the HelpFileName file by sending a TUrlRequest
|
||||||
function OpenURL(HelpFileName: String; Url: String): TLHelpResponse;
|
function OpenURL(HelpFileName: String; Url: String): TLHelpResponse;
|
||||||
// Shows help for Context in the HelpFileName file by sending a TContextRequest request
|
// Shows help for Context in the HelpFileName file by sending a TContextRequest request
|
||||||
@ -85,6 +86,7 @@ type
|
|||||||
function OpenFile(HelpFileName: String): TLHelpResponse;
|
function OpenFile(HelpFileName: String): TLHelpResponse;
|
||||||
// Requests to run command on viewer by sending a TMiscrequest
|
// Requests to run command on viewer by sending a TMiscrequest
|
||||||
function RunMiscCommand(CommandID: TMiscRequests): TLHelpResponse;
|
function RunMiscCommand(CommandID: TMiscRequests): TLHelpResponse;
|
||||||
|
// Calling code can set this to process e.g. GUI handling while waiting for help to show
|
||||||
property ProcessWhileWaiting: TProcedureOfObject read FProcessWhileWaiting write FProcessWhileWaiting;
|
property ProcessWhileWaiting: TProcedureOfObject read FProcessWhileWaiting write FProcessWhileWaiting;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -104,7 +106,6 @@ const
|
|||||||
// typical user so it then isn't fit for purpose.
|
// typical user so it then isn't fit for purpose.
|
||||||
TimeoutSecs=10;
|
TimeoutSecs=10;
|
||||||
var
|
var
|
||||||
Iterations: integer;
|
|
||||||
Stream: TStream;
|
Stream: TStream;
|
||||||
StartTime: TDateTime;
|
StartTime: TDateTime;
|
||||||
TimeOut: TDateTime;
|
TimeOut: TDateTime;
|
||||||
@ -114,7 +115,6 @@ begin
|
|||||||
StartTime := Now;
|
StartTime := Now;
|
||||||
while (Now-StartTime)<TimeOut do
|
while (Now-StartTime)<TimeOut do
|
||||||
begin
|
begin
|
||||||
Inc(Iterations);
|
|
||||||
if fServerIn.PeekMessage(50, True) then
|
if fServerIn.PeekMessage(50, True) then
|
||||||
begin
|
begin
|
||||||
Stream := fServerIn.MsgData;
|
Stream := fServerIn.MsgData;
|
||||||
@ -124,7 +124,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
if Assigned(FProcessWhileWaiting) then FProcessWhileWaiting();
|
if Assigned(FProcessWhileWaiting) then FProcessWhileWaiting();
|
||||||
end;
|
end;
|
||||||
debugln('LHelpControl: WaitForMsgResponse: hit timeout ('+inttostr(TimeoutSecs)+')');
|
debugln('LHelpControl: WaitForMsgResponse: hit timeout ('+inttostr(TimeoutSecs)+' seconds)');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLHelpConnection.SendMessage(Stream: TStream): TLHelpResponse;
|
function TLHelpConnection.SendMessage(Stream: TStream): TLHelpResponse;
|
||||||
@ -220,13 +220,12 @@ begin
|
|||||||
// to put lhelp into the foreground, use "open -n"
|
// to put lhelp into the foreground, use "open -n"
|
||||||
Cmd:='/usr/bin/open -n '+ServerEXE+' --args --ipcname ' + NameForServer
|
Cmd:='/usr/bin/open -n '+ServerEXE+' --args --ipcname ' + NameForServer
|
||||||
end;
|
end;
|
||||||
DebugLn(['TLHelpConnection.StartHelpServer ',cmd]);
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
with TProcessUTF8.Create(nil) do begin
|
with TProcessUTF8.Create(nil) do begin
|
||||||
InheritHandles := false;
|
InheritHandles := false;
|
||||||
ShowWindow:=swoShowNormal;
|
ShowWindow:=swoShowNormal;
|
||||||
CommandLine := Cmd;
|
CommandLine := Cmd;
|
||||||
debugln('LHelpControl: going to start help server by executing '+Cmd);
|
debugln('TLHelpConnection.StartHelpServer: going to start help server by executing '+Cmd);
|
||||||
Execute;
|
Execute;
|
||||||
Free;
|
Free;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user