Browse Source

Merge pull request #9995 from thalieht/rename-queue

Rename priority to queue in the context of torrents
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
75a2274b66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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. 14
      src/webui/www/private/filters.html
  17. 76
      src/webui/www/private/index.html
  18. 22
      src/webui/www/private/scripts/client.js
  19. 60
      src/webui/www/private/scripts/contextmenu.js
  20. 8
      src/webui/www/private/scripts/dynamicTable.js
  21. 6
      src/webui/www/private/scripts/mocha-init.js
  22. 48
      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()

14
src/webui/www/private/filters.html

@ -29,25 +29,25 @@ @@ -29,25 +29,25 @@
targets: '.categoriesFilterContextMenuTarget',
menu: 'categoriesFilterMenu',
actions: {
CreateCategory: function(element, ref) {
createCategory: function(element, ref) {
createCategoryFN();
},
EditCategory: function(element, ref) {
editCategory: function(element, ref) {
editCategoryFN(element.id);
},
DeleteCategory: function(element, ref) {
deleteCategory: function(element, ref) {
removeCategoryFN(element.id);
},
DeleteUnusedCategories: function(element, ref) {
deleteUnusedCategories: function(element, ref) {
deleteUnusedCategoriesFN();
},
StartTorrentsByCategory: function(element, ref) {
startTorrentsByCategory: function(element, ref) {
startTorrentsByCategoryFN(element.id);
},
PauseTorrentsByCategory: function(element, ref) {
pauseTorrentsByCategory: function(element, ref) {
pauseTorrentsByCategoryFN(element.id);
},
DeleteTorrentsByCategory: function(element, ref) {
deleteTorrentsByCategory: function(element, ref) {
deleteTorrentsByCategoryFN(element.id);
}
},

76
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">
@ -119,50 +119,50 @@ @@ -119,50 +119,50 @@
</div>
</div>
<ul id="torrentsTableMenu" class="contextMenu">
<li><a href="#Start"><img src="images/qbt-theme/media-playback-start.svg" alt="QBT_TR(Resume)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Resume)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#Pause"><img src="images/qbt-theme/media-playback-pause.svg" alt="QBT_TR(Pause)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Pause)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#ForceStart"><img src="images/qbt-theme/media-seek-forward.svg" alt="QBT_TR(Force Resume)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Force Resume)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li class="separator"><a href="#Delete"><img src="images/qbt-theme/list-remove.svg" alt="QBT_TR(Delete)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Delete)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#start"><img src="images/qbt-theme/media-playback-start.svg" alt="QBT_TR(Resume)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Resume)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#pause"><img src="images/qbt-theme/media-playback-pause.svg" alt="QBT_TR(Pause)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Pause)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#forceStart"><img src="images/qbt-theme/media-seek-forward.svg" alt="QBT_TR(Force Resume)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Force Resume)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li class="separator"><a href="#delete"><img src="images/qbt-theme/list-remove.svg" alt="QBT_TR(Delete)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Delete)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li class="separator">
<a href="#SetLocation"><img src="images/qbt-theme/inode-directory.svg" alt="QBT_TR(Set location...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Set location...)QBT_TR[CONTEXT=TransferListWidget]</a>
<a href="#Rename"><img src="images/qbt-theme/edit-rename.svg" alt="QBT_TR(Rename...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Rename...)QBT_TR[CONTEXT=TransferListWidget]</a>
<a href="#setLocation"><img src="images/qbt-theme/inode-directory.svg" alt="QBT_TR(Set location...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Set location...)QBT_TR[CONTEXT=TransferListWidget]</a>
<a href="#rename"><img src="images/qbt-theme/edit-rename.svg" alt="QBT_TR(Rename...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Rename...)QBT_TR[CONTEXT=TransferListWidget]</a>
</li>
<li>
<a href="#Category" class="arrow-right"><img src="images/qbt-theme/view-categories.svg" alt="QBT_TR(Category)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Category)QBT_TR[CONTEXT=TransferListWidget]</a>
<ul id="contextCategoryList" class="scrollableMenu"></ul>
</li>
<li>
<a href="#AutoTorrentManagement"><img src="images/qbt-theme/checked.svg" alt="QBT_TR(Automatic Torrent Management)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Automatic Torrent Management)QBT_TR[CONTEXT=TransferListWidget]</a>
<a href="#autoTorrentManagement"><img src="images/qbt-theme/checked.svg" alt="QBT_TR(Automatic Torrent Management)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Automatic Torrent Management)QBT_TR[CONTEXT=TransferListWidget]</a>
</li>
<li class="separator"><a href="#DownloadLimit"><img src="images/qbt-theme/kt-set-max-download-speed.svg" alt="QBT_TR(Limit download rate...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Limit download rate...)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#UploadLimit"><img src="images/qbt-theme/kt-set-max-upload-speed.svg" alt="QBT_TR(Limit upload rate...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Limit upload rate...)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#ShareRatio"><img src="images/skin/ratio.svg" alt="QBT_TR(Limit share ratio...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Limit share ratio...)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#SuperSeeding"><img src="images/qbt-theme/checked.svg" alt="QBT_TR(Super seeding mode)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Super seeding mode)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li class="separator"><a href="#SequentialDownload"><img src="images/qbt-theme/checked.svg" alt="QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#FirstLastPiecePrio"><img src="images/qbt-theme/checked.svg" alt="QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<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 class="separator"><a href="#downloadLimit"><img src="images/qbt-theme/kt-set-max-download-speed.svg" alt="QBT_TR(Limit download rate...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Limit download rate...)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#uploadLimit"><img src="images/qbt-theme/kt-set-max-upload-speed.svg" alt="QBT_TR(Limit upload rate...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Limit upload rate...)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#shareRatio"><img src="images/skin/ratio.svg" alt="QBT_TR(Limit share ratio...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Limit share ratio...)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#superSeeding"><img src="images/qbt-theme/checked.svg" alt="QBT_TR(Super seeding mode)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Super seeding mode)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li class="separator"><a href="#sequentialDownload"><img src="images/qbt-theme/checked.svg" alt="QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#firstLastPiecePrio"><img src="images/qbt-theme/checked.svg" alt="QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<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>
<li><a href="#" id="CopyHash" class="copyToClipboard"><img src="images/qbt-theme/edit-copy.svg" alt="QBT_TR(Copy hash)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Copy hash)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#" id="CopyMagnetLink" class="copyToClipboard"><img src="images/qbt-theme/kt-magnet.svg" alt="QBT_TR(Copy magnet link)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Copy magnet link)QBT_TR[CONTEXT=TransferListWidget]</a></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>
<li><a href="#" id="copyHash" class="copyToClipboard"><img src="images/qbt-theme/edit-copy.svg" alt="QBT_TR(Copy hash)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Copy hash)QBT_TR[CONTEXT=TransferListWidget]</a></li>
<li><a href="#" id="copyMagnetLink" class="copyToClipboard"><img src="images/qbt-theme/kt-magnet.svg" alt="QBT_TR(Copy magnet link)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Copy magnet link)QBT_TR[CONTEXT=TransferListWidget]</a></li>
</ul>
<ul id="categoriesFilterMenu" class="contextMenu">
<li><a href="#CreateCategory"><img src="images/qbt-theme/list-add.svg" alt="QBT_TR(Add category...)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Add category...)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li><a href="#EditCategory"><img src="images/qbt-theme/document-edit.svg" alt="QBT_TR(Edit category...)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Edit category...)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li><a href="#DeleteCategory"><img src="images/qbt-theme/list-remove.svg" alt="QBT_TR(Remove category)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Remove category)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li><a href="#DeleteUnusedCategories"><img src="images/qbt-theme/list-remove.svg" alt="QBT_TR(Remove unused categories)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Remove unused categories)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li class="separator"><a href="#StartTorrentsByCategory"><img src="images/qbt-theme/media-playback-start.svg" alt="QBT_TR(Resume torrents)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Resume torrents)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li><a href="#PauseTorrentsByCategory"><img src="images/qbt-theme/media-playback-pause.svg" alt="QBT_TR(Pause torrents)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Pause torrents)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li><a href="#DeleteTorrentsByCategory"><img src="images/qbt-theme/edit-delete.svg" alt="QBT_TR(Delete torrents)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Delete torrents)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li><a href="#createCategory"><img src="images/qbt-theme/list-add.svg" alt="QBT_TR(Add category...)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Add category...)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li><a href="#editCategory"><img src="images/qbt-theme/document-edit.svg" alt="QBT_TR(Edit category...)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Edit category...)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li><a href="#deleteCategory"><img src="images/qbt-theme/list-remove.svg" alt="QBT_TR(Remove category)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Remove category)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li><a href="#deleteUnusedCategories"><img src="images/qbt-theme/list-remove.svg" alt="QBT_TR(Remove unused categories)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Remove unused categories)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li class="separator"><a href="#startTorrentsByCategory"><img src="images/qbt-theme/media-playback-start.svg" alt="QBT_TR(Resume torrents)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Resume torrents)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li><a href="#pauseTorrentsByCategory"><img src="images/qbt-theme/media-playback-pause.svg" alt="QBT_TR(Pause torrents)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Pause torrents)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
<li><a href="#deleteTorrentsByCategory"><img src="images/qbt-theme/edit-delete.svg" alt="QBT_TR(Delete torrents)QBT_TR[CONTEXT=CategoryFilterWidget]"/> QBT_TR(Delete torrents)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
</ul>
<ul id="torrentTrackersMenu" class="contextMenu">
<li><a href="#AddTracker"><img src="images/qbt-theme/list-add.svg" alt="QBT_TR(Add a new tracker...)QBT_TR[CONTEXT=TrackerListWidget]"/> QBT_TR(Add a new tracker...)QBT_TR[CONTEXT=TrackerListWidget]</a></li>

22
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');
}
@ -854,11 +854,11 @@ function setupCopyEventHandler() { @@ -854,11 +854,11 @@ function setupCopyEventHandler() {
clipboardEvent = new ClipboardJS('.copyToClipboard', {
text: function(trigger) {
switch (trigger.id) {
case "CopyName":
case "copyName":
return copyNameFN();
case "CopyMagnetLink":
case "copyMagnetLink":
return copyMagnetLinkFN();
case "CopyHash":
case "copyHash":
return copyHashFN();
case "copyDescriptionPageUrl":
return copySearchTorrentUrl();

60
src/webui/www/private/scripts/contextmenu.js

@ -334,53 +334,53 @@ var TorrentsTableContextMenu = new Class({ @@ -334,53 +334,53 @@ var TorrentsTableContextMenu = new Class({
show_f_l_piece_prio = false;
if (all_are_downloaded) {
this.hideItem('DownloadLimit');
this.menu.getElement('a[href$=UploadLimit]').parentNode.addClass('separator');
this.hideItem('SequentialDownload');
this.hideItem('FirstLastPiecePrio');
this.showItem('SuperSeeding');
this.setItemChecked('SuperSeeding', all_are_super_seeding);
this.hideItem('downloadLimit');
this.menu.getElement('a[href$=uploadLimit]').parentNode.addClass('separator');
this.hideItem('sequentialDownload');
this.hideItem('firstLastPiecePrio');
this.showItem('superSeeding');
this.setItemChecked('superSeeding', all_are_super_seeding);
}
else {
if (!show_seq_dl && show_f_l_piece_prio)
this.menu.getElement('a[href$=FirstLastPiecePrio]').parentNode.addClass('separator');
this.menu.getElement('a[href$=firstLastPiecePrio]').parentNode.addClass('separator');
else
this.menu.getElement('a[href$=FirstLastPiecePrio]').parentNode.removeClass('separator');
this.menu.getElement('a[href$=firstLastPiecePrio]').parentNode.removeClass('separator');
if (show_seq_dl)
this.showItem('SequentialDownload');
this.showItem('sequentialDownload');
else
this.hideItem('SequentialDownload');
this.hideItem('sequentialDownload');
if (show_f_l_piece_prio)
this.showItem('FirstLastPiecePrio');
this.showItem('firstLastPiecePrio');
else
this.hideItem('FirstLastPiecePrio');
this.hideItem('firstLastPiecePrio');
this.setItemChecked('SequentialDownload', all_are_seq_dl);
this.setItemChecked('FirstLastPiecePrio', all_are_f_l_piece_prio);
this.setItemChecked('sequentialDownload', all_are_seq_dl);
this.setItemChecked('firstLastPiecePrio', all_are_f_l_piece_prio);
this.showItem('DownloadLimit');
this.menu.getElement('a[href$=UploadLimit]').parentNode.removeClass('separator');
this.hideItem('SuperSeeding');
this.showItem('downloadLimit');
this.menu.getElement('a[href$=uploadLimit]').parentNode.removeClass('separator');
this.hideItem('superSeeding');
}
this.showItem('Start');
this.showItem('Pause');
this.showItem('ForceStart');
this.showItem('start');
this.showItem('pause');
this.showItem('forceStart');
if (all_are_paused)
this.hideItem('Pause');
this.hideItem('pause');
else if (all_are_force_start)
this.hideItem('ForceStart');
this.hideItem('forceStart');
else if (!there_are_paused && !there_are_force_start)
this.hideItem('Start');
this.hideItem('start');
if (!all_are_auto_tmm && there_are_auto_tmm) {
this.hideItem('AutoTorrentManagement');
this.hideItem('autoTorrentManagement');
}
else {
this.showItem('AutoTorrentManagement');
this.setItemChecked('AutoTorrentManagement', all_are_auto_tmm);
this.showItem('autoTorrentManagement');
this.setItemChecked('autoTorrentManagement', all_are_auto_tmm);
}
},
@ -421,12 +421,12 @@ var CategoriesFilterContextMenu = new Class({ @@ -421,12 +421,12 @@ var CategoriesFilterContextMenu = new Class({
updateMenuItems: function() {
var id = this.options.element.id;
if ((id != CATEGORIES_ALL) && (id != CATEGORIES_UNCATEGORIZED)) {
this.showItem('EditCategory');
this.showItem('DeleteCategory');
this.showItem('editCategory');
this.showItem('deleteCategory');
}
else {
this.hideItem('EditCategory');
this.hideItem('DeleteCategory');
this.hideItem('editCategory');
this.hideItem('deleteCategory');
}
}
});

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({

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

@ -23,69 +23,69 @@ @@ -23,69 +23,69 @@
targets: '.torrentsTableContextMenuTarget',
menu: 'torrentsTableMenu',
actions: {
Start: function(element, ref) {
start: function(element, ref) {
startFN();
},
Pause: function(element, ref) {
pause: function(element, ref) {
pauseFN();
},
ForceStart: function(element, ref) {
forceStart: function(element, ref) {
setForceStartFN();
},
Delete: function(element, ref) {
delete: function(element, ref) {
deleteFN();
},
SetLocation: function(element, ref) {
setLocation: function(element, ref) {
setLocationFN();
},
Rename: function(element, ref) {
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) {
downloadLimit: function(element, ref) {
downloadLimitFN();
},
UploadLimit: function(element, ref) {
uploadLimit: function(element, ref) {
uploadLimitFN();
},
ShareRatio: function(element, ref) {
shareRatio: function(element, ref) {
shareRatioFN();
},
SequentialDownload: function(element, ref) {
sequentialDownload: function(element, ref) {
toggleSequentialDownloadFN();
},
FirstLastPiecePrio: function(element, ref) {
firstLastPiecePrio: function(element, ref) {
toggleFirstLastPiecePrioFN();
},
AutoTorrentManagement: function(element, ref) {
autoTorrentManagement: function(element, ref) {
autoTorrentManagementFN();
},
ForceRecheck: function(element, ref) {
forceRecheck: function(element, ref) {
recheckFN();
},
ForceReannounce: function(element, ref) {
forceReannounce: function(element, ref) {
reannounceFN();
},
SuperSeeding: function(element, ref) {
setSuperSeedingFN(!ref.getItemChecked('SuperSeeding'));
superSeeding: function(element, ref) {
setSuperSeedingFN(!ref.getItemChecked('superSeeding'));
}
},
offsets: {

Loading…
Cancel
Save