mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-29 11:48:05 -06:00
Revise 'Add trackers' dialog
* Now it allow user to add tracker to different tier. * The downloaded trackers are now displayed as is (without modifying). * Now the dialog remember dialog size and last used URL. Closes #17692.
This commit is contained in:
@@ -423,17 +423,15 @@ void TrackerListWidget::loadTrackers()
|
||||
delete m_trackerItems.take(tracker);
|
||||
}
|
||||
|
||||
// Ask the user for new trackers and add them to the torrent
|
||||
void TrackerListWidget::askForTrackers()
|
||||
void TrackerListWidget::openAddTrackersDialog()
|
||||
{
|
||||
BitTorrent::Torrent *const torrent = m_properties->getCurrentTorrent();
|
||||
if (!torrent) return;
|
||||
BitTorrent::Torrent *torrent = m_properties->getCurrentTorrent();
|
||||
if (!torrent)
|
||||
return;
|
||||
|
||||
QVector<BitTorrent::TrackerEntry> trackers;
|
||||
for (const QString &tracker : asConst(TrackersAdditionDialog::askForTrackers(this, torrent)))
|
||||
trackers.append({tracker});
|
||||
|
||||
torrent->addTrackers(trackers);
|
||||
const auto dialog = new TrackersAdditionDialog(this, torrent);
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||
dialog->open();
|
||||
}
|
||||
|
||||
void TrackerListWidget::copyTrackerUrl()
|
||||
@@ -568,7 +566,7 @@ void TrackerListWidget::showTrackerListMenu()
|
||||
|
||||
// Add actions
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"list-add"_qs), tr("Add trackers...")
|
||||
, this, &TrackerListWidget::askForTrackers);
|
||||
, this, &TrackerListWidget::openAddTrackersDialog);
|
||||
|
||||
if (!getSelectedTrackerItems().isEmpty())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user