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:
Felipe Barriga Richards 2015-02-14 18:19:54 -03:00 committed by ngosang
parent 76d93c23b7
commit 4ae2f6c33b
9 changed files with 272 additions and 23 deletions

View file

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