diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index f3d245b1a..1330ba43b 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -116,7 +116,7 @@ namespace #endif bool readFile(const QString &path, QByteArray &buf); - bool loadTorrentResumeData(const QByteArray &data, CreateTorrentParams &torrentParams, int &prio, MagnetUri &magnetUri); + bool loadTorrentResumeData(const QByteArray &data, CreateTorrentParams &torrentParams, int &queuePos, MagnetUri &magnetUri); void torrentQueuePositionUp(const lt::torrent_handle &handle); void torrentQueuePositionDown(const lt::torrent_handle &handle); @@ -1698,20 +1698,20 @@ bool Session::cancelLoadMetadata(const InfoHash &hash) return true; } -void Session::increaseTorrentsPriority(const QStringList &hashes) +void Session::increaseTorrentsQueuePos(const QStringList &hashes) { std::priority_queue, std::vector>, std::greater>> torrentQueue; - // Sort torrents by priority + // Sort torrents by queue position for (const InfoHash infoHash : hashes) { TorrentHandle *const torrent = m_torrents.value(infoHash); if (torrent && !torrent->isSeed()) torrentQueue.push(qMakePair(torrent->queuePosition(), torrent)); } - // Increase torrents priority (starting with the ones with highest priority) + // Increase torrents queue position (starting with the one in the highest queue position) while (!torrentQueue.empty()) { TorrentHandle *const torrent = torrentQueue.top().second; torrentQueuePositionUp(torrent->nativeHandle()); @@ -1721,20 +1721,20 @@ void Session::increaseTorrentsPriority(const QStringList &hashes) saveTorrentsQueue(); } -void Session::decreaseTorrentsPriority(const QStringList &hashes) +void Session::decreaseTorrentsQueuePos(const QStringList &hashes) { std::priority_queue, std::vector>, std::less>> torrentQueue; - // Sort torrents by priority + // Sort torrents by queue position for (const InfoHash infoHash : hashes) { TorrentHandle *const torrent = m_torrents.value(infoHash); if (torrent && !torrent->isSeed()) torrentQueue.push(qMakePair(torrent->queuePosition(), torrent)); } - // Decrease torrents priority (starting with the ones with lowest priority) + // Decrease torrents queue position (starting with the one in the lowest queue position) while (!torrentQueue.empty()) { TorrentHandle *const torrent = torrentQueue.top().second; torrentQueuePositionDown(torrent->nativeHandle()); @@ -1747,20 +1747,20 @@ void Session::decreaseTorrentsPriority(const QStringList &hashes) saveTorrentsQueue(); } -void Session::topTorrentsPriority(const QStringList &hashes) +void Session::topTorrentsQueuePos(const QStringList &hashes) { std::priority_queue, std::vector>, std::greater>> torrentQueue; - // Sort torrents by priority + // Sort torrents by queue position for (const InfoHash infoHash : hashes) { TorrentHandle *const torrent = m_torrents.value(infoHash); if (torrent && !torrent->isSeed()) torrentQueue.push(qMakePair(torrent->queuePosition(), torrent)); } - // Top torrents priority (starting with the ones with highest priority) + // Top torrents queue position (starting with the one in the highest queue position) while (!torrentQueue.empty()) { TorrentHandle *const torrent = torrentQueue.top().second; torrentQueuePositionTop(torrent->nativeHandle()); @@ -1770,20 +1770,20 @@ void Session::topTorrentsPriority(const QStringList &hashes) saveTorrentsQueue(); } -void Session::bottomTorrentsPriority(const QStringList &hashes) +void Session::bottomTorrentsQueuePos(const QStringList &hashes) { std::priority_queue, std::vector>, std::less>> torrentQueue; - // Sort torrents by priority + // Sort torrents by queue position for (const InfoHash infoHash : hashes) { TorrentHandle *const torrent = m_torrents.value(infoHash); if (torrent && !torrent->isSeed()) torrentQueue.push(qMakePair(torrent->queuePosition(), torrent)); } - // Bottom torrents priority (starting with the ones with lowest priority) + // Bottom torrents queue position (starting with the one in the lowest queue position) while (!torrentQueue.empty()) { TorrentHandle *const torrent = torrentQueue.top().second; torrentQueuePositionBottom(torrent->nativeHandle()); @@ -4432,7 +4432,7 @@ namespace return true; } - bool loadTorrentResumeData(const QByteArray &data, CreateTorrentParams &torrentParams, int &prio, MagnetUri &magnetUri) + bool loadTorrentResumeData(const QByteArray &data, CreateTorrentParams &torrentParams, int &queuePos, MagnetUri &magnetUri) { torrentParams = CreateTorrentParams(); torrentParams.restored = true; @@ -4476,7 +4476,7 @@ namespace torrentParams.firstLastPiecePriority = fast.dict_find_int_value("qBt-firstLastPiecePriority"); torrentParams.sequential = fast.dict_find_int_value("qBt-sequential"); - prio = fast.dict_find_int_value("qBt-queuePosition"); + queuePos = fast.dict_find_int_value("qBt-queuePosition"); return true; } diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h index ec6fe397e..e99270037 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -421,10 +421,10 @@ namespace BitTorrent bool cancelLoadMetadata(const InfoHash &hash); void recursiveTorrentDownload(const InfoHash &hash); - void increaseTorrentsPriority(const QStringList &hashes); - void decreaseTorrentsPriority(const QStringList &hashes); - void topTorrentsPriority(const QStringList &hashes); - void bottomTorrentsPriority(const QStringList &hashes); + void increaseTorrentsQueuePos(const QStringList &hashes); + void decreaseTorrentsQueuePos(const QStringList &hashes); + void topTorrentsQueuePos(const QStringList &hashes); + void bottomTorrentsQueuePos(const QStringList &hashes); // TorrentHandle interface void handleTorrentShareLimitChanged(TorrentHandle *const torrent); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index d714daf75..32cc77359 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -171,14 +171,14 @@ MainWindow::MainWindow(QWidget *parent) m_ui->actionCreateTorrent->setIcon(GuiIconProvider::instance()->getIcon("document-edit")); m_ui->actionAbout->setIcon(GuiIconProvider::instance()->getIcon("help-about")); m_ui->actionStatistics->setIcon(GuiIconProvider::instance()->getIcon("view-statistics")); - m_ui->actionDecreasePriority->setIcon(GuiIconProvider::instance()->getIcon("go-down")); - m_ui->actionBottomPriority->setIcon(GuiIconProvider::instance()->getIcon("go-bottom")); + m_ui->actionTopQueuePos->setIcon(GuiIconProvider::instance()->getIcon("go-top")); + m_ui->actionIncreaseQueuePos->setIcon(GuiIconProvider::instance()->getIcon("go-up")); + m_ui->actionDecreaseQueuePos->setIcon(GuiIconProvider::instance()->getIcon("go-down")); + m_ui->actionBottomQueuePos->setIcon(GuiIconProvider::instance()->getIcon("go-bottom")); m_ui->actionDelete->setIcon(GuiIconProvider::instance()->getIcon("list-remove")); m_ui->actionDocumentation->setIcon(GuiIconProvider::instance()->getIcon("help-contents")); m_ui->actionDonateMoney->setIcon(GuiIconProvider::instance()->getIcon("wallet-open")); m_ui->actionExit->setIcon(GuiIconProvider::instance()->getIcon("application-exit")); - m_ui->actionIncreasePriority->setIcon(GuiIconProvider::instance()->getIcon("go-up")); - m_ui->actionTopPriority->setIcon(GuiIconProvider::instance()->getIcon("go-top")); m_ui->actionLock->setIcon(GuiIconProvider::instance()->getIcon("object-locked")); m_ui->actionOptions->setIcon(GuiIconProvider::instance()->getIcon("configure", "preferences-system")); m_ui->actionPause->setIcon(GuiIconProvider::instance()->getIcon("media-playback-pause")); @@ -265,8 +265,8 @@ MainWindow::MainWindow(QWidget *parent) m_ui->centralWidgetLayout->addWidget(m_tabs); - m_prioSeparator = m_ui->toolBar->insertSeparator(m_ui->actionTopPriority); - m_prioSeparatorMenu = m_ui->menuEdit->insertSeparator(m_ui->actionTopPriority); + m_queueSeparator = m_ui->toolBar->insertSeparator(m_ui->actionTopQueuePos); + m_queueSeparatorMenu = m_ui->menuEdit->insertSeparator(m_ui->actionTopQueuePos); #ifdef Q_OS_MAC for (QAction *action : asConst(m_ui->toolBar->actions())) { @@ -298,10 +298,10 @@ MainWindow::MainWindow(QWidget *parent) connect(m_ui->actionPause, &QAction::triggered, m_transferListWidget, &TransferListWidget::pauseSelectedTorrents); connect(m_ui->actionPauseAll, &QAction::triggered, m_transferListWidget, &TransferListWidget::pauseAllTorrents); connect(m_ui->actionDelete, &QAction::triggered, m_transferListWidget, &TransferListWidget::softDeleteSelectedTorrents); - connect(m_ui->actionTopPriority, &QAction::triggered, m_transferListWidget, &TransferListWidget::topPrioSelectedTorrents); - connect(m_ui->actionIncreasePriority, &QAction::triggered, m_transferListWidget, &TransferListWidget::increasePrioSelectedTorrents); - connect(m_ui->actionDecreasePriority, &QAction::triggered, m_transferListWidget, &TransferListWidget::decreasePrioSelectedTorrents); - connect(m_ui->actionBottomPriority, &QAction::triggered, m_transferListWidget, &TransferListWidget::bottomPrioSelectedTorrents); + connect(m_ui->actionTopQueuePos, &QAction::triggered, m_transferListWidget, &TransferListWidget::topQueuePosSelectedTorrents); + connect(m_ui->actionIncreaseQueuePos, &QAction::triggered, m_transferListWidget, &TransferListWidget::increaseQueuePosSelectedTorrents); + connect(m_ui->actionDecreaseQueuePos, &QAction::triggered, m_transferListWidget, &TransferListWidget::decreaseQueuePosSelectedTorrents); + connect(m_ui->actionBottomQueuePos, &QAction::triggered, m_transferListWidget, &TransferListWidget::bottomQueuePosSelectedTorrents); #ifndef Q_OS_MAC connect(m_ui->actionToggleVisibility, &QAction::triggered, this, [this]() { toggleVisibility(); }); #endif @@ -875,10 +875,10 @@ void MainWindow::createKeyboardShortcuts() m_ui->actionStartAll->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_S); m_ui->actionPause->setShortcut(Qt::CTRL + Qt::Key_P); m_ui->actionPauseAll->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_P); - m_ui->actionBottomPriority->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Minus); - m_ui->actionDecreasePriority->setShortcut(Qt::CTRL + Qt::Key_Minus); - m_ui->actionIncreasePriority->setShortcut(Qt::CTRL + Qt::Key_Plus); - m_ui->actionTopPriority->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Plus); + m_ui->actionBottomQueuePos->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Minus); + m_ui->actionDecreaseQueuePos->setShortcut(Qt::CTRL + Qt::Key_Minus); + m_ui->actionIncreaseQueuePos->setShortcut(Qt::CTRL + Qt::Key_Plus); + m_ui->actionTopQueuePos->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Plus); #ifdef Q_OS_MAC m_ui->actionMinimize->setShortcut(Qt::CTRL + Qt::Key_M); addAction(m_ui->actionMinimize); @@ -1466,29 +1466,29 @@ void MainWindow::loadPreferences(bool configureSession) // Queueing System if (BitTorrent::Session::instance()->isQueueingSystemEnabled()) { - if (!m_ui->actionDecreasePriority->isVisible()) { - m_transferListWidget->hidePriorityColumn(false); - m_ui->actionDecreasePriority->setVisible(true); - m_ui->actionIncreasePriority->setVisible(true); - m_ui->actionTopPriority->setVisible(true); - m_ui->actionBottomPriority->setVisible(true); + if (!m_ui->actionDecreaseQueuePos->isVisible()) { + m_transferListWidget->hideQueuePosColumn(false); + m_ui->actionDecreaseQueuePos->setVisible(true); + m_ui->actionIncreaseQueuePos->setVisible(true); + m_ui->actionTopQueuePos->setVisible(true); + m_ui->actionBottomQueuePos->setVisible(true); #ifndef Q_OS_MAC - m_prioSeparator->setVisible(true); + m_queueSeparator->setVisible(true); #endif - m_prioSeparatorMenu->setVisible(true); + m_queueSeparatorMenu->setVisible(true); } } else { - if (m_ui->actionDecreasePriority->isVisible()) { - m_transferListWidget->hidePriorityColumn(true); - m_ui->actionDecreasePriority->setVisible(false); - m_ui->actionIncreasePriority->setVisible(false); - m_ui->actionTopPriority->setVisible(false); - m_ui->actionBottomPriority->setVisible(false); + if (m_ui->actionDecreaseQueuePos->isVisible()) { + m_transferListWidget->hideQueuePosColumn(true); + m_ui->actionDecreaseQueuePos->setVisible(false); + m_ui->actionIncreaseQueuePos->setVisible(false); + m_ui->actionTopQueuePos->setVisible(false); + m_ui->actionBottomQueuePos->setVisible(false); #ifndef Q_OS_MAC - m_prioSeparator->setVisible(false); + m_queueSeparator->setVisible(false); #endif - m_prioSeparatorMenu->setVisible(false); + m_queueSeparatorMenu->setVisible(false); } } diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index ad1566f8d..db4db8912 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -243,8 +243,8 @@ private: LineEdit *m_searchFilter; QAction *m_searchFilterAction; // Widgets - QAction *m_prioSeparator; - QAction *m_prioSeparatorMenu; + QAction *m_queueSeparator; + QAction *m_queueSeparatorMenu; QSplitter *m_splitter; QPointer m_searchWidget; QPointer m_rssWidget; diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui index e3a74ba37..d59b1e689 100644 --- a/src/gui/mainwindow.ui +++ b/src/gui/mainwindow.ui @@ -48,10 +48,10 @@ - - - - + + + + @@ -153,10 +153,10 @@ - - - - + + + + @@ -248,33 +248,45 @@ Set Global Upload Limit... - + - Minimum Priority + Bottom of Queue + + + Move to the bottom of the queue true - + - Top Priority + Top of Queue + + + Move to the top of the queue true - + - Decrease Priority + Move Down Queue + + + Move down in the queue true - + - Increase Priority + Move Up Queue + + + Move up in the queue true diff --git a/src/gui/transferlistdelegate.cpp b/src/gui/transferlistdelegate.cpp index 1ece77805..59c9015cd 100644 --- a/src/gui/transferlistdelegate.cpp +++ b/src/gui/transferlistdelegate.cpp @@ -145,10 +145,10 @@ void TransferListDelegate::paint(QPainter *painter, const QStyleOptionViewItem & QItemDelegate::drawDisplay(painter, opt, opt.rect, str); } break; - case TransferListModel::TR_PRIORITY: { - const int priority = index.data().toInt(); + case TransferListModel::TR_QUEUE_POSITION: { + const int queuePos = index.data().toInt(); opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter; - if (priority > 0) { + if (queuePos > 0) { QItemDelegate::paint(painter, opt, index); } else { diff --git a/src/gui/transferlistmodel.cpp b/src/gui/transferlistmodel.cpp index db3263dc8..8b571c895 100644 --- a/src/gui/transferlistmodel.cpp +++ b/src/gui/transferlistmodel.cpp @@ -94,7 +94,7 @@ QVariant TransferListModel::headerData(int section, Qt::Orientation orientation, if (orientation == Qt::Horizontal) { if (role == Qt::DisplayRole) { switch (section) { - case TR_PRIORITY: return QChar('#'); + case TR_QUEUE_POSITION: return QChar('#'); case TR_NAME: return tr("Name", "i.e: torrent name"); case TR_SIZE: return tr("Size", "i.e: torrent size"); case TR_PROGRESS: return tr("Done", "% Done"); @@ -147,7 +147,7 @@ QVariant TransferListModel::headerData(int section, Qt::Orientation orientation, case TR_DLLIMIT: case TR_RATIO_LIMIT: case TR_RATIO: - case TR_PRIORITY: + case TR_QUEUE_POSITION: case TR_LAST_ACTIVITY: return QVariant(Qt::AlignRight | Qt::AlignVCenter); default: @@ -178,7 +178,7 @@ QVariant TransferListModel::data(const QModelIndex &index, int role) const switch (index.column()) { case TR_NAME: return torrent->name(); - case TR_PRIORITY: + case TR_QUEUE_POSITION: return torrent->queuePosition(); case TR_SIZE: return torrent->wantedSize(); diff --git a/src/gui/transferlistmodel.h b/src/gui/transferlistmodel.h index 92ea137e7..6fee78a69 100644 --- a/src/gui/transferlistmodel.h +++ b/src/gui/transferlistmodel.h @@ -47,7 +47,7 @@ class TransferListModel : public QAbstractListModel public: enum Column { - TR_PRIORITY, + TR_QUEUE_POSITION, TR_NAME, TR_SIZE, TR_TOTAL_SIZE, diff --git a/src/gui/transferlistsortmodel.cpp b/src/gui/transferlistsortmodel.cpp index a291a06be..78a136e22 100644 --- a/src/gui/transferlistsortmodel.cpp +++ b/src/gui/transferlistsortmodel.cpp @@ -118,7 +118,7 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex return dateLessThan(sortColumn(), left, right, true); } - case TransferListModel::TR_PRIORITY: { + case TransferListModel::TR_QUEUE_POSITION: { return lowerPositionThan(left, right); } @@ -152,10 +152,10 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex if (isActiveL != isActiveR) return isActiveL; - const int prioL = model->data(model->index(left.row(), TransferListModel::TR_PRIORITY)).toInt(); - const int prioR = model->data(model->index(right.row(), TransferListModel::TR_PRIORITY)).toInt(); - const bool isSeedingL = (prioL < 0); - const bool isSeedingR = (prioR < 0); + const int queuePosL = model->data(model->index(left.row(), TransferListModel::TR_QUEUE_POSITION)).toInt(); + const int queuePosR = model->data(model->index(right.row(), TransferListModel::TR_QUEUE_POSITION)).toInt(); + const bool isSeedingL = (queuePosL < 0); + const bool isSeedingR = (queuePosR < 0); if (isSeedingL != isSeedingR) { const bool isAscendingOrder = (sortOrder() == Qt::AscendingOrder); if (isSeedingL) @@ -172,7 +172,7 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex if (isSeedingL) // Both seeding return dateLessThan(TransferListModel::TR_SEED_DATE, left, right, true); - return (prioL < prioR); + return (queuePosL < queuePosR); } if (!isInvalidL && !isInvalidR) { return (etaL < etaR); @@ -214,9 +214,9 @@ bool TransferListSortModel::lowerPositionThan(const QModelIndex &left, const QMo { const TransferListModel *model = qobject_cast(sourceModel()); - // Sort according to TR_PRIORITY - const int queueL = model->data(model->index(left.row(), TransferListModel::TR_PRIORITY)).toInt(); - const int queueR = model->data(model->index(right.row(), TransferListModel::TR_PRIORITY)).toInt(); + // Sort according to TR_QUEUE_POSITION + const int queueL = model->data(model->index(left.row(), TransferListModel::TR_QUEUE_POSITION)).toInt(); + const int queueR = model->data(model->index(right.row(), TransferListModel::TR_QUEUE_POSITION)).toInt(); if ((queueL > 0) || (queueR > 0)) { if ((queueL > 0) && (queueR > 0)) return queueL < queueR; diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index fa7ff2f64..7e57dc277 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -398,30 +398,30 @@ void TransferListWidget::deleteVisibleTorrents() BitTorrent::Session::instance()->deleteTorrent(torrent->hash(), deleteLocalFiles); } -void TransferListWidget::increasePrioSelectedTorrents() +void TransferListWidget::increaseQueuePosSelectedTorrents() { qDebug() << Q_FUNC_INFO; if (m_mainWindow->currentTabWidget() == this) - BitTorrent::Session::instance()->increaseTorrentsPriority(extractHashes(getSelectedTorrents())); + BitTorrent::Session::instance()->increaseTorrentsQueuePos(extractHashes(getSelectedTorrents())); } -void TransferListWidget::decreasePrioSelectedTorrents() +void TransferListWidget::decreaseQueuePosSelectedTorrents() { qDebug() << Q_FUNC_INFO; if (m_mainWindow->currentTabWidget() == this) - BitTorrent::Session::instance()->decreaseTorrentsPriority(extractHashes(getSelectedTorrents())); + BitTorrent::Session::instance()->decreaseTorrentsQueuePos(extractHashes(getSelectedTorrents())); } -void TransferListWidget::topPrioSelectedTorrents() +void TransferListWidget::topQueuePosSelectedTorrents() { if (m_mainWindow->currentTabWidget() == this) - BitTorrent::Session::instance()->topTorrentsPriority(extractHashes(getSelectedTorrents())); + BitTorrent::Session::instance()->topTorrentsQueuePos(extractHashes(getSelectedTorrents())); } -void TransferListWidget::bottomPrioSelectedTorrents() +void TransferListWidget::bottomQueuePosSelectedTorrents() { if (m_mainWindow->currentTabWidget() == this) - BitTorrent::Session::instance()->bottomTorrentsPriority(extractHashes(getSelectedTorrents())); + BitTorrent::Session::instance()->bottomTorrentsQueuePos(extractHashes(getSelectedTorrents())); } void TransferListWidget::copySelectedMagnetURIs() const @@ -451,12 +451,11 @@ void TransferListWidget::copySelectedHashes() const qApp->clipboard()->setText(torrentHashes.join('\n')); } -void TransferListWidget::hidePriorityColumn(bool hide) +void TransferListWidget::hideQueuePosColumn(bool hide) { - qDebug("hidePriorityColumn(%d)", hide); - setColumnHidden(TransferListModel::TR_PRIORITY, hide); - if (!hide && !columnWidth(TransferListModel::TR_PRIORITY)) - resizeColumnToContents(TransferListModel::TR_PRIORITY); + setColumnHidden(TransferListModel::TR_QUEUE_POSITION, hide); + if (!hide && (columnWidth(TransferListModel::TR_QUEUE_POSITION) == 0)) + resizeColumnToContents(TransferListModel::TR_QUEUE_POSITION); } void TransferListWidget::openSelectedTorrentsFolder() const @@ -613,7 +612,7 @@ void TransferListWidget::displayDLHoSMenu(const QPoint&) menu->setTitle(tr("Column visibility")); for (int i = 0; i < m_listModel->columnCount(); ++i) { - if (!BitTorrent::Session::instance()->isQueueingSystemEnabled() && (i == TransferListModel::TR_PRIORITY)) + if (!BitTorrent::Session::instance()->isQueueingSystemEnabled() && (i == TransferListModel::TR_QUEUE_POSITION)) continue; QAction *myAct = menu->addAction(m_listModel->headerData(i, Qt::Horizontal, Qt::DisplayRole).toString()); @@ -831,14 +830,14 @@ void TransferListWidget::displayListMenu(const QPoint &) connect(actionSetDownloadLimit, &QAction::triggered, this, &TransferListWidget::setDlLimitSelectedTorrents); auto *actionOpenDestinationFolder = new QAction(GuiIconProvider::instance()->getIcon("inode-directory"), tr("Open destination folder"), listMenu); connect(actionOpenDestinationFolder, &QAction::triggered, this, &TransferListWidget::openSelectedTorrentsFolder); - auto *actionIncreasePriority = new QAction(GuiIconProvider::instance()->getIcon("go-up"), tr("Move up", "i.e. move up in the queue"), listMenu); - connect(actionIncreasePriority, &QAction::triggered, this, &TransferListWidget::increasePrioSelectedTorrents); - auto *actionDecreasePriority = new QAction(GuiIconProvider::instance()->getIcon("go-down"), tr("Move down", "i.e. Move down in the queue"), listMenu); - connect(actionDecreasePriority, &QAction::triggered, this, &TransferListWidget::decreasePrioSelectedTorrents); - auto *actionTopPriority = new QAction(GuiIconProvider::instance()->getIcon("go-top"), tr("Move to top", "i.e. Move to top of the queue"), listMenu); - connect(actionTopPriority, &QAction::triggered, this, &TransferListWidget::topPrioSelectedTorrents); - auto *actionBottomPriority = new QAction(GuiIconProvider::instance()->getIcon("go-bottom"), tr("Move to bottom", "i.e. Move to bottom of the queue"), listMenu); - connect(actionBottomPriority, &QAction::triggered, this, &TransferListWidget::bottomPrioSelectedTorrents); + auto *actionIncreaseQueuePos = new QAction(GuiIconProvider::instance()->getIcon("go-up"), tr("Move up", "i.e. move up in the queue"), listMenu); + connect(actionIncreaseQueuePos, &QAction::triggered, this, &TransferListWidget::increaseQueuePosSelectedTorrents); + auto *actionDecreaseQueuePos = new QAction(GuiIconProvider::instance()->getIcon("go-down"), tr("Move down", "i.e. Move down in the queue"), listMenu); + connect(actionDecreaseQueuePos, &QAction::triggered, this, &TransferListWidget::decreaseQueuePosSelectedTorrents); + auto *actionTopQueuePos = new QAction(GuiIconProvider::instance()->getIcon("go-top"), tr("Move to top", "i.e. Move to top of the queue"), listMenu); + connect(actionTopQueuePos, &QAction::triggered, this, &TransferListWidget::topQueuePosSelectedTorrents); + auto *actionBottomQueuePos = new QAction(GuiIconProvider::instance()->getIcon("go-bottom"), tr("Move to bottom", "i.e. Move to bottom of the queue"), listMenu); + connect(actionBottomQueuePos, &QAction::triggered, this, &TransferListWidget::bottomQueuePosSelectedTorrents); auto *actionSetTorrentPath = new QAction(GuiIconProvider::instance()->getIcon("inode-directory"), tr("Set location..."), listMenu); connect(actionSetTorrentPath, &QAction::triggered, this, &TransferListWidget::setSelectedTorrentsLocation); auto *actionForceRecheck = new QAction(GuiIconProvider::instance()->getIcon("document-edit-verify"), tr("Force recheck"), listMenu); @@ -1075,11 +1074,11 @@ void TransferListWidget::displayListMenu(const QPoint &) listMenu->addAction(actionOpenDestinationFolder); if (BitTorrent::Session::instance()->isQueueingSystemEnabled() && oneNotSeed) { listMenu->addSeparator(); - QMenu *prioMenu = listMenu->addMenu(tr("Priority")); - prioMenu->addAction(actionTopPriority); - prioMenu->addAction(actionIncreasePriority); - prioMenu->addAction(actionDecreasePriority); - prioMenu->addAction(actionBottomPriority); + QMenu *queueMenu = listMenu->addMenu(tr("Queue")); + queueMenu->addAction(actionTopQueuePos); + queueMenu->addAction(actionIncreaseQueuePos); + queueMenu->addAction(actionDecreaseQueuePos); + queueMenu->addAction(actionBottomQueuePos); } QMenu *copySubMenu = listMenu->addMenu( diff --git a/src/gui/transferlistwidget.h b/src/gui/transferlistwidget.h index a0d7e8e13..1e626131a 100644 --- a/src/gui/transferlistwidget.h +++ b/src/gui/transferlistwidget.h @@ -71,10 +71,10 @@ public slots: void permDeleteSelectedTorrents(); void deleteSelectedTorrents(bool deleteLocalFiles); void deleteVisibleTorrents(); - void increasePrioSelectedTorrents(); - void decreasePrioSelectedTorrents(); - void topPrioSelectedTorrents(); - void bottomPrioSelectedTorrents(); + void increaseQueuePosSelectedTorrents(); + void decreaseQueuePosSelectedTorrents(); + void topQueuePosSelectedTorrents(); + void bottomQueuePosSelectedTorrents(); void copySelectedMagnetURIs() const; void copySelectedNames() const; void copySelectedHashes() const; @@ -85,7 +85,7 @@ public slots: void setUpLimitSelectedTorrents(); void setMaxRatioSelectedTorrents(); void previewSelectedTorrents(); - void hidePriorityColumn(bool hide); + void hideQueuePosColumn(bool hide); void displayDLHoSMenu(const QPoint&); void applyNameFilter(const QString &name); void applyStatusFilter(int f); diff --git a/src/webui/api/serialize/serialize_torrent.cpp b/src/webui/api/serialize/serialize_torrent.cpp index f90ee30b7..ce0f7127b 100644 --- a/src/webui/api/serialize/serialize_torrent.cpp +++ b/src/webui/api/serialize/serialize_torrent.cpp @@ -90,7 +90,7 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent) ret[KEY_TORRENT_PROGRESS] = torrent.progress(); ret[KEY_TORRENT_DLSPEED] = torrent.downloadPayloadRate(); ret[KEY_TORRENT_UPSPEED] = torrent.uploadPayloadRate(); - ret[KEY_TORRENT_PRIORITY] = static_cast(torrent.queuePosition()); + ret[KEY_TORRENT_QUEUE_POSITION] = static_cast(torrent.queuePosition()); ret[KEY_TORRENT_SEEDS] = torrent.seedsCount(); ret[KEY_TORRENT_NUM_COMPLETE] = torrent.totalSeedsCount(); ret[KEY_TORRENT_LEECHS] = torrent.leechsCount(); diff --git a/src/webui/api/serialize/serialize_torrent.h b/src/webui/api/serialize/serialize_torrent.h index 832e9e252..cb446ec76 100644 --- a/src/webui/api/serialize/serialize_torrent.h +++ b/src/webui/api/serialize/serialize_torrent.h @@ -43,7 +43,7 @@ const char KEY_TORRENT_SIZE[] = "size"; const char KEY_TORRENT_PROGRESS[] = "progress"; const char KEY_TORRENT_DLSPEED[] = "dlspeed"; const char KEY_TORRENT_UPSPEED[] = "upspeed"; -const char KEY_TORRENT_PRIORITY[] = "priority"; +const char KEY_TORRENT_QUEUE_POSITION[] = "priority"; const char KEY_TORRENT_SEEDS[] = "num_seeds"; const char KEY_TORRENT_NUM_COMPLETE[] = "num_complete"; const char KEY_TORRENT_LEECHS[] = "num_leechs"; diff --git a/src/webui/api/synccontroller.cpp b/src/webui/api/synccontroller.cpp index ce068bf1a..557cee639 100644 --- a/src/webui/api/synccontroller.cpp +++ b/src/webui/api/synccontroller.cpp @@ -362,7 +362,7 @@ SyncController::~SyncController() // - "progress": Torrent progress // - "dlspeed": Torrent download speed // - "upspeed": Torrent upload speed -// - "priority": Torrent priority (-1 if queuing is disabled) +// - "priority": Torrent queue position (-1 if queuing is disabled) // - "num_seeds": Torrent seeds connected to // - "num_complete": Torrent seeds in the swarm // - "num_leechs": Torrent leechers connected to @@ -399,7 +399,7 @@ SyncController::~SyncController() // - "up_info_data: bytes uploaded // - "up_info_speed: upload speed // - "up_rate_limit: upload speed limit -// - "queueing": priority system usage flag +// - "queueing": queue system usage flag // - "refresh_interval": torrents table refresh interval // - "free_space_on_disk": Free space on the default save path // GET param: diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index 7b6ae75ca..35561b10e 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -207,7 +207,7 @@ namespace // - "progress": Torrent progress // - "dlspeed": Torrent download speed // - "upspeed": Torrent upload speed -// - "priority": Torrent priority (-1 if queuing is disabled) +// - "priority": Torrent queue position (-1 if queuing is disabled) // - "num_seeds": Torrent seeds connected to // - "num_complete": Torrent seeds in the swarm // - "num_leechs": Torrent leechers connected to @@ -864,7 +864,7 @@ void TorrentsController::increasePrioAction() throw APIError(APIErrorType::Conflict, tr("Torrent queueing must be enabled")); const QStringList hashes {params()["hashes"].split('|')}; - BitTorrent::Session::instance()->increaseTorrentsPriority(hashes); + BitTorrent::Session::instance()->increaseTorrentsQueuePos(hashes); } void TorrentsController::decreasePrioAction() @@ -875,7 +875,7 @@ void TorrentsController::decreasePrioAction() throw APIError(APIErrorType::Conflict, tr("Torrent queueing must be enabled")); const QStringList hashes {params()["hashes"].split('|')}; - BitTorrent::Session::instance()->decreaseTorrentsPriority(hashes); + BitTorrent::Session::instance()->decreaseTorrentsQueuePos(hashes); } void TorrentsController::topPrioAction() @@ -886,7 +886,7 @@ void TorrentsController::topPrioAction() throw APIError(APIErrorType::Conflict, tr("Torrent queueing must be enabled")); const QStringList hashes {params()["hashes"].split('|')}; - BitTorrent::Session::instance()->topTorrentsPriority(hashes); + BitTorrent::Session::instance()->topTorrentsQueuePos(hashes); } void TorrentsController::bottomPrioAction() @@ -897,7 +897,7 @@ void TorrentsController::bottomPrioAction() throw APIError(APIErrorType::Conflict, tr("Torrent queueing must be enabled")); const QStringList hashes {params()["hashes"].split('|')}; - BitTorrent::Session::instance()->bottomTorrentsPriority(hashes); + BitTorrent::Session::instance()->bottomTorrentsQueuePos(hashes); } void TorrentsController::setLocationAction() diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index 2dde7917c..dd09fb583 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -56,10 +56,10 @@
  • QBT_TR(Resume)QBT_TR[CONTEXT=MainWindow]QBT_TR(Resume)QBT_TR[CONTEXT=MainWindow]
  • QBT_TR(Pause)QBT_TR[CONTEXT=MainWindow]QBT_TR(Pause)QBT_TR[CONTEXT=MainWindow]
  • QBT_TR(Delete)QBT_TR[CONTEXT=MainWindow]QBT_TR(Delete)QBT_TR[CONTEXT=MainWindow]
  • -
  • QBT_TR(Top Priority)QBT_TR[CONTEXT=MainWindow]QBT_TR(Top Priority)QBT_TR[CONTEXT=MainWindow]
  • -
  • QBT_TR(Increase Priority)QBT_TR[CONTEXT=MainWindow]QBT_TR(Increase Priority)QBT_TR[CONTEXT=MainWindow]
  • -
  • QBT_TR(Decrease Priority)QBT_TR[CONTEXT=MainWindow]QBT_TR(Decrease Priority)QBT_TR[CONTEXT=MainWindow]
  • -
  • QBT_TR(Minimum Priority)QBT_TR[CONTEXT=MainWindow]QBT_TR(Minimum Priority)QBT_TR[CONTEXT=MainWindow]
  • +
  • QBT_TR(Top of Queue)QBT_TR[CONTEXT=MainWindow]QBT_TR(Top of Queue)QBT_TR[CONTEXT=MainWindow]
  • +
  • QBT_TR(Move Up Queue)QBT_TR[CONTEXT=MainWindow]QBT_TR(Move Up Queue)QBT_TR[CONTEXT=MainWindow]
  • +
  • QBT_TR(Move Down Queue)QBT_TR[CONTEXT=MainWindow]QBT_TRMove Down Queue)QBT_TR[CONTEXT=MainWindow]
  • +
  • QBT_TR(Bottom of Queue)QBT_TR[CONTEXT=MainWindow]QBT_TR(Bottom of Queue)QBT_TR[CONTEXT=MainWindow]
  • QBT_TR(Force Recheck)QBT_TR[CONTEXT=TransferListWidget]QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget]
  • @@ -97,10 +97,10 @@ QBT_TR(Resume)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Pause)QBT_TR[CONTEXT=TransferListWidget] - QBT_TR(Top Priority)QBT_TR[CONTEXT=MainWindow] - QBT_TR(Increase Priority)QBT_TR[CONTEXT=MainWindow] - QBT_TR(Decrease Priority)QBT_TR[CONTEXT=MainWindow] - QBT_TR(Minimum Priority)QBT_TR[CONTEXT=MainWindow] + QBT_TR(Top of Queue)QBT_TR[CONTEXT=MainWindow] + QBT_TR(Move Up Queue)QBT_TR[CONTEXT=MainWindow] + QBT_TR(Move Down Queue)QBT_TR[CONTEXT=MainWindow] + QBT_TR(Bottom of Queue)QBT_TR[CONTEXT=MainWindow] QBT_TR(Options)QBT_TR[CONTEXT=OptionsDialog]
    @@ -143,12 +143,12 @@
  • QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget]
  • QBT_TR(Force reannounce)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Force reannounce)QBT_TR[CONTEXT=TransferListWidget]
  • - QBT_TR(Priority)QBT_TR[CONTEXT=TransferListWidget] + QBT_TR(Queue)QBT_TR[CONTEXT=TransferListWidget]
  • QBT_TR(Copy name)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Copy name)QBT_TR[CONTEXT=TransferListWidget]
  • diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js index 20c5f7647..0137e49bc 100644 --- a/src/webui/www/private/scripts/client.js +++ b/src/webui/www/private/scripts/client.js @@ -509,18 +509,18 @@ window.addEvent('load', function() { torrentsTable.columns['priority'].force_hide = !queueing_enabled; torrentsTable.updateColumn('priority'); if (queueing_enabled) { - $('topPrioItem').removeClass('invisible'); - $('increasePrioItem').removeClass('invisible'); - $('decreasePrioItem').removeClass('invisible'); - $('bottomPrioItem').removeClass('invisible'); + $('topQueuePosItem').removeClass('invisible'); + $('increaseQueuePosItem').removeClass('invisible'); + $('decreaseQueuePosItem').removeClass('invisible'); + $('bottomQueuePosItem').removeClass('invisible'); $('queueingButtons').removeClass('invisible'); $('queueingMenuItems').removeClass('invisible'); } else { - $('topPrioItem').addClass('invisible'); - $('increasePrioItem').addClass('invisible'); - $('decreasePrioItem').addClass('invisible'); - $('bottomPrioItem').addClass('invisible'); + $('topQueuePosItem').addClass('invisible'); + $('increaseQueuePosItem').addClass('invisible'); + $('decreaseQueuePosItem').addClass('invisible'); + $('bottomQueuePosItem').addClass('invisible'); $('queueingButtons').addClass('invisible'); $('queueingMenuItems').addClass('invisible'); } diff --git a/src/webui/www/private/scripts/dynamicTable.js b/src/webui/www/private/scripts/dynamicTable.js index f8c639cd9..784bdd7d0 100644 --- a/src/webui/www/private/scripts/dynamicTable.js +++ b/src/webui/www/private/scripts/dynamicTable.js @@ -959,10 +959,10 @@ var TorrentsTable = new Class({ // priority this.columns['priority'].updateTd = function(td, row) { - const priority = this.getRowValue(row); - const formattedPriority = (priority < 1) ? '*' : priority; - td.set('html', formattedPriority); - td.set('title', formattedPriority); + const queuePos = this.getRowValue(row); + const formattedQueuePos = (queuePos < 1) ? '*' : queuePos; + td.set('html', formattedQueuePos); + td.set('title', formattedQueuePos); }; this.columns['priority'].compareRows = function(row1, row2) { diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js index abd3701f7..bde8beb9c 100644 --- a/src/webui/www/private/scripts/mocha-init.js +++ b/src/webui/www/private/scripts/mocha-init.js @@ -93,7 +93,7 @@ var deleteTorrentsByCategoryFN = function() {}; var copyNameFN = function() {}; var copyMagnetLinkFN = function() {}; var copyHashFN = function() {}; -var setPriorityFN = function() {}; +var setQueuePositionFN = function() {}; var initializeWindows = function() { saveWindowSize = function(windowId) { @@ -742,11 +742,11 @@ var initializeWindows = function() { ['decreasePrio', 'increasePrio', 'topPrio', 'bottomPrio'].each(function(item) { addClickEvent(item, function(e) { new Event(e).stop(); - setPriorityFN(item); + setQueuePositionFN(item); }); }); - setPriorityFN = function(cmd) { + setQueuePositionFN = function(cmd) { var hashes = torrentsTable.selectedRowsIds(); if (hashes.length) { new Request({ diff --git a/src/webui/www/private/transferlist.html b/src/webui/www/private/transferlist.html index 25307ade8..7e7f69200 100644 --- a/src/webui/www/private/transferlist.html +++ b/src/webui/www/private/transferlist.html @@ -44,17 +44,17 @@ Rename: function(element, ref) { renameFN(); }, - prioTop: function(element, ref) { - setPriorityFN('topPrio'); + QueueTop: function(element, ref) { + setQueuePositionFN('topPrio'); }, - prioUp: function(element, ref) { - setPriorityFN('increasePrio'); + QueueUp: function(element, ref) { + setQueuePositionFN('increasePrio'); }, - prioDown: function(element, ref) { - setPriorityFN('decreasePrio'); + QueueDown: function(element, ref) { + setQueuePositionFN('decreasePrio'); }, - prioBottom: function(element, ref) { - setPriorityFN('bottomPrio'); + QueueBottom: function(element, ref) { + setQueuePositionFN('bottomPrio'); }, DownloadLimit: function(element, ref) {