mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 16:53:08 -07:00
- Make sure priority column stays sorted when changing torrents priority (closes #417829)
This commit is contained in:
parent
d02aca7323
commit
d4d0a08390
3 changed files with 12 additions and 1 deletions
|
@ -1351,6 +1351,9 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
||||||
BTSession->increaseDlTorrentPriority(hash);
|
BTSession->increaseDlTorrentPriority(hash);
|
||||||
}
|
}
|
||||||
updateLists();
|
updateLists();
|
||||||
|
// Update sorting if necessary
|
||||||
|
if(downloadingTorrentTab->isPriorityColumnSorted())
|
||||||
|
downloadingTorrentTab->sortDownloadList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::on_actionDecreasePriority_triggered() {
|
void GUI::on_actionDecreasePriority_triggered() {
|
||||||
|
@ -1360,6 +1363,9 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
||||||
BTSession->decreaseDlTorrentPriority(hash);
|
BTSession->decreaseDlTorrentPriority(hash);
|
||||||
}
|
}
|
||||||
updateLists();
|
updateLists();
|
||||||
|
// Update sorting if necessary
|
||||||
|
if(downloadingTorrentTab->isPriorityColumnSorted())
|
||||||
|
downloadingTorrentTab->sortDownloadList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// pause selected items in the list
|
// pause selected items in the list
|
||||||
|
|
|
@ -718,6 +718,10 @@ void DownloadingTorrents::sortProgressColumn(QTorrentHandle& h) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DownloadingTorrents::isPriorityColumnSorted() {
|
||||||
|
return (downloadList->header()->sortIndicatorSection() == PRIORITY);
|
||||||
|
}
|
||||||
|
|
||||||
void DownloadingTorrents::sortDownloadList(int index, Qt::SortOrder sortOrder) {
|
void DownloadingTorrents::sortDownloadList(int index, Qt::SortOrder sortOrder) {
|
||||||
if(index == -1) {
|
if(index == -1) {
|
||||||
index = downloadList->header()->sortIndicatorSection();
|
index = downloadList->header()->sortIndicatorSection();
|
||||||
|
|
|
@ -63,6 +63,7 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
||||||
QStringList getSelectedTorrents(bool only_one=false) const;
|
QStringList getSelectedTorrents(bool only_one=false) const;
|
||||||
unsigned int getNbTorrentsInList() const;
|
unsigned int getNbTorrentsInList() const;
|
||||||
void enablePriorityColumn(bool enable);
|
void enablePriorityColumn(bool enable);
|
||||||
|
bool isPriorityColumnSorted();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void unfinishedTorrentsNumberChanged(unsigned int);
|
void unfinishedTorrentsNumberChanged(unsigned int);
|
||||||
|
@ -74,7 +75,6 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
||||||
void on_actionSet_upload_limit_triggered();
|
void on_actionSet_upload_limit_triggered();
|
||||||
void displayDLListMenu(const QPoint& pos);
|
void displayDLListMenu(const QPoint& pos);
|
||||||
void displayDLHoSMenu(const QPoint&);
|
void displayDLHoSMenu(const QPoint&);
|
||||||
void sortDownloadList(int index=-1, Qt::SortOrder startSortOrder=Qt::AscendingOrder);
|
|
||||||
void toggleDownloadListSortOrder(int index);
|
void toggleDownloadListSortOrder(int index);
|
||||||
void sortDownloadListFloat(int index, Qt::SortOrder sortOrder);
|
void sortDownloadListFloat(int index, Qt::SortOrder sortOrder);
|
||||||
void sortDownloadListString(int index, Qt::SortOrder sortOrder);
|
void sortDownloadListString(int index, Qt::SortOrder sortOrder);
|
||||||
|
@ -104,6 +104,7 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
|
||||||
void loadLastSortedColumn();
|
void loadLastSortedColumn();
|
||||||
void addTorrent(QString hash);
|
void addTorrent(QString hash);
|
||||||
void updateMetadata(QTorrentHandle &h);
|
void updateMetadata(QTorrentHandle &h);
|
||||||
|
void sortDownloadList(int index=-1, Qt::SortOrder startSortOrder=Qt::AscendingOrder);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue