Rename priority to queue in the context of torrents

This commit is contained in:
thalieht
2018-12-08 01:01:09 +02:00
parent afa73d4e89
commit 7b31868e3c
20 changed files with 171 additions and 160 deletions

View File

@@ -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();

View File

@@ -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";

View File

@@ -362,7 +362,7 @@ SyncController::~SyncController()
// - "progress": Torrent progress
// - "dlspeed": Torrent download speed
// - "upspeed": Torrent upload speed
// - "priority": Torrent priority (-1 if queuing is disabled)
// - "priority": Torrent queue position (-1 if queuing is disabled)
// - "num_seeds": Torrent seeds connected to
// - "num_complete": Torrent seeds in the swarm
// - "num_leechs": Torrent leechers connected to
@@ -399,7 +399,7 @@ SyncController::~SyncController()
// - "up_info_data: bytes uploaded
// - "up_info_speed: upload speed
// - "up_rate_limit: upload speed limit
// - "queueing": priority system usage flag
// - "queueing": queue system usage flag
// - "refresh_interval": torrents table refresh interval
// - "free_space_on_disk": Free space on the default save path
// GET param:

View File

@@ -207,7 +207,7 @@ namespace
// - "progress": Torrent progress
// - "dlspeed": Torrent download speed
// - "upspeed": Torrent upload speed
// - "priority": Torrent priority (-1 if queuing is disabled)
// - "priority": Torrent queue position (-1 if queuing is disabled)
// - "num_seeds": Torrent seeds connected to
// - "num_complete": Torrent seeds in the swarm
// - "num_leechs": Torrent leechers connected to
@@ -864,7 +864,7 @@ void TorrentsController::increasePrioAction()
throw APIError(APIErrorType::Conflict, tr("Torrent queueing must be enabled"));
const QStringList hashes {params()["hashes"].split('|')};
BitTorrent::Session::instance()->increaseTorrentsPriority(hashes);
BitTorrent::Session::instance()->increaseTorrentsQueuePos(hashes);
}
void TorrentsController::decreasePrioAction()
@@ -875,7 +875,7 @@ void TorrentsController::decreasePrioAction()
throw APIError(APIErrorType::Conflict, tr("Torrent queueing must be enabled"));
const QStringList hashes {params()["hashes"].split('|')};
BitTorrent::Session::instance()->decreaseTorrentsPriority(hashes);
BitTorrent::Session::instance()->decreaseTorrentsQueuePos(hashes);
}
void TorrentsController::topPrioAction()
@@ -886,7 +886,7 @@ void TorrentsController::topPrioAction()
throw APIError(APIErrorType::Conflict, tr("Torrent queueing must be enabled"));
const QStringList hashes {params()["hashes"].split('|')};
BitTorrent::Session::instance()->topTorrentsPriority(hashes);
BitTorrent::Session::instance()->topTorrentsQueuePos(hashes);
}
void TorrentsController::bottomPrioAction()
@@ -897,7 +897,7 @@ void TorrentsController::bottomPrioAction()
throw APIError(APIErrorType::Conflict, tr("Torrent queueing must be enabled"));
const QStringList hashes {params()["hashes"].split('|')};
BitTorrent::Session::instance()->bottomTorrentsPriority(hashes);
BitTorrent::Session::instance()->bottomTorrentsQueuePos(hashes);
}
void TorrentsController::setLocationAction()

View File

@@ -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 @@
<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 @@
<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>

View File

@@ -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');
}

View File

@@ -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) {

View File

@@ -93,7 +93,7 @@ var deleteTorrentsByCategoryFN = function() {};
var copyNameFN = function() {};
var copyMagnetLinkFN = function() {};
var copyHashFN = function() {};
var setPriorityFN = function() {};
var setQueuePositionFN = function() {};
var initializeWindows = function() {
saveWindowSize = function(windowId) {
@@ -742,11 +742,11 @@ var initializeWindows = function() {
['decreasePrio', 'increasePrio', 'topPrio', 'bottomPrio'].each(function(item) {
addClickEvent(item, function(e) {
new Event(e).stop();
setPriorityFN(item);
setQueuePositionFN(item);
});
});
setPriorityFN = function(cmd) {
setQueuePositionFN = function(cmd) {
var hashes = torrentsTable.selectedRowsIds();
if (hashes.length) {
new Request({

View File

@@ -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) {