Browse Source

Rename priority to queue in the context of torrents

adaptive-webui-19844
thalieht 6 years ago
parent
commit
7b31868e3c
  1. 30
      src/base/bittorrent/session.cpp
  2. 8
      src/base/bittorrent/session.h
  3. 60
      src/gui/mainwindow.cpp
  4. 4
      src/gui/mainwindow.h
  5. 44
      src/gui/mainwindow.ui
  6. 6
      src/gui/transferlistdelegate.cpp
  7. 6
      src/gui/transferlistmodel.cpp
  8. 2
      src/gui/transferlistmodel.h
  9. 18
      src/gui/transferlistsortmodel.cpp
  10. 53
      src/gui/transferlistwidget.cpp
  11. 10
      src/gui/transferlistwidget.h
  12. 2
      src/webui/api/serialize/serialize_torrent.cpp
  13. 2
      src/webui/api/serialize/serialize_torrent.h
  14. 4
      src/webui/api/synccontroller.cpp
  15. 10
      src/webui/api/torrentscontroller.cpp
  16. 26
      src/webui/www/private/index.html
  17. 16
      src/webui/www/private/scripts/client.js
  18. 8
      src/webui/www/private/scripts/dynamicTable.js
  19. 6
      src/webui/www/private/scripts/mocha-init.js
  20. 16
      src/webui/www/private/transferlist.html

30
src/base/bittorrent/session.cpp

@ -116,7 +116,7 @@ namespace @@ -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) @@ -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<QPair<int, TorrentHandle *>,
std::vector<QPair<int, TorrentHandle *>>,
std::greater<QPair<int, TorrentHandle *>>> 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) @@ -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<QPair<int, TorrentHandle *>,
std::vector<QPair<int, TorrentHandle *>>,
std::less<QPair<int, TorrentHandle *>>> 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) @@ -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<QPair<int, TorrentHandle *>,
std::vector<QPair<int, TorrentHandle *>>,
std::greater<QPair<int, TorrentHandle *>>> 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) @@ -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<QPair<int, TorrentHandle *>,
std::vector<QPair<int, TorrentHandle *>>,
std::less<QPair<int, TorrentHandle *>>> 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 @@ -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 @@ -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;
}

8
src/base/bittorrent/session.h

@ -421,10 +421,10 @@ namespace BitTorrent @@ -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);

60
src/gui/mainwindow.cpp

@ -171,14 +171,14 @@ MainWindow::MainWindow(QWidget *parent) @@ -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) @@ -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) @@ -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() @@ -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) @@ -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);
}
}

4
src/gui/mainwindow.h

@ -243,8 +243,8 @@ private: @@ -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<SearchWidget> m_searchWidget;
QPointer<RSSWidget> m_rssWidget;

44
src/gui/mainwindow.ui

@ -48,10 +48,10 @@ @@ -48,10 +48,10 @@
<addaction name="actionPauseAll"/>
<addaction name="separator"/>
<addaction name="actionDelete"/>
<addaction name="actionTopPriority"/>
<addaction name="actionIncreasePriority"/>
<addaction name="actionDecreasePriority"/>
<addaction name="actionBottomPriority"/>
<addaction name="actionTopQueuePos"/>
<addaction name="actionIncreaseQueuePos"/>
<addaction name="actionDecreaseQueuePos"/>
<addaction name="actionBottomQueuePos"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
@ -153,10 +153,10 @@ @@ -153,10 +153,10 @@
<addaction name="separator"/>
<addaction name="actionStart"/>
<addaction name="actionPause"/>
<addaction name="actionTopPriority"/>
<addaction name="actionIncreasePriority"/>
<addaction name="actionDecreasePriority"/>
<addaction name="actionBottomPriority"/>
<addaction name="actionTopQueuePos"/>
<addaction name="actionIncreaseQueuePos"/>
<addaction name="actionDecreaseQueuePos"/>
<addaction name="actionBottomQueuePos"/>
<addaction name="separator"/>
<addaction name="actionOptions"/>
<addaction name="actionLock"/>
@ -248,33 +248,45 @@ @@ -248,33 +248,45 @@
<string>Set Global Upload Limit...</string>
</property>
</action>
<action name="actionBottomPriority">
<action name="actionBottomQueuePos">
<property name="text">
<string>Minimum Priority</string>
<string>Bottom of Queue</string>
</property>
<property name="toolTip">
<string>Move to the bottom of the queue</string>
</property>
<property name="visible">
<bool>true</bool>
</property>
</action>
<action name="actionTopPriority">
<action name="actionTopQueuePos">
<property name="text">
<string>Top Priority</string>
<string>Top of Queue</string>
</property>
<property name="toolTip">
<string>Move to the top of the queue</string>
</property>
<property name="visible">
<bool>true</bool>
</property>
</action>
<action name="actionDecreasePriority">
<action name="actionDecreaseQueuePos">
<property name="text">
<string>Decrease Priority</string>
<string>Move Down Queue</string>
</property>
<property name="toolTip">
<string>Move down in the queue</string>
</property>
<property name="visible">
<bool>true</bool>
</property>
</action>
<action name="actionIncreasePriority">
<action name="actionIncreaseQueuePos">
<property name="text">
<string>Increase Priority</string>
<string>Move Up Queue</string>
</property>
<property name="toolTip">
<string>Move up in the queue</string>
</property>
<property name="visible">
<bool>true</bool>

6
src/gui/transferlistdelegate.cpp

@ -145,10 +145,10 @@ void TransferListDelegate::paint(QPainter *painter, const QStyleOptionViewItem & @@ -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 {

6
src/gui/transferlistmodel.cpp

@ -94,7 +94,7 @@ QVariant TransferListModel::headerData(int section, Qt::Orientation orientation, @@ -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, @@ -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 @@ -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();

2
src/gui/transferlistmodel.h

@ -47,7 +47,7 @@ class TransferListModel : public QAbstractListModel @@ -47,7 +47,7 @@ class TransferListModel : public QAbstractListModel
public:
enum Column
{
TR_PRIORITY,
TR_QUEUE_POSITION,
TR_NAME,
TR_SIZE,
TR_TOTAL_SIZE,

18
src/gui/transferlistsortmodel.cpp

@ -118,7 +118,7 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex @@ -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 @@ -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 @@ -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 @@ -214,9 +214,9 @@ bool TransferListSortModel::lowerPositionThan(const QModelIndex &left, const QMo
{
const TransferListModel *model = qobject_cast<TransferListModel *>(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;

53
src/gui/transferlistwidget.cpp

@ -398,30 +398,30 @@ void TransferListWidget::deleteVisibleTorrents() @@ -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 @@ -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&) @@ -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 &) @@ -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 &) @@ -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(

10
src/gui/transferlistwidget.h

@ -71,10 +71,10 @@ public slots: @@ -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: @@ -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);

2
src/webui/api/serialize/serialize_torrent.cpp

@ -90,7 +90,7 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent) @@ -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<int>(torrent.queuePosition());
ret[KEY_TORRENT_QUEUE_POSITION] = static_cast<int>(torrent.queuePosition());
ret[KEY_TORRENT_SEEDS] = torrent.seedsCount();
ret[KEY_TORRENT_NUM_COMPLETE] = torrent.totalSeedsCount();
ret[KEY_TORRENT_LEECHS] = torrent.leechsCount();

2
src/webui/api/serialize/serialize_torrent.h

@ -43,7 +43,7 @@ const char KEY_TORRENT_SIZE[] = "size"; @@ -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";

4
src/webui/api/synccontroller.cpp

@ -362,7 +362,7 @@ SyncController::~SyncController() @@ -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() @@ -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:

10
src/webui/api/torrentscontroller.cpp

@ -207,7 +207,7 @@ namespace @@ -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() @@ -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() @@ -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() @@ -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() @@ -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()

26
src/webui/www/private/index.html

@ -56,10 +56,10 @@ @@ -56,10 +56,10 @@
<li class="divider"><a id="resumeLink"><img class="MyMenuIcon" alt="QBT_TR(Resume)QBT_TR[CONTEXT=MainWindow]" src="images/qbt-theme/media-playback-start.svg" width="16" height="16"/>QBT_TR(Resume)QBT_TR[CONTEXT=MainWindow]</a></li>
<li><a id="pauseLink"><img class="MyMenuIcon" src="images/qbt-theme/media-playback-pause.svg" alt="QBT_TR(Pause)QBT_TR[CONTEXT=MainWindow]" width="16" height="16"/>QBT_TR(Pause)QBT_TR[CONTEXT=MainWindow]</a></li>
<li class="divider"><a id="deleteLink"><img class="MyMenuIcon" src="images/qbt-theme/list-remove.svg" alt="QBT_TR(Delete)QBT_TR[CONTEXT=MainWindow]" width="16" height="16"/>QBT_TR(Delete)QBT_TR[CONTEXT=MainWindow]</a></li>
<li id="topPrioItem" class="divider"><a id="topPrioLink"><img class="MyMenuIcon" src="images/qbt-theme/go-top.svg" alt="QBT_TR(Top Priority)QBT_TR[CONTEXT=MainWindow]" width="16" height="16"/>QBT_TR(Top Priority)QBT_TR[CONTEXT=MainWindow]</a></li>
<li id="increasePrioItem"><a id="increasePrioLink"><img class="MyMenuIcon" src="images/qbt-theme/go-up.svg" alt="QBT_TR(Increase Priority)QBT_TR[CONTEXT=MainWindow]" width="16" height="16"/>QBT_TR(Increase Priority)QBT_TR[CONTEXT=MainWindow]</a></li>
<li id="decreasePrioItem"><a id="decreasePrioLink"><img class="MyMenuIcon" src="images/qbt-theme/go-down.svg" alt="QBT_TR(Decrease Priority)QBT_TR[CONTEXT=MainWindow]" width="16" height="16"/>QBT_TR(Decrease Priority)QBT_TR[CONTEXT=MainWindow]</a></li>
<li id="bottomPrioItem"><a id="bottomPrioLink"><img class="MyMenuIcon" src="images/qbt-theme/go-bottom.svg" alt="QBT_TR(Minimum Priority)QBT_TR[CONTEXT=MainWindow]" width="16" height="16"/>QBT_TR(Minimum Priority)QBT_TR[CONTEXT=MainWindow]</a></li>
<li id="topQueuePosItem" class="divider"><a id="topPrioLink"><img class="MyMenuIcon" src="images/qbt-theme/go-top.svg" alt="QBT_TR(Top of Queue)QBT_TR[CONTEXT=MainWindow]" width="16" height="16"/>QBT_TR(Top of Queue)QBT_TR[CONTEXT=MainWindow]</a></li>
<li id="increaseQueuePosItem"><a id="increasePrioLink"><img class="MyMenuIcon" src="images/qbt-theme/go-up.svg" alt="QBT_TR(Move Up Queue)QBT_TR[CONTEXT=MainWindow]" width="16" height="16"/>QBT_TR(Move Up Queue)QBT_TR[CONTEXT=MainWindow]</a></li>
<li id="decreaseQueuePosItem"><a id="decreasePrioLink"><img class="MyMenuIcon" src="images/qbt-theme/go-down.svg" alt="QBT_TR(Move Down Queue)QBT_TR[CONTEXT=MainWindow]" width="16" height="16"/>QBT_TRMove Down Queue)QBT_TR[CONTEXT=MainWindow]</a></li>
<li id="bottomQueuePosItem"><a id="bottomPrioLink"><img class="MyMenuIcon" src="images/qbt-theme/go-bottom.svg" alt="QBT_TR(Bottom of Queue)QBT_TR[CONTEXT=MainWindow]" width="16" height="16"/>QBT_TR(Bottom of Queue)QBT_TR[CONTEXT=MainWindow]</a></li>
<li class="divider"><a id="recheckLink"><img class="MyMenuIcon" src="images/qbt-theme/document-edit-verify.svg" alt="QBT_TR(Force Recheck)QBT_TR[CONTEXT=TransferListWidget]" width="16" height="16"/>QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget]</a></li>
</ul>
</li>
@ -97,10 +97,10 @@ @@ -97,10 +97,10 @@
<a id="resumeButton" class="divider"><img class="mochaToolButton" title="QBT_TR(Resume)QBT_TR[CONTEXT=TransferListWidget]" src="images/qbt-theme/media-playback-start.svg" alt="QBT_TR(Resume)QBT_TR[CONTEXT=TransferListWidget]" width="24" height="24"/></a>
<a id="pauseButton"><img class="mochaToolButton" title="QBT_TR(Pause)QBT_TR[CONTEXT=TransferListWidget]" src="images/qbt-theme/media-playback-pause.svg" alt="QBT_TR(Pause)QBT_TR[CONTEXT=TransferListWidget]" width="24" height="24"/></a>
<span id="queueingButtons">
<a id="topPrioButton" class="divider"><img class="mochaToolButton" title="QBT_TR(Top Priority)QBT_TR[CONTEXT=MainWindow]" src="images/qbt-theme/go-top.svg" alt="QBT_TR(Top Priority)QBT_TR[CONTEXT=MainWindow]" width="24" height="24"/></a>
<a id="increasePrioButton"><img class="mochaToolButton" title="QBT_TR(Increase Priority)QBT_TR[CONTEXT=MainWindow]" src="images/qbt-theme/go-up.svg" alt="QBT_TR(Increase Priority)QBT_TR[CONTEXT=MainWindow]" width="24" height="24"/></a>
<a id="decreasePrioButton"><img class="mochaToolButton" title="QBT_TR(Decrease Priority)QBT_TR[CONTEXT=MainWindow]" src="images/qbt-theme/go-down.svg" alt="QBT_TR(Decrease Priority)QBT_TR[CONTEXT=MainWindow]" width="24" height="24"/></a>
<a id="bottomPrioButton"><img class="mochaToolButton" title="QBT_TR(Minimum Priority)QBT_TR[CONTEXT=MainWindow]" src="images/qbt-theme/go-bottom.svg" alt="QBT_TR(Minimum Priority)QBT_TR[CONTEXT=MainWindow]" width="24" height="24"/></a>
<a id="topPrioButton" class="divider"><img class="mochaToolButton" title="QBT_TR(Move to the top of the queue)QBT_TR[CONTEXT=MainWindow]" src="images/qbt-theme/go-top.svg" alt="QBT_TR(Top of Queue)QBT_TR[CONTEXT=MainWindow]" width="24" height="24"/></a>
<a id="increasePrioButton"><img class="mochaToolButton" title="QBT_TR(Move up in the queue)QBT_TR[CONTEXT=MainWindow]" src="images/qbt-theme/go-up.svg" alt="QBT_TR(Move Up Queue)QBT_TR[CONTEXT=MainWindow]" width="24" height="24"/></a>
<a id="decreasePrioButton"><img class="mochaToolButton" title="QBT_TR(Move down in the queue)QBT_TR[CONTEXT=MainWindow]" src="images/qbt-theme/go-down.svg" alt="QBT_TR(Move Down Queue)QBT_TR[CONTEXT=MainWindow]" width="24" height="24"/></a>
<a id="bottomPrioButton"><img class="mochaToolButton" title="QBT_TR(Move to the bottom of the queue)QBT_TR[CONTEXT=MainWindow]" src="images/qbt-theme/go-bottom.svg" alt="QBT_TR(Bottom of Queue)QBT_TR[CONTEXT=MainWindow]" width="24" height="24"/></a>
</span>
<a id="preferencesButton" class="divider"><img class="mochaToolButton" title="QBT_TR(Options)QBT_TR[CONTEXT=OptionsDialog]" src="images/qbt-theme/configure.svg" alt="QBT_TR(Options)QBT_TR[CONTEXT=OptionsDialog]" width="24" height="24"/></a>
<div id="mainWindowTabs" class="toolbarTabs">
@ -143,12 +143,12 @@ @@ -143,12 +143,12 @@
<li class="separator"><a href="#ForceRecheck"><img src="images/qbt-theme/document-edit-verify.svg" alt="QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#ForceReannounce"><img src="images/qbt-theme/document-edit-verify.svg" alt="QBT_TR(Force reannounce)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Force reannounce)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li id="queueingMenuItems" class="separator">
<a href="#priority" class="arrow-right"><span style="display: inline-block; width:16px"></span> QBT_TR(Priority)QBT_TR[CONTEXT=TransferListWidget]</a>
<a href="#queue" class="arrow-right"><span style="display: inline-block; width:16px"></span> QBT_TR(Queue)QBT_TR[CONTEXT=TransferListWidget]</a>
<ul>
<li><a href="#prioTop"><img src="images/qbt-theme/go-top.svg" alt="QBT_TR(Move to top)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Move to top)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#prioUp"><img src="images/qbt-theme/go-up.svg" alt="QBT_TR(Move up)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Move up)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#prioDown"><img src="images/qbt-theme/go-down.svg" alt="QBT_TR(Move down)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Move down)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#prioBottom"><img src="images/qbt-theme/go-bottom.svg" alt="QBT_TR(Move to bottom)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Move to bottom)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#QueueTop"><img src="images/qbt-theme/go-top.svg" alt="QBT_TR(Move to top)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Move to top)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#QueueUp"><img src="images/qbt-theme/go-up.svg" alt="QBT_TR(Move up)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Move up)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#QueueDown"><img src="images/qbt-theme/go-down.svg" alt="QBT_TR(Move down)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Move down)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#QueueBottom"><img src="images/qbt-theme/go-bottom.svg" alt="QBT_TR(Move to bottom)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Move to bottom)QBT_TR[CONTEXT=TransferListWidget]</a></li>
</ul>
</li>
<li class="separator"><a href="#" id="CopyName" class="copyToClipboard"><img src="images/qbt-theme/edit-copy.svg" alt="QBT_TR(Copy name)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Copy name)QBT_TR[CONTEXT=TransferListWidget]</a></li>

16
src/webui/www/private/scripts/client.js

@ -509,18 +509,18 @@ window.addEvent('load', function() { @@ -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');
}

8
src/webui/www/private/scripts/dynamicTable.js

@ -959,10 +959,10 @@ var TorrentsTable = new Class({ @@ -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) {

6
src/webui/www/private/scripts/mocha-init.js

@ -93,7 +93,7 @@ var deleteTorrentsByCategoryFN = function() {}; @@ -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() { @@ -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({

16
src/webui/www/private/transferlist.html

@ -44,17 +44,17 @@ @@ -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) {

Loading…
Cancel
Save