17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls,
ExtCtrls, Buttons, ExtendedNotebook, SynEdit, fphttpclient, opensslsockets,
RegExpr, LCLIntf, LCLType, IniPropStorage, Process, Helpers, fileinfo,
{$IF DEFINED(WINDOWS)}
winpeimagereader,
{$ELSEIF DEFINED(DARWIN)}
machoreader, ssockets, sslsockets, sslbase,
{$ELSEIF DEFINED(LINUX)}
elfreader,
{$ENDIF}
BuildOutputWindow;
type
|
|
|
|
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls,
ExtCtrls, Buttons, ExtendedNotebook, SynEdit, fphttpclient,
RegExpr, LCLIntf, LCLType, IniPropStorage, Process, Helpers, fileinfo,
{$IF DEFINED(WINDOWS)}
winpeimagereader, opensslsockets,
{$ELSEIF DEFINED(DARWIN)}
machoreader, ssockets, sslsockets, sslbase, opensslsockets,
{$ELSEIF DEFINED(LINUX)}
elfreader,
{$ENDIF}
BuildOutputWindow;
type
|
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
end;
// Restore the settings
iniStorage.Restore;
storeBuildSettings := iniStorage.ReadBoolean('AutoSaveBuildSettings', False);
chkAutoSaveBuildSettings.Checked := storeBuildSettings;
updateCheck := iniStorage.ReadBoolean('UpdateCheckOnStart', False);
chkUpdateCheckOnStart.Checked := updateCheck;
if storeBuildSettings then
begin
chkLogFile.Checked := iniStorage.ReadBoolean('BuildLogFile', False);
cmbMacro.Text := iniStorage.ReadString('BuildChosenMacro', '[ select ]');
chkChem.Checked := iniStorage.ReadBoolean('BuildUseChem', False);
chkEqn.Checked := iniStorage.ReadBoolean('BuildUseEqn', False);
|
>
>
>
>
>
>
|
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
end;
// Restore the settings
iniStorage.Restore;
storeBuildSettings := iniStorage.ReadBoolean('AutoSaveBuildSettings', False);
chkAutoSaveBuildSettings.Checked := storeBuildSettings;
{$IF DEFINED(LINUX) OR DEFINED(BSD)}
// On platforms which probably use a package manager (currently, Linux and
// BSDs), the "update check" checkbox is disabled.
chkUpdateCheckOnStart.Enabled := False;
{$ELSE}
updateCheck := iniStorage.ReadBoolean('UpdateCheckOnStart', False);
chkUpdateCheckOnStart.Checked := updateCheck;
{$ENDIF}
if storeBuildSettings then
begin
chkLogFile.Checked := iniStorage.ReadBoolean('BuildLogFile', False);
cmbMacro.Text := iniStorage.ReadString('BuildChosenMacro', '[ select ]');
chkChem.Checked := iniStorage.ReadBoolean('BuildUseChem', False);
chkEqn.Checked := iniStorage.ReadBoolean('BuildUseEqn', False);
|
306
307
308
309
310
311
312
313
314
315
316
317
318
319
|
MainStatusBar.Panels[0].Text := '* ' + currentGroffFileName;
unsavedChanges := True;
end;
procedure TMainForm.btnDownloadGroffWindowsClick(Sender: TObject);
begin
{$IFDEF WINDOWS}
OpenURL(latestGroffWindowsUrl);
{$ENDIF}
end;
procedure TMainForm.btnBuildClick(Sender: TObject);
var
buildSuccess: Boolean;
|
>
|
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
|
MainStatusBar.Panels[0].Text := '* ' + currentGroffFileName;
unsavedChanges := True;
end;
procedure TMainForm.btnDownloadGroffWindowsClick(Sender: TObject);
begin
{$IFDEF WINDOWS}
// On other systems, the button is disabled anyway.
OpenURL(latestGroffWindowsUrl);
{$ENDIF}
end;
procedure TMainForm.btnBuildClick(Sender: TObject);
var
buildSuccess: Boolean;
|
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
|
Reply, BoxStyle: Integer;
begin
// If the current file has unsaved changes, ask first.
if unsavedChanges then
with Application do begin
BoxStyle := MB_ICONQUESTION + MB_YESNO;
Reply := MessageBox('Do you want to save the document first?', 'UnsavedChanges', BoxStyle);
if Reply = IDYES then SynEdit1.Lines.SaveToFile(currentGroffFilePath);
end;
end;
{$IFDEF DARWIN}
// Fix HTTPS on macOS:
procedure TMainForm.GetSocketHandler(Sender: TObject; const UseSSL: Boolean; out AHandler: TSocketHandler);
begin
|
|
|
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
|
Reply, BoxStyle: Integer;
begin
// If the current file has unsaved changes, ask first.
if unsavedChanges then
with Application do begin
BoxStyle := MB_ICONQUESTION + MB_YESNO;
Reply := MessageBox('Do you want to save the document first?', 'UnsavedChanges', BoxStyle);
if Reply = IDYES then btnSaveGroffClick(Sender);
end;
end;
{$IFDEF DARWIN}
// Fix HTTPS on macOS:
procedure TMainForm.GetSocketHandler(Sender: TObject; const UseSSL: Boolean; out AHandler: TSocketHandler);
begin
|