mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
FEATURE: Allow to change the priority of several files at once
This commit is contained in:
parent
66157da5c2
commit
f0d0bb7170
59 changed files with 2333 additions and 1468 deletions
|
@ -513,15 +513,35 @@ void PropertiesWidget::displayFilesListMenu(const QPoint&){
|
|||
QAction *actRename = 0;
|
||||
if(selectedRows.size() == 1) {
|
||||
actRename = myFilesLlistMenu.addAction(QIcon(QString::fromUtf8(":/Icons/oxygen/edit_clear.png")), tr("Rename..."));
|
||||
//myFilesLlistMenu.addSeparator();
|
||||
} else {
|
||||
return;
|
||||
myFilesLlistMenu.addSeparator();
|
||||
}
|
||||
QMenu subMenu;
|
||||
subMenu.setTitle(tr("Priority"));
|
||||
subMenu.addAction(actionNormal);
|
||||
subMenu.addAction(actionHigh);
|
||||
subMenu.addAction(actionMaximum);
|
||||
myFilesLlistMenu.addMenu(&subMenu);
|
||||
// Call menu
|
||||
QAction *act = myFilesLlistMenu.exec(QCursor::pos());
|
||||
if(act) {
|
||||
if(act == actRename) {
|
||||
renameSelectedFile();
|
||||
} else {
|
||||
int prio = 1;
|
||||
if(act == actionHigh) {
|
||||
prio = HIGH;
|
||||
} else {
|
||||
if(act == actionMaximum) {
|
||||
prio = MAXIMUM;
|
||||
}
|
||||
}
|
||||
qDebug("Setting files priority");
|
||||
foreach(QModelIndex index, selectedRows) {
|
||||
qDebug("Setting priority(%d) for file at row %d", prio, index.row());
|
||||
PropListModel->setData(PropListModel->index(index.row(), PRIORITY, index.parent()), prio);
|
||||
}
|
||||
// Save changes
|
||||
filteredFilesChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue