summaryrefslogtreecommitdiff
path: root/docview/src/frm_main.pas
diff options
context:
space:
mode:
Diffstat (limited to 'docview/src/frm_main.pas')
-rw-r--r--docview/src/frm_main.pas16
1 files changed, 16 insertions, 0 deletions
diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas
index 814556ef..ae89331b 100644
--- a/docview/src/frm_main.pas
+++ b/docview/src/frm_main.pas
@@ -337,6 +337,8 @@ begin
end;
procedure TMainForm.MainFormShow(Sender: TObject);
+var
+ lFilename: TfpgString;
begin
bvlBody.Realign;
@@ -355,6 +357,20 @@ begin
ProcessCommandLineParams;
RichView.Images := FImages;
+
+ if ParamCount = 0 then
+ begin
+ // user hasn't requested any particular file
+ // at startup, so if the option is still set,
+ // load the DocView help file
+ if Settings.StartupHelp then
+ begin
+ lFilename := GetOwnHelpFileName;
+ if FileExists(lFilename) then
+ OpenFile(lFilename, '', true);
+ end;
+ end;
+
end;
procedure TMainForm.MainFormDestroy(Sender: TObject);