Skip to content

Commit

Permalink
Remove BrowserCommand from delphi_gui
Browse files Browse the repository at this point in the history
  • Loading branch information
michaliskambi committed Dec 15, 2017
1 parent f524996 commit 221efcb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 39 deletions.
14 changes: 1 addition & 13 deletions source/delphi_gui/WWWBrowserRunnerDM.pas
Expand Up @@ -51,17 +51,12 @@ TWWWBrowserRunner = class(TDataModule)
private
{ private declarations }
public
BrowserCommand: string;
procedure RunBrowser(const URL: string);
end;

var
WWWBrowserRunner: TWWWBrowserRunner;

const
DefaultWWWBrowserCommand =
{$ifdef WIN32} '' {$else} 'sh -c "$BROWSER %s"' {$endif};

implementation

uses {$ifdef WIN32} Windows, ShellAPI, {$endif} PasDocGuiSettings;
Expand All @@ -72,13 +67,10 @@ implementation

procedure TWWWBrowserRunner.DataModuleCreate(Sender: TObject);
begin
BrowserCommand := IniFile.ReadString('Main', 'WWWBrowserCommand',
DefaultWWWBrowserCommand);
end;

procedure TWWWBrowserRunner.DataModuleDestroy(Sender: TObject);
begin
IniFile.WriteString('Main', 'WWWBrowserCommand', BrowserCommand);
end;

procedure TWWWBrowserRunner.RunBrowser(const URL: string);
Expand All @@ -104,11 +96,7 @@ procedure TWWWBrowserRunner.RunBrowser(const URL: string);

begin
{$ifdef WIN32}
if Trim(BrowserCommand) = '' then
begin
ShellExecuteURL;
Exit;
end;
ShellExecuteURL;
{$endif}
end;

Expand Down
21 changes: 0 additions & 21 deletions source/delphi_gui/preferencesfrm.dfm
Expand Up @@ -17,19 +17,6 @@ object Preferences: TPreferences
192)
PixelsPerInch = 96
TextHeight = 13
object LabelWWWBrowserCommand: TLabel
Left = 8
Top = 6
Width = 345
Height = 39
Caption =
'C&ommand to run WWW browser :'#10'(%s will be replaced with the URL,' +
' %% with %)'#10'(under Windows you can leave this blank to use defau' +
'lt WWW browser)'
Color = clBtnFace
FocusControl = EditWWWBrowserCommand
ParentColor = False
end
object LabelWWWHelpServer: TLabel
Left = 8
Top = 104
Expand All @@ -40,14 +27,6 @@ object Preferences: TPreferences
FocusControl = EditWWWHelpServer
ParentColor = False
end
object EditWWWBrowserCommand: TEdit
Left = 8
Top = 46
Width = 392
Height = 21
TabOrder = 0
Text = 'EditWWWBrowserCommand'
end
object EditWWWHelpServer: TEdit
Left = 8
Top = 120
Expand Down
5 changes: 0 additions & 5 deletions source/delphi_gui/preferencesfrm.pas
Expand Up @@ -43,9 +43,7 @@ TPreferences = class(TForm)
BtnOK: TButton;
BtnCancel: TButton;
BtnResetDefaults: TButton;
EditWWWBrowserCommand: TEdit;
EditWWWHelpServer: TEdit;
LabelWWWBrowserCommand: TLabel;
LabelWWWHelpServer: TLabel;
cbLoadLastProject: TCheckBox;
procedure BtnResetDefaultsClick(Sender: TObject);
Expand All @@ -62,7 +60,6 @@ implementation

procedure TPreferences.BtnResetDefaultsClick(Sender: TObject);
begin
EditWWWBrowserCommand.Text := DefaultWWWBrowserCommand;
EditWWWHelpServer.Text := DefaultWWWHelpServer;
cbLoadLastProject.Checked := TRUE;
end;
Expand All @@ -73,12 +70,10 @@ class procedure TPreferences.Execute;
begin
F := TPreferences.Create(nil);
try
F.EditWWWBrowserCommand.Text := WWWBrowserRunner.BrowserCommand;
F.EditWWWHelpServer.Text := WWWHelpServer;
F.cbLoadLastProject.Checked := AutoLoadLastProject;
if F.ShowModal = mrOK then
begin
WWWBrowserRunner.BrowserCommand := F.EditWWWBrowserCommand.Text;
WWWHelpServer := F.EditWWWHelpServer.Text;
AutoLoadLastProject := F.cbLoadLastProject.Checked;
end;
Expand Down

0 comments on commit 221efcb

Please sign in to comment.