summaryrefslogtreecommitdiff
path: root/docview/src/frm_main.pas
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-24 13:27:37 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-24 13:27:37 +0200
commitf15c953b8b5abec13a7b615f5705ad406dbbdace (patch)
treeeba92540b4d13e89c6e6795d498e0153caca7272 /docview/src/frm_main.pas
parent4db3daa455aa2832fe7d78347b5e18456f45ee84 (diff)
downloadfpGUI-f15c953b8b5abec13a7b615f5705ad406dbbdace.tar.xz
docview: new configuration option: open docview help on startup.
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);