Module: deluge
Branch: master
Commit: 342001c642d312867dcd2eeac8812f7ad29486ac

Author: Damien Churchill <[email protected]>
Date:   Sun Apr 25 21:18:46 2010 +0100

implement the handler for the torrent menu

---

 deluge/plugins/label/label/data/label.js |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/deluge/plugins/label/label/data/label.js 
b/deluge/plugins/label/label/data/label.js
index cca4b47..4e3a358 100644
--- a/deluge/plugins/label/label/data/label.js
+++ b/deluge/plugins/label/label/data/label.js
@@ -285,7 +285,18 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
        },
 
        onTorrentMenuClick: function(item, e) {
-               alert(item.label);
+               var ids = deluge.torrents.getSelectedIds();
+               Ext.each(ids, function(id, i) {
+                       if (ids.length == i +1 ) {
+                               deluge.client.label.set_torrent(id, item.label, 
{
+                                       success: function() {
+                                               deluge.ui.update();
+                                       }
+                               });
+                       } else {
+                               deluge.client.label.set_torrent(id, item.label);
+                       }
+               });
        }
 });
 Deluge.registerPlugin('Label', Deluge.plugins.LabelPlugin);

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to