@@ -12,6 +12,8 @@ interface
1212
1313type
1414
15+ TDefaultChecked = function(const TrackerURL: UTF8String): Boolean of object ;
16+
1517 { TControlerTrackerListOnline }
1618
1719 TControlerTrackerListOnline = class
@@ -20,6 +22,7 @@ TControlerTrackerListOnline = class
2022 FNewTrackon: TNewTrackon;
2123 FTrackerListOnline: TTrackerListOnline;
2224 FTrackerList: TStringList;
25+ FDefaultChecked: TDefaultChecked;
2326
2427 // The collumn must be in this design order.
2528 FSelect, // < 0
@@ -33,7 +36,6 @@ TControlerTrackerListOnline = class
3336 procedure AppendRow (Checked: boolean; Status: TTrackerListOnlineStatus;
3437 const TrackerURL: UTF8String);
3538 public
36-
3739 property Checked[index: integer]: boolean read GetChecked write SetChecked;
3840 function TrackerURL (index: integer): string;
3941 function TrackerStatus (index: integer): TTrackerListOnlineStatus;
@@ -45,7 +47,7 @@ TControlerTrackerListOnline = class
4547
4648 function DownloadTrackers : boolean;
4749
48- constructor Create(StringGridTorrentURL: TStringGrid; TrackerList: TStringList);
50+ constructor Create(StringGridTorrentURL: TStringGrid; TrackerList: TStringList; DefaultChecked: TDefaultChecked );
4951 destructor Destroy; override;
5052 end ;
5153
@@ -65,10 +67,11 @@ function TControlerTrackerListOnline.DownloadTrackers: boolean;
6567end ;
6668
6769constructor TControlerTrackerListOnline.Create(StringGridTorrentURL: TStringGrid;
68- TrackerList: TStringList);
70+ TrackerList: TStringList; DefaultChecked: TDefaultChecked );
6971begin
7072
7173 FTrackerList := TrackerList;
74+ FDefaultChecked := DefaultChecked;
7275
7376 FStringGridTorrentURL := StringGridTorrentURL;
7477 FStringGridTorrentURL.RowCount := 1 ;
@@ -165,20 +168,16 @@ function TControlerTrackerListOnline.StableTrackers: TStringList;
165168procedure TControlerTrackerListOnline.UpdateView ;
166169var
167170 tracker: string;
168- DeafultChecked: boolean;
169171begin
170172 // Clear all the previeus data in the view
171173 FStringGridTorrentURL.RowCount := FStringGridTorrentURL.FixedRows;
172174
173- // the default status is is put all the checkox to true. => keep all trackers
174- DeafultChecked := True;
175-
176175 FStringGridTorrentURL.BeginUpdate;
177176
178177 // Show the TrackerList list in string grid view
179178 for tracker in FTrackerList do
180179 begin
181- AppendRow(DeafultChecked , FTrackerListOnline.TrackerStatus(tracker), tracker);
180+ AppendRow(FDefaultChecked(tracker) , FTrackerListOnline.TrackerStatus(tracker), tracker);
182181 end ;
183182
184183 // make sure all text are fit inside the columns
0 commit comments