mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
webui (js): feature: Added complete support for labels (add/set/reset/display/filter) #648
Changes: - added list of labels on the lower-left corner - added support to add/set/reset labels on context menu - added support to filter torrents by label
This commit is contained in:
parent
76d93c23b7
commit
4ae2f6c33b
9 changed files with 272 additions and 23 deletions
|
@ -39,6 +39,7 @@
|
|||
#include "core/preferences.h"
|
||||
#include "btjson.h"
|
||||
#include "prefjson.h"
|
||||
#include "jsonutils.h"
|
||||
#include "core/bittorrent/session.h"
|
||||
#include "core/bittorrent/trackerentry.h"
|
||||
#include "core/bittorrent/torrentinfo.h"
|
||||
|
@ -677,8 +678,9 @@ void WebApplication::action_command_setLabel()
|
|||
if( m.contains("value") ) {
|
||||
QString label = m["value"].toString();
|
||||
if (!hash.isEmpty()) {
|
||||
QTorrentHandle h = QBtSession::instance()->getTorrentHandle(hash);
|
||||
QBtSession::instance()->setLabel(h, label);
|
||||
BitTorrent::TorrentHandle *const torrent = BitTorrent::Session::instance()->findTorrent(hash);
|
||||
if (torrent)
|
||||
torrent->setLabel(label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue