groffstudio

Check-in [8500e1c380]
Login
Overview
Comment:[Bugfix] cmbMacro was checked badly
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8500e1c380ac525a7ad14e411a509c4ec7f99a172508eef576c54d0e77fe1487
User & Date: Cthulhux on 2024-01-10 10:43:08
Other Links: manifest | tags
Context
2024-01-10
11:09
[Bugfix] BuildDocument did not return success on success. [Improved] BuildDocument uses a simpler execution approach now. check-in: a0a5ea5104 user: Cthulhux tags: trunk
10:43
[Bugfix] cmbMacro was checked badly check-in: 8500e1c380 user: Cthulhux tags: trunk
04:00
tests check-in: 947b4bfbd2 user: Cthulhux tags: trunk
Changes

Modified src/buildoutputwindow.lfm from [30a0891c83] to [a8b1bb1460].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
object BuildStatusWindow: TBuildStatusWindow
  Left = 493
  Height = 80
  Top = 160
  Width = 168
  BorderStyle = bsDialog
  Caption = 'building'
  ClientHeight = 80
  ClientWidth = 168
  LCLVersion = '2.3.0.0'
  object Label1: TLabel
    Left = 32
    Height = 37
    Top = 16
    Width = 117
    Caption = 'building...'
    Font.Height = -27
    ParentColor = False
    ParentFont = False
  end
end









|











1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
object BuildStatusWindow: TBuildStatusWindow
  Left = 493
  Height = 80
  Top = 160
  Width = 168
  BorderStyle = bsDialog
  Caption = 'building'
  ClientHeight = 80
  ClientWidth = 168
  LCLVersion = '3.99.0.0'
  object Label1: TLabel
    Left = 32
    Height = 37
    Top = 16
    Width = 117
    Caption = 'building...'
    Font.Height = -27
    ParentColor = False
    ParentFont = False
  end
end

Modified src/buildoutputwindow.pas from [3ba7102513] to [e7a21d0ab7].

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
}

{$mode ObjFPC}{$H+}

interface

uses
  Classes, SysUtils, Forms, StdCtrls, Process;

type

  { TBuildStatusWindow }

  TBuildStatusWindow = class(TForm)
    Label1: TLabel;







|







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
}

{$mode ObjFPC}{$H+}

interface

uses
  Classes, SysUtils, Forms, StdCtrls, Process, Dialogs;

type

  { TBuildStatusWindow }

  TBuildStatusWindow = class(TForm)
    Label1: TLabel;
47
48
49
50
51
52
53



54
55
56
57
58
59
60
61
62
63
64
65
66
67
  p: TProcess;
  n, total: LongInt;
  str: String;
  lh: TextFile;
begin
  p := TProcess.Create(nil);
  p.Options := p.Options + [poUsePipes, poStderrToOutPut];




{$IFDEF WINDOWS}
  p.Executable := 'cmd';
  p.Parameters.Add('/c');
{$ENDIF}
{$IFDEF UNIX}
  p.Executable := 'sh';
  p.Parameters.Add('-c');
{$ENDIF}
  p.Parameters.Add(CommandLine);
  p.Execute;

  if LogFile <> '' then
  begin







>
>
>




|
<
|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

62
63
64
65
66
67
68
69
  p: TProcess;
  n, total: LongInt;
  str: String;
  lh: TextFile;
begin
  p := TProcess.Create(nil);
  p.Options := p.Options + [poUsePipes, poStderrToOutPut];
  p.ShowWindow := swoHIDE;

  ShowMessage(CommandLine);

{$IFDEF WINDOWS}
  p.Executable := 'cmd';
  p.Parameters.Add('/c');
{$ELSE}

  p.Executable := '/bin/sh';
  p.Parameters.Add('-c');
{$ENDIF}
  p.Parameters.Add(CommandLine);
  p.Execute;

  if LogFile <> '' then
  begin

Modified src/unit1.lfm from [a3062d8c1e] to [7ef26e9b5c].

1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
17
18
19
object MainForm: TMainForm
  Left = 1073
  Height = 692
  Top = 99
  Width = 847
  Caption = 'groffstudio'
  ClientHeight = 692
  ClientWidth = 847
  DefaultMonitor = dmPrimary

  OnClose = FormClose
  OnCreate = FormCreate
  LCLVersion = '3.1.0.0'
  object MainStatusBar: TStatusBar
    Left = 0
    Height = 18
    Top = 674
    Width = 847
    Panels = <    
      item









>


<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
object MainForm: TMainForm
  Left = 1073
  Height = 692
  Top = 99
  Width = 847
  Caption = 'groffstudio'
  ClientHeight = 692
  ClientWidth = 847
  DefaultMonitor = dmPrimary
  LCLVersion = '3.99.0.0'
  OnClose = FormClose
  OnCreate = FormCreate

  object MainStatusBar: TStatusBar
    Left = 0
    Height = 18
    Top = 674
    Width = 847
    Panels = <    
      item

Modified src/unit1.pas from [0fcf2493e9] to [5cfb67d430].

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
  ResStream: TResourceStream;
  {$IFDEF DARWIN}
  HTTPClient: TFPHttpClient;
  {$ENDIF}
begin
  // What's the current running groff version?
  {$IFDEF WINDOWS}
  if RunCommand('cmd', ['/c', 'troff --version'], GroffOutputVersion) then
  {$ELSE}
  if RunCommand('/bin/sh', ['-c', 'troff --version'], GroffOutputVersion) 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.');







|

|







137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
  ResStream: TResourceStream;
  {$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.');
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
  BuildWindow := TBuildStatusWindow.Create(Application);
  BuildWindow.Show;

  // Build the parameters:
  buildOpts := 'groff';

  // - Macro:
  if cmbMacro.SelText <> '' then buildOpts := buildOpts + ' -' + cmbMacro.SelText;

  // - Enforce UTF-8:
  buildOpts := buildOpts + ' -Kutf8';

  // - Preprocessors:
  if chkBoxPreprocessors.Checked[0] then   buildOpts := buildOpts + ' -chem';
  if chkBoxPreprocessors.Checked[1] then   buildOpts := buildOpts + ' -eqn';







|







326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
  BuildWindow := TBuildStatusWindow.Create(Application);
  BuildWindow.Show;

  // Build the parameters:
  buildOpts := 'groff';

  // - Macro:
  if LeftStr(cmbMacro.Text, 1) = 'm' then buildOpts := buildOpts + ' -' + cmbMacro.Text;

  // - Enforce UTF-8:
  buildOpts := buildOpts + ' -Kutf8';

  // - Preprocessors:
  if chkBoxPreprocessors.Checked[0] then   buildOpts := buildOpts + ' -chem';
  if chkBoxPreprocessors.Checked[1] then   buildOpts := buildOpts + ' -eqn';