Index: CHANGES.txt ================================================================== --- CHANGES.txt +++ CHANGES.txt @@ -1,5 +1,13 @@ +Version 0.13.1 +2024-01-29 + +[Improved] Finding groff happens in a thread now. No more blocking on startup. +[Removed] So we got rid of the loading window again. + +------------------------------- + Version 0.13.0 2024-01-11 [Feature] Support for hdtbl. [Changed] Build extras and build preprocessors are now listed in a multi-select box. Index: README.md ================================================================== --- README.md +++ README.md @@ -7,11 +7,12 @@ ![Screenshot](https://i.imgur.com/GNu2M6n.png) ## Features * Written in Lazarus (Free Pascal). - * Should be cross-platform (but Windows support is mediocre yet). + * Should be cross-platform. + * Successfully tested on Windows 10, macOS and Linux. * Can produce PS and PDF files. * Can handle some macros. ## License @@ -34,6 +35,7 @@ ## Contact * IRC: [libera.chat: #groffstudio](irc://irc.libera.chat/groffstudio) * Twitter: [@tux0r](https://twitter.com/tux0r) +* Mastodon: [@tux0r@layer8.space](https://layer8.space/@tux0r) * Matrix: @tux0r:matrix.org Index: src/groffstudio.lpi ================================================================== --- src/groffstudio.lpi +++ src/groffstudio.lpi @@ -21,12 +21,12 @@ - - + + @@ -77,18 +77,10 @@ - - - - - - - - Index: src/groffstudio.lpr ================================================================== --- src/groffstudio.lpr +++ src/groffstudio.lpr @@ -23,29 +23,19 @@ {$ENDIF} {$IFDEF HASAMIGA} athreads, {$ENDIF} Interfaces, - Forms, lazcontrols, Unit1, Helpers, BuildOutputWindow, Splashscreen; + Forms, lazcontrols, Unit1, Helpers, BuildOutputWindow; {$R *.res} -var - Splash: TSplashscreenWindow; - begin RequireDerivedFormResource:=True; Application.Scaled:=True; Application.Initialize; - { Load the loading screen } - Splash := TSplashscreenWindow.Create(Application); - Splash.Show; - Splash.Update; - Application.ProcessMessages; - Application.CreateForm(TMainForm, MainForm); - - Splash.Close; + Application.Run; end. DELETED src/splashscreen.lfm Index: src/splashscreen.lfm ================================================================== --- src/splashscreen.lfm +++ /dev/null @@ -1,20 +0,0 @@ -object SplashscreenWindow: TSplashscreenWindow - Left = 493 - Height = 80 - Top = 160 - Width = 168 - BorderStyle = bsNone - Caption = 'preparing' - ClientHeight = 80 - ClientWidth = 168 - FormStyle = fsSplash - object Label1: TLabel - Left = 16 - Height = 37 - Top = 16 - Width = 141 - Caption = 'preparing ...' - Font.Height = -27 - ParentFont = False - end -end DELETED src/splashscreen.pas Index: src/splashscreen.pas ================================================================== --- src/splashscreen.pas +++ /dev/null @@ -1,42 +0,0 @@ -unit Splashscreen; - -{ - The contents of this file are subject to the terms of the - Common Development and Distribution License, Version 1.1 only - (the "License"). You may not use this file except in compliance - with the License. - - See the file LICENSE in this distribution for details. - A copy of the CDDL is also available via the Internet at - https://spdx.org/licenses/CDDL-1.1.html - - When distributing Covered Code, include this CDDL HEADER in each - file and include the contents of the LICENSE file from this - distribution. -} - -{$mode ObjFPC}{$H+} - -interface - -uses - Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls; - -type - - { TSplashscreenWindow } - - TSplashscreenWindow = class(TForm) - Label1: TLabel; - private - - public - - end; - -implementation - -{$R *.lfm} - -end. - Index: src/unit1.lfm ================================================================== --- src/unit1.lfm +++ src/unit1.lfm @@ -6,10 +6,11 @@ Caption = 'groffstudio' ClientHeight = 692 ClientWidth = 847 DefaultMonitor = dmPrimary Position = poScreenCenter + LCLVersion = '3.99.0.0' OnClose = FormClose OnCreate = FormCreate object MainStatusBar: TStatusBar Left = 0 Height = 23 Index: src/unit1.pas ================================================================== --- src/unit1.pas +++ src/unit1.pas @@ -100,11 +100,10 @@ procedure GetSocketHandler(Sender: TObject; const UseSSL: Boolean; out AHandler: TSocketHandler); {$ENDIF} private var currentGroffFilePath: String; var currentGroffFileName: String; - var hasGroff: Boolean; var unsavedChanges: Boolean; {$IFDEF WINDOWS} var latestGroffWindowsUrl: String; {$ENDIF} var storeBuildSettings: Boolean; @@ -111,23 +110,52 @@ var updateCheck: Boolean; public end; + TDetectGroffThread = class(TThread) + procedure Execute; Override; + end; + var MainForm: TMainForm; BuildWindow: TBuildStatusWindow; + hasGroff: Boolean; implementation {$R *.lfm} + +procedure TDetectGroffThread.Execute; +var + GroffOutputVersion: String; +begin + FreeOnTerminate := True; + + {$IFDEF WINDOWS} + if RunCommand('cmd', ['/c', 'troff --version'], GroffOutputVersion, [], swoHIDE) then + {$ELSE} + if RunCommand('/bin/sh', ['-c', 'troff --version'], GroffOutputVersion, [], swoHIDE) then + {$ENDIF} + begin + MainForm.edtGroffInstalledVersion.Text := GroffOutputVersion; + if pos('GNU', GroffOutputVersion) = 0 then + ShowMessage('groffstudio thinks that your installed version of troff is not GNU troff.' + LineEnding + + 'If this is correct, you are advised to fix this before continuing.' + LineEnding + + 'If it is an error, please tell me so I can improve this detection.'); + hasGroff := True; + end else begin + MainForm.edtGroffInstalledVersion.Text := 'n/a'; + hasGroff := False; + MainForm.lblTroffCommandNotFound.Visible := True; + end; +end; { TMainForm } procedure TMainForm.FormCreate(Sender: TObject); var - GroffOutputVersion: String; OnlineVersionsFile: String; {$IFDEF WINDOWS} reGroffVersion: TRegExpr; {$ENDIF} reGroffStudioVersion: TRegExpr; @@ -138,27 +166,11 @@ {$IFDEF DARWIN} HTTPClient: TFPHttpClient; {$ENDIF} begin // What's the current running groff version? - {$IFDEF WINDOWS} - if RunCommand('cmd', ['/c', 'troff --version'], GroffOutputVersion, [], swoHIDE) then - {$ELSE} - if RunCommand('/bin/sh', ['-c', 'troff --version'], GroffOutputVersion, [], swoHIDE) then - {$ENDIF} - begin - edtGroffInstalledVersion.Text := GroffOutputVersion; - if pos('GNU', GroffOutputVersion) = 0 then - ShowMessage('groffstudio thinks that your installed version of troff is not GNU troff.' + LineEnding + - 'If this is correct, you are advised to fix this before continuing.' + LineEnding + - 'If it is an error, please tell me so I can improve this detection.'); - hasGroff := True; - end else begin - edtGroffInstalledVersion.Text := 'n/a'; - hasGroff := False; - lblTroffCommandNotFound.Visible := True; - end; + TDetectGroffThread.Create(False); // Default file name currentGroffFileName := '[unsaved file]'; // Embed the license