|
|
@ -602,7 +602,7 @@ void TransferListWidget::copySelectedMagnetURIs() const { |
|
|
|
QStringList magnet_uris; |
|
|
|
QStringList magnet_uris; |
|
|
|
foreach(const QModelIndex &index, selectedIndexes) { |
|
|
|
foreach(const QModelIndex &index, selectedIndexes) { |
|
|
|
QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(proxyModel->mapToSource(index).row())); |
|
|
|
QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(proxyModel->mapToSource(index).row())); |
|
|
|
if(h.is_valid()) |
|
|
|
if(h.is_valid() && h.has_metadata()) |
|
|
|
magnet_uris << misc::toQString(make_magnet_uri(h.get_torrent_info())); |
|
|
|
magnet_uris << misc::toQString(make_magnet_uri(h.get_torrent_info())); |
|
|
|
} |
|
|
|
} |
|
|
|
qApp->clipboard()->setText(magnet_uris.join("\n")); |
|
|
|
qApp->clipboard()->setText(magnet_uris.join("\n")); |
|
|
@ -632,7 +632,7 @@ void TransferListWidget::previewSelectedTorrents() { |
|
|
|
QStringList pathsList; |
|
|
|
QStringList pathsList; |
|
|
|
foreach(const QModelIndex &index, selectedIndexes) { |
|
|
|
foreach(const QModelIndex &index, selectedIndexes) { |
|
|
|
QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(proxyModel->mapToSource(index).row())); |
|
|
|
QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(proxyModel->mapToSource(index).row())); |
|
|
|
if(h.is_valid()) { |
|
|
|
if(h.is_valid() && h.has_metadata()) { |
|
|
|
new previewSelect(this, h); |
|
|
|
new previewSelect(this, h); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -783,7 +783,7 @@ void TransferListWidget::toggleSelectedTorrentsSuperSeeding() { |
|
|
|
// Get the file hash
|
|
|
|
// Get the file hash
|
|
|
|
QString hash = getHashFromRow(proxyModel->mapToSource(index).row()); |
|
|
|
QString hash = getHashFromRow(proxyModel->mapToSource(index).row()); |
|
|
|
QTorrentHandle h = BTSession->getTorrentHandle(hash); |
|
|
|
QTorrentHandle h = BTSession->getTorrentHandle(hash); |
|
|
|
if(h.is_valid()) { |
|
|
|
if(h.is_valid() && h.has_metadata()) { |
|
|
|
h.super_seeding(!h.super_seeding()); |
|
|
|
h.super_seeding(!h.super_seeding()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -796,7 +796,7 @@ void TransferListWidget::toggleSelectedTorrentsSequentialDownload() { |
|
|
|
// Get the file hash
|
|
|
|
// Get the file hash
|
|
|
|
QString hash = getHashFromRow(proxyModel->mapToSource(index).row()); |
|
|
|
QString hash = getHashFromRow(proxyModel->mapToSource(index).row()); |
|
|
|
QTorrentHandle h = BTSession->getTorrentHandle(hash); |
|
|
|
QTorrentHandle h = BTSession->getTorrentHandle(hash); |
|
|
|
if(h.is_valid()) { |
|
|
|
if(h.is_valid() && h.has_metadata()) { |
|
|
|
h.set_sequential_download(!h.is_sequential_download()); |
|
|
|
h.set_sequential_download(!h.is_sequential_download()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -808,7 +808,7 @@ void TransferListWidget::toggleSelectedFirstLastPiecePrio() { |
|
|
|
// Get the file hash
|
|
|
|
// Get the file hash
|
|
|
|
QString hash = getHashFromRow(proxyModel->mapToSource(index).row()); |
|
|
|
QString hash = getHashFromRow(proxyModel->mapToSource(index).row()); |
|
|
|
QTorrentHandle h = BTSession->getTorrentHandle(hash); |
|
|
|
QTorrentHandle h = BTSession->getTorrentHandle(hash); |
|
|
|
if(h.is_valid() && h.num_files() == 1) { |
|
|
|
if(h.is_valid() && h.has_metadata()) { |
|
|
|
h.prioritize_first_last_piece(!h.first_last_piece_first()); |
|
|
|
h.prioritize_first_last_piece(!h.first_last_piece_first()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -871,6 +871,7 @@ void TransferListWidget::displayListMenu(const QPoint&) { |
|
|
|
one_has_metadata = true; |
|
|
|
one_has_metadata = true; |
|
|
|
if(!h.is_seed()) { |
|
|
|
if(!h.is_seed()) { |
|
|
|
one_not_seed = true; |
|
|
|
one_not_seed = true; |
|
|
|
|
|
|
|
if(h.has_metadata()) { |
|
|
|
if(first) { |
|
|
|
if(first) { |
|
|
|
sequential_download_mode = h.is_sequential_download(); |
|
|
|
sequential_download_mode = h.is_sequential_download(); |
|
|
|
prioritize_first_last = h.first_last_piece_first(); |
|
|
|
prioritize_first_last = h.first_last_piece_first(); |
|
|
@ -883,9 +884,10 @@ void TransferListWidget::displayListMenu(const QPoint&) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
#ifdef LIBTORRENT_0_15 |
|
|
|
#ifdef LIBTORRENT_0_15 |
|
|
|
else { |
|
|
|
else { |
|
|
|
if(!one_not_seed && all_same_super_seeding) { |
|
|
|
if(!one_not_seed && all_same_super_seeding && h.has_metadata()) { |
|
|
|
if(first) { |
|
|
|
if(first) { |
|
|
|
super_seeding_mode = h.super_seeding(); |
|
|
|
super_seeding_mode = h.super_seeding(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -920,7 +922,7 @@ void TransferListWidget::displayListMenu(const QPoint&) { |
|
|
|
listMenu.addAction(&actionSet_download_limit); |
|
|
|
listMenu.addAction(&actionSet_download_limit); |
|
|
|
listMenu.addAction(&actionSet_upload_limit); |
|
|
|
listMenu.addAction(&actionSet_upload_limit); |
|
|
|
#ifdef LIBTORRENT_0_15 |
|
|
|
#ifdef LIBTORRENT_0_15 |
|
|
|
if(!one_not_seed && all_same_super_seeding) { |
|
|
|
if(!one_not_seed && all_same_super_seeding && one_has_metadata) { |
|
|
|
QIcon ico; |
|
|
|
QIcon ico; |
|
|
|
if(super_seeding_mode) { |
|
|
|
if(super_seeding_mode) { |
|
|
|
ico = QIcon(":/Icons/oxygen/button_ok.png"); |
|
|
|
ico = QIcon(":/Icons/oxygen/button_ok.png"); |
|
|
@ -937,7 +939,7 @@ void TransferListWidget::displayListMenu(const QPoint&) { |
|
|
|
listMenu.addAction(&actionPreview_file); |
|
|
|
listMenu.addAction(&actionPreview_file); |
|
|
|
added_preview_action = true; |
|
|
|
added_preview_action = true; |
|
|
|
} |
|
|
|
} |
|
|
|
if(one_not_seed) { |
|
|
|
if(one_not_seed && one_has_metadata) { |
|
|
|
if(all_same_sequential_download_mode) { |
|
|
|
if(all_same_sequential_download_mode) { |
|
|
|
QIcon ico; |
|
|
|
QIcon ico; |
|
|
|
if(sequential_download_mode) { |
|
|
|
if(sequential_download_mode) { |
|
|
@ -974,6 +976,7 @@ void TransferListWidget::displayListMenu(const QPoint&) { |
|
|
|
listMenu.addAction(&actionDecreasePriority); |
|
|
|
listMenu.addAction(&actionDecreasePriority); |
|
|
|
} |
|
|
|
} |
|
|
|
listMenu.addSeparator(); |
|
|
|
listMenu.addSeparator(); |
|
|
|
|
|
|
|
if(one_has_metadata) |
|
|
|
listMenu.addAction(&actionCopy_magnet_link); |
|
|
|
listMenu.addAction(&actionCopy_magnet_link); |
|
|
|
listMenu.addAction(&actionBuy_it); |
|
|
|
listMenu.addAction(&actionBuy_it); |
|
|
|
// Call menu
|
|
|
|
// Call menu
|
|
|
|