|
|
|
@ -935,22 +935,39 @@ void GUI::togglePausedState(QString hash) {
@@ -935,22 +935,39 @@ void GUI::togglePausedState(QString hash) {
|
|
|
|
|
void GUI::on_actionPause_All_triggered() { |
|
|
|
|
bool change = false; |
|
|
|
|
bool inDownloadList = true; |
|
|
|
|
if(tabs->currentIndex() > 1) return; |
|
|
|
|
if(tabs->currentIndex() == 1) |
|
|
|
|
bool hidden = false; |
|
|
|
|
switch(getCurrentTabIndex()) { |
|
|
|
|
case -1: |
|
|
|
|
hidden = true; |
|
|
|
|
inDownloadList = false; |
|
|
|
|
QStringList hashes; |
|
|
|
|
if(inDownloadList) { |
|
|
|
|
hashes = BTSession->getUnfinishedTorrents(); |
|
|
|
|
} else { |
|
|
|
|
hashes = BTSession->getFinishedTorrents(); |
|
|
|
|
break; |
|
|
|
|
case 0: |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
inDownloadList = false; |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QStringList DL_hashes; |
|
|
|
|
QStringList F_hashes; |
|
|
|
|
if(hidden || inDownloadList) { |
|
|
|
|
DL_hashes = BTSession->getUnfinishedTorrents(); |
|
|
|
|
} |
|
|
|
|
if(hidden || !inDownloadList) { |
|
|
|
|
F_hashes = BTSession->getFinishedTorrents(); |
|
|
|
|
} |
|
|
|
|
QString hash; |
|
|
|
|
foreach(hash, hashes) { |
|
|
|
|
foreach(hash, DL_hashes) { |
|
|
|
|
if(BTSession->pauseTorrent(hash)){ |
|
|
|
|
change = true; |
|
|
|
|
if(inDownloadList) |
|
|
|
|
downloadingTorrentTab->pauseTorrent(hash); |
|
|
|
|
else |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
foreach(hash, F_hashes) { |
|
|
|
|
if(BTSession->pauseTorrent(hash)){ |
|
|
|
|
change = true; |
|
|
|
|
finishedTorrentTab->pauseTorrent(hash); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -987,22 +1004,39 @@ void GUI::on_actionPause_triggered() {
@@ -987,22 +1004,39 @@ void GUI::on_actionPause_triggered() {
|
|
|
|
|
void GUI::on_actionStart_All_triggered() { |
|
|
|
|
bool change = false; |
|
|
|
|
bool inDownloadList = true; |
|
|
|
|
if(tabs->currentIndex() > 1) return; |
|
|
|
|
if(tabs->currentIndex() == 1) |
|
|
|
|
bool hidden = false; |
|
|
|
|
switch(getCurrentTabIndex()) { |
|
|
|
|
case -1: |
|
|
|
|
hidden = true; |
|
|
|
|
inDownloadList = false; |
|
|
|
|
QStringList hashes; |
|
|
|
|
if(inDownloadList) { |
|
|
|
|
hashes = BTSession->getUnfinishedTorrents(); |
|
|
|
|
} else { |
|
|
|
|
hashes = BTSession->getFinishedTorrents(); |
|
|
|
|
break; |
|
|
|
|
case 0: |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
inDownloadList = false; |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QStringList DL_hashes; |
|
|
|
|
QStringList F_hashes; |
|
|
|
|
if(hidden || inDownloadList) { |
|
|
|
|
DL_hashes = BTSession->getUnfinishedTorrents(); |
|
|
|
|
} |
|
|
|
|
if(hidden || !inDownloadList) { |
|
|
|
|
F_hashes = BTSession->getFinishedTorrents(); |
|
|
|
|
} |
|
|
|
|
QString hash; |
|
|
|
|
foreach(hash, hashes) { |
|
|
|
|
foreach(hash, DL_hashes) { |
|
|
|
|
if(BTSession->resumeTorrent(hash)){ |
|
|
|
|
change = true; |
|
|
|
|
if(inDownloadList) |
|
|
|
|
downloadingTorrentTab->resumeTorrent(hash); |
|
|
|
|
else |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
foreach(hash, F_hashes) { |
|
|
|
|
if(BTSession->resumeTorrent(hash)){ |
|
|
|
|
change = true; |
|
|
|
|
finishedTorrentTab->resumeTorrent(hash); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|