mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-06 03:44:29 +00:00
- BUGFIX: Made pause/resume all function affect both (dl/up) tabs when window is hidden
This commit is contained in:
parent
ffb262f0a1
commit
3e783873ec
1
TODO
1
TODO
@ -90,4 +90,5 @@ beta6->beta7 changelog:
|
|||||||
- BUGFIX: Forgot to remove *.pyc files when uninstalling a search plugin
|
- BUGFIX: Forgot to remove *.pyc files when uninstalling a search plugin
|
||||||
- BUGFIX: Fixed drag'n drop on non-KDE systems
|
- BUGFIX: Fixed drag'n drop on non-KDE systems
|
||||||
- BUGFIX: Fixed log context menu position
|
- BUGFIX: Fixed log context menu position
|
||||||
|
- BUGFIX: Made pause/resume all function affect both (dl/up) tabs when window is hidden
|
||||||
- COSMETIC: Improved some icons
|
- COSMETIC: Improved some icons
|
||||||
|
86
src/GUI.cpp
86
src/GUI.cpp
@ -935,23 +935,40 @@ void GUI::togglePausedState(QString hash) {
|
|||||||
void GUI::on_actionPause_All_triggered() {
|
void GUI::on_actionPause_All_triggered() {
|
||||||
bool change = false;
|
bool change = false;
|
||||||
bool inDownloadList = true;
|
bool inDownloadList = true;
|
||||||
if(tabs->currentIndex() > 1) return;
|
bool hidden = false;
|
||||||
if(tabs->currentIndex() == 1)
|
switch(getCurrentTabIndex()) {
|
||||||
inDownloadList = false;
|
case -1:
|
||||||
QStringList hashes;
|
hidden = true;
|
||||||
if(inDownloadList) {
|
inDownloadList = false;
|
||||||
hashes = BTSession->getUnfinishedTorrents();
|
break;
|
||||||
} else {
|
case 0:
|
||||||
hashes = BTSession->getFinishedTorrents();
|
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;
|
QString hash;
|
||||||
foreach(hash, hashes) {
|
foreach(hash, DL_hashes) {
|
||||||
if(BTSession->pauseTorrent(hash)){
|
if(BTSession->pauseTorrent(hash)){
|
||||||
change = true;
|
change = true;
|
||||||
if(inDownloadList)
|
downloadingTorrentTab->pauseTorrent(hash);
|
||||||
downloadingTorrentTab->pauseTorrent(hash);
|
}
|
||||||
else
|
}
|
||||||
finishedTorrentTab->pauseTorrent(hash);
|
foreach(hash, F_hashes) {
|
||||||
|
if(BTSession->pauseTorrent(hash)){
|
||||||
|
change = true;
|
||||||
|
finishedTorrentTab->pauseTorrent(hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(change)
|
if(change)
|
||||||
@ -987,23 +1004,40 @@ void GUI::on_actionPause_triggered() {
|
|||||||
void GUI::on_actionStart_All_triggered() {
|
void GUI::on_actionStart_All_triggered() {
|
||||||
bool change = false;
|
bool change = false;
|
||||||
bool inDownloadList = true;
|
bool inDownloadList = true;
|
||||||
if(tabs->currentIndex() > 1) return;
|
bool hidden = false;
|
||||||
if(tabs->currentIndex() == 1)
|
switch(getCurrentTabIndex()) {
|
||||||
inDownloadList = false;
|
case -1:
|
||||||
QStringList hashes;
|
hidden = true;
|
||||||
if(inDownloadList) {
|
inDownloadList = false;
|
||||||
hashes = BTSession->getUnfinishedTorrents();
|
break;
|
||||||
} else {
|
case 0:
|
||||||
hashes = BTSession->getFinishedTorrents();
|
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;
|
QString hash;
|
||||||
foreach(hash, hashes) {
|
foreach(hash, DL_hashes) {
|
||||||
if(BTSession->resumeTorrent(hash)){
|
if(BTSession->resumeTorrent(hash)){
|
||||||
change = true;
|
change = true;
|
||||||
if(inDownloadList)
|
downloadingTorrentTab->resumeTorrent(hash);
|
||||||
downloadingTorrentTab->resumeTorrent(hash);
|
}
|
||||||
else
|
}
|
||||||
finishedTorrentTab->resumeTorrent(hash);
|
foreach(hash, F_hashes) {
|
||||||
|
if(BTSession->resumeTorrent(hash)){
|
||||||
|
change = true;
|
||||||
|
finishedTorrentTab->resumeTorrent(hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(change)
|
if(change)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user