Author: damoxc

Revision: 4969

Log:
        add a context menu for the files tree

Diff:
Added: trunk/deluge/ui/web/icons/expand_all.png
===================================================================
(Binary files differ)


Property changes on: trunk/deluge/ui/web/icons/expand_all.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: trunk/deluge/ui/web/js/deluge-details.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-details.js    2009-04-01 19:36:27 UTC (rev 
4968)
+++ trunk/deluge/ui/web/js/deluge-details.js    2009-04-01 20:03:21 UTC (rev 
4969)
@@ -207,6 +207,12 @@
                });
        },
        
+       onContextMenu: function(node, e) {
+               e.stopEvent();
+               node.select();
+               Deluge.Menus.FilePriorities.showAt(e.getPoint());
+       },
+       
        onRequestComplete: function(files, torrentId) {
                if (this.torrentId !=  torrentId) {
                        this.clear();
@@ -390,7 +396,16 @@
                root: new Ext.tree.TreeNode({
             text: 'Files'
         }),
-               listeners: {'render': {fn: Deluge.Details.Files.onRender, 
scope: Deluge.Details.Files}}
+               listeners: {
+                       'render': {
+                               fn: Deluge.Details.Files.onRender,
+                               scope: Deluge.Details.Files
+                       },
+                       'contextmenu': {
+                               fn: Deluge.Details.Files.onContextMenu,
+                               scope: Deluge.Details.Files
+                       }
+               }
        }), new Ext.grid.GridPanel({
                id: 'peers',
                title: _('Peers'),

Modified: trunk/deluge/ui/web/js/deluge-menus.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-menus.js      2009-04-01 19:36:27 UTC (rev 
4968)
+++ trunk/deluge/ui/web/js/deluge-menus.js      2009-04-01 20:03:21 UTC (rev 
4969)
@@ -374,6 +374,31 @@
        }]
 });
 
+Deluge.Menus.FilePriorities = new Ext.menu.Menu({
+       id: 'filePrioritiesMenu',
+       items: [{
+               id: 'expandAll',
+               text: _('Expand All'),
+               icon: '/icons/expand_all.png'
+       }, '-', {
+               id: 'no_download',
+               text: _('Do Not Download'),
+               icon: '/icons/no_download.png'
+       }, {
+               id: 'normal',
+               text: _('Normal Priority'),
+               icon: '/icons/normal.png'
+       }, {
+               id: 'high',
+               text: _('High Priority'),
+               icon: '/icons/high.png'
+       }, {
+               id: 'highest',
+               text: _('Highest Priority'),
+               icon: '/icons/highest.png'
+       }]
+});
+
 function onLimitChanged(item, checked) {
        if (item.id == "other") {
        } else {



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