add a context menu for the files tree

This commit is contained in:
Damien Churchill 2009-04-01 20:03:21 +00:00
parent 63427a18cc
commit 8b76cd8a2a
3 changed files with 41 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

View File

@ -207,6 +207,12 @@ Deluge.Details.Files = {
});
},
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 @@ Deluge.Details.Panel = new Ext.TabPanel({
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'),

View File

@ -374,6 +374,31 @@ Deluge.Menus.Upload = new Ext.menu.Menu({
}]
});
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 {