summaryrefslogtreecommitdiff
path: root/src/corelib/x11/fpg_x11.pas
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-04-03 14:51:47 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2013-04-04 23:00:56 +0100
commit590c0c64dab7ccef65eb449d8cb80f3baf58beb6 (patch)
tree6d30aa37de4719f71f02706fe69eb7723253b32c /src/corelib/x11/fpg_x11.pas
parentde7e463e6210c28b56ba853ec2c2fdfd404a7a1f (diff)
downloadfpGUI-590c0c64dab7ccef65eb449d8cb80f3baf58beb6.tar.xz
launching help viewer
Under *nix systems, if we can't find the direct location of docview, we try the 'which docview' command. If we get a positive response, we know docview is in the system path, and we can go ahead and launch it. At least this doesn't instantly throw an exception when docview can't be found on the first attempt.
Diffstat (limited to 'src/corelib/x11/fpg_x11.pas')
-rw-r--r--src/corelib/x11/fpg_x11.pas13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index 20974dfe..37b2b469 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -322,6 +322,7 @@ type
function DoGetFontFaceList: TStringList; override;
procedure DoWaitWindowMessage(atimeoutms: integer); override;
function MessagesPending: boolean; override;
+ function GetHelpViewer: TfpgString; override;
public
constructor Create(const AParams: string); override;
destructor Destroy; override;
@@ -420,6 +421,7 @@ implementation
uses
baseunix,
+ unix,
{$IFDEF LINUX}
users, { For Linux user and group name support. FPC only supports this in Linux. }
{$ENDIF}
@@ -430,6 +432,7 @@ uses
fpg_utils,
fpg_form, // for modal event support
fpg_cmdlineparams,
+ fpg_constants,
cursorfont,
xatom, // used for XA_WM_NAME
keysym,
@@ -1433,6 +1436,16 @@ begin
fpgCheckTimers;
end;
+function TfpgX11Application.GetHelpViewer: TfpgString;
+begin
+ Result := inherited GetHelpViewer;
+ if not fpgFileExists(Result) then
+ begin
+ if fpsystem('which ' + FPG_HELPVIEWER) = 0 then
+ Result := FPG_HELPVIEWER;
+ end;
+end;
+
function GetParentWindow(wh: TfpgWinHandle; var pw, rw: TfpgWinHandle): boolean;
var
rootw: TfpgWinHandle;