Skip to content

Commit

Permalink
feature for adding multiple magnet links
Browse files Browse the repository at this point in the history
  • Loading branch information
Jure authored and PeterDaveHello committed May 21, 2023
1 parent 8e02134 commit da78f25
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 131 deletions.
42 changes: 21 additions & 21 deletions addlink.lfm
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
inherited AddLinkForm: TAddLinkForm
Left = 354
Height = 93
Top = 193
Width = 574
Left = 502
Height = 186
Top = 373
Width = 438
AutoSize = True
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'Add torrent link'
ClientHeight = 93
ClientWidth = 574
ClientHeight = 186
ClientWidth = 438
OnCreate = FormCreate
Position = poMainFormCenter
object Buttons: TButtonPanel[0]
Left = 8
Height = 26
Top = 59
Width = 558
Top = 152
Width = 422
BorderSpacing.Left = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Expand All @@ -35,30 +34,31 @@ inherited AddLinkForm: TAddLinkForm
end
object Panel1: TPanel[1]
Left = 8
Height = 43
Height = 136
Top = 8
Width = 558
Width = 422
Align = alClient
BorderSpacing.Around = 8
BevelOuter = bvNone
ClientHeight = 43
ClientWidth = 558
ClientHeight = 136
ClientWidth = 422
TabOrder = 0
object txLink: TLabel
Left = 0
Height = 14
Height = 15
Top = 0
Width = 183
Caption = 'URL of a .torrent file or a magnet link:'
Width = 267
Caption = 'URL of a .torrent file or a magnet link(one per line):'
ParentColor = False
end
object edLink: TEdit
object meLink: TMemo
Left = 0
Height = 21
Top = 20
Width = 558
Anchors = [akTop, akLeft, akRight]
Height = 115
Top = 21
Width = 422
Anchors = [akTop, akLeft, akRight, akBottom]
TabOrder = 0
WordWrap = False
end
end
end
20 changes: 15 additions & 5 deletions addlink.pas
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
along with Transmission Remote GUI; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
In addition, as a special exception, the copyright holders give permission to
In addition, as a special exception, the copyright holders give permission to
link the code of portions of this program with the
OpenSSL library under certain conditions as described in each individual
source file, and distribute linked combinations including the two.
Expand Down Expand Up @@ -48,7 +48,7 @@ interface

TAddLinkForm = class(TBaseForm)
Buttons: TButtonPanel;
edLink: TEdit;
meLink: TMemo;
Panel1: TPanel;
txLink: TLabel;
procedure btOKClick(Sender: TObject);
Expand All @@ -66,10 +66,20 @@ implementation
{ TAddLinkForm }

procedure TAddLinkForm.btOKClick(Sender: TObject);
var
i: integer;
ok: Boolean = false;
begin
edLink.Text:=Trim(edLink.Text);
if edLink.Text = '' then begin
edLink.SetFocus;
for i := meLink.Lines.Count - 1 downto 0 do
begin
meLink.Lines[i]:=Trim(meLink.Lines[i]);
if meLink.Lines[i] <> '' then ok := true // have at least one link
else meLink.Lines.Delete(i); // remove empty lines
end;

if not ok then
begin
meLink.SetFocus;
MessageDlg(SNoLink, mtError, [mbOK], 0);
exit;
end;
Expand Down
26 changes: 17 additions & 9 deletions addtorrent.lfm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
inherited AddTorrentForm: TAddTorrentForm
Left = 494
Left = 1165
Height = 457
Top = 276
Top = 360
Width = 508
HorzScrollBar.Page = 505
VertScrollBar.Page = 404
Expand Down Expand Up @@ -75,7 +75,7 @@ inherited AddTorrentForm: TAddTorrentForm
Height = 26
Hint = 'Browse folder'
Top = 13
Width = 91
Width = 88
Anchors = [akTop, akRight]
Caption = 'Browse...'
OnClick = btBrowseClick
Expand All @@ -95,17 +95,17 @@ inherited AddTorrentForm: TAddTorrentForm
Left = 10
Height = 23
Top = 96
Width = 467
Width = 465
Anchors = [akTop, akLeft, akRight]
OnChange = edSaveAsChange
TabOrder = 2
end
object edExtension: TEdit
Left = 8
Left = 10
Height = 23
Hint = 'for example: *.avi *.mkv tom*jerry*.avi'
Top = 56
Width = 467
Width = 465
Anchors = [akTop, akLeft, akRight]
OnChange = edSaveAsChange
ParentShowHint = False
Expand All @@ -117,7 +117,7 @@ inherited AddTorrentForm: TAddTorrentForm
Height = 15
Hint = 'for example: *.avi *.mkv tom*jerry*.avi'
Top = 40
Width = 59
Width = 57
Caption = 'Template: '
ParentColor = False
ParentShowHint = False
Expand Down Expand Up @@ -201,6 +201,14 @@ inherited AddTorrentForm: TAddTorrentForm
ShowHint = True
TabOrder = 5
end
object cbApplyAll: TCheckBox
Left = 10
Height = 19
Top = 127
Width = 80
Caption = 'Apply to all'
TabOrder = 6
end
end
object gbContents: TGroupBox[1]
Left = 8
Expand Down Expand Up @@ -237,12 +245,12 @@ inherited AddTorrentForm: TAddTorrentForm
Top = 40
Width = 467
Anchors = [akTop, akLeft, akRight, akBottom]
Columns = <
Columns = <
item
ReadOnly = True
Title.Caption = 'File name'
Width = 350
end
end
item
ReadOnly = True
Title.Caption = 'Size'
Expand Down
2 changes: 2 additions & 0 deletions addtorrent.pas
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ TFilesTree = class;
{ TAddTorrentForm }

TAddTorrentForm = class(TBaseForm)
cbApplyAll: TCheckBox;
DelButton: TBitBtn;
btSelectAll: TButton;
btSelectNone: TButton;
Expand Down Expand Up @@ -95,6 +96,7 @@ TAddTorrentForm = class(TBaseForm)
procedure TreeStateChanged(Sender: TObject);
procedure UpdateSize;
public
ApplyToAll: boolean;
OrigCaption: string;
Extension : string;
property FilesTree: TFilesTree read FTree;
Expand Down
Loading

0 comments on commit da78f25

Please sign in to comment.