forked from transmission-remote-gui/transgui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
addtracker.pas
58 lines (43 loc) · 1.09 KB
/
addtracker.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
unit AddTracker;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, ButtonPanel, StdCtrls, ExtCtrls, BaseForm;
resourcestring
STrackerProps = 'Tracker properties';
SNoTracker = 'No tracker URL was specified.';
type
{ TAddTrackerForm }
TAddTrackerForm = class(TBaseForm)
Buttons: TButtonPanel;
edTracker: TEdit;
Panel1: TPanel;
txTrackerURL: TLabel;
procedure FormCreate(Sender: TObject);
procedure OKButtonClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
implementation
uses main;
{ TAddTrackerForm }
procedure TAddTrackerForm.OKButtonClick(Sender: TObject);
begin
edTracker.Text:=Trim(edTracker.Text);
if edTracker.Text = '' then begin
edTracker.SetFocus;
MessageDlg(SNoTracker, mtError, [mbOK], 0);
exit;
end;
ModalResult:=mrOk;
end;
procedure TAddTrackerForm.FormCreate(Sender: TObject);
begin
Buttons.OKButton.ModalResult:=mrNone;
Buttons.OKButton.OnClick:=@OKButtonClick;
end;
initialization
{$I addtracker.lrs}
end.