if the client on the server is already connected skip the connection manager

This commit is contained in:
Damien Churchill 2009-03-20 19:20:07 +00:00
parent 0f44b06197
commit d5b7616f98
2 changed files with 16 additions and 3 deletions

View File

@ -26,6 +26,18 @@ Deluge.Connections = {
Deluge.Events.fire('disconnect');
},
loginShow: function() {
Deluge.Client.web.connected({
onSuccess: function(connected) {
if (connected) {
Deluge.Events.fire('connect');
} else {
Deluge.Connections.Window.show();
}
}
});
},
onAdd: function(button, e) {
//Deluge.Connections.Add.show();
},
@ -91,9 +103,10 @@ Deluge.Connections = {
});
},
runCheck: function() {
runCheck: function(callback) {
callback = $pick(callback, Deluge.Connections.onGetHosts);
Deluge.Client.web.get_hosts({
onSuccess: Deluge.Connections.onGetHosts
onSuccess: callback
});
}
}

View File

@ -28,7 +28,7 @@ Deluge.Login = {
onSuccess: function(result) {
if (result == true) {
Deluge.Login.Window.hide();
Deluge.Connections.Window.show();
Deluge.Connections.loginShow();
passwordField.setRawValue('');
Deluge.Events.fire('login')
} else {