fix setting bandwidth limits via the statusbar

This commit is contained in:
Damien Churchill 2009-10-20 22:33:18 +00:00
parent 33301b3433
commit b94060c60d
3 changed files with 20 additions and 16 deletions

View file

@ -11,6 +11,7 @@
* Fix changing of the allocation in the preferences.
* Fix updating the Connection Manager when a host is added.
* Add a --fork option to allow forking the webui to the background
* Fix the statusbar menu limits
==== Misc ====
* Add man pages for deluge-console, deluge-gtk and deluge-web

View file

@ -243,7 +243,18 @@ Deluge.Menus.Torrent = new Ext.menu.Menu({
}]
});
Deluge.Menus.Connections = new Ext.menu.Menu({
Ext.deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
setValue: function(value) {
var item = this.items.get(value);
if (!item) item = this.items.get('other')
item.suspendEvents();
item.setChecked(true);
item.resumeEvents();
}
});
Deluge.Menus.Connections = new Ext.deluge.StatusbarMenu({
id: 'connectionsMenu',
items: [{
id: '50',
@ -290,7 +301,7 @@ Deluge.Menus.Connections = new Ext.menu.Menu({
}]
});
Deluge.Menus.Download = new Ext.menu.Menu({
Deluge.Menus.Download = new Ext.deluge.StatusbarMenu({
id: 'downspeedMenu',
items: [{
id: '5',
@ -337,7 +348,7 @@ Deluge.Menus.Download = new Ext.menu.Menu({
}]
});
Deluge.Menus.Upload = new Ext.menu.Menu({
Deluge.Menus.Upload = new Ext.deluge.StatusbarMenu({
id: 'upspeedMenu',
items: [{
id: '5',
@ -414,7 +425,7 @@ Deluge.Menus.FilePriorities = new Ext.menu.Menu({
});
function onLimitChanged(item, checked) {
/*if (item.id == "other") {
if (item.id == "other") {
} else {
config = {}
config[item.group] = item.id
@ -423,5 +434,5 @@ function onLimitChanged(item, checked) {
Deluge.UI.update();
}
});
}*/
}
}

View file

@ -131,18 +131,10 @@
});
this.items.get('statusbar-dht').setText(stats.dht_nodes);
function updateMenu(menu, stat) {
var item = menu.items.get(stat)
if (!item) {
item = menu.items.get('other')
}
item.setChecked(true);
}
updateMenu(Deluge.Menus.Connections, stats.max_num_connections);
updateMenu(Deluge.Menus.Download, stats.max_download);
updateMenu(Deluge.Menus.Upload, stats.max_upload);
Deluge.Menus.Connections.setValue(stats.max_num_connections);
Deluge.Menus.Download.setValue(stats.max_download);
Deluge.Menus.Upload.setValue(stats.max_upload);
}
});
Deluge.Statusbar = new Ext.deluge.Statusbar();