enable the disabled toolbar buttons once the ui connects

This commit is contained in:
Damien Churchill 2009-02-17 00:04:46 +00:00
parent 1ff29a134c
commit cc272d8dc0
3 changed files with 16 additions and 3 deletions

View File

@ -65,6 +65,18 @@ Deluge.ToolBar = new Ext.Toolbar({
] ]
}); });
Deluge.ToolBar.connected = function() {
Deluge.ToolBar.items.each(function(bn) {
bn.enable();
});
}
Deluge.ToolBar.disconnected = function() {
Deluge.ToolBar.items.each(function(bn) {
bn.disable();
});
}
function torrentAction(item) { function torrentAction(item) {
var selection = Deluge.Torrents.getSelectionModel().getSelections(); var selection = Deluge.Torrents.getSelectionModel().getSelections();
var ids = new Array(); var ids = new Array();

View File

@ -14,7 +14,7 @@ Deluge.Connections = {
Deluge.Client = new JSON.RPC('/json', { Deluge.Client = new JSON.RPC('/json', {
methods: methods methods: methods
}); });
Deluge.Ui.run(); Deluge.Ui.connected();
} }
}); });
}, },

View File

@ -149,13 +149,14 @@ Deluge.Ui = {
information. information.
Example: Example:
Deluge.UI.run(); Deluge.UI.connected();
*/ */
run: function() { connected: function() {
if (!this.running) { if (!this.running) {
this.running = this.update.periodical(2000, this); this.running = this.update.periodical(2000, this);
this.update(); this.update();
} }
Deluge.ToolBar.connected();
}, },
/* /*