mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 09:28:41 +00:00
add 2 new methods that return the torrent ids to make rpc calls easier
This commit is contained in:
parent
85c0725f83
commit
b4404feed7
2 changed files with 22 additions and 6 deletions
|
@ -32,11 +32,7 @@
|
||||||
|
|
||||||
deluge.menus = {
|
deluge.menus = {
|
||||||
onTorrentAction: function(item, e) {
|
onTorrentAction: function(item, e) {
|
||||||
var selection = deluge.torrents.getSelections();
|
var ids = deluge.torrents.getSelectedIds();
|
||||||
var ids = [];
|
|
||||||
Ext.each(selection, function(record) {
|
|
||||||
ids.push(record.id);
|
|
||||||
});
|
|
||||||
var action = item.initialConfig.torrentAction;
|
var action = item.initialConfig.torrentAction;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
|
|
|
@ -253,6 +253,26 @@
|
||||||
return this.getSelectionModel().getSelections();
|
return this.getSelectionModel().getSelections();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the currently selected torrent id.
|
||||||
|
* @return {String} The currently selected id.
|
||||||
|
*/
|
||||||
|
getSelectedId: function() {
|
||||||
|
return this.getSelectionModel().getSelected().id
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the currently selected torrent ids.
|
||||||
|
* @return {Array} The currently selected ids.
|
||||||
|
*/
|
||||||
|
getSelectedIds: function() {
|
||||||
|
var ids = [];
|
||||||
|
Ext.each(this.getSelectionModel().getSelections(), function(r) {
|
||||||
|
ids.push(r.id);
|
||||||
|
});
|
||||||
|
return ids;
|
||||||
|
},
|
||||||
|
|
||||||
update: function(torrents) {
|
update: function(torrents) {
|
||||||
var store = this.getStore();
|
var store = this.getStore();
|
||||||
var newTorrents = [];
|
var newTorrents = [];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue