Author: damoxc

Revision: 4901

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

Diff:
Modified: trunk/deluge/ui/web/js/deluge-connections.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-connections.js        2009-03-20 19:08:40 UTC 
(rev 4900)
+++ trunk/deluge/ui/web/js/deluge-connections.js        2009-03-20 19:20:07 UTC 
(rev 4901)
@@ -26,6 +26,18 @@
                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 @@
                });
        },
        
-       runCheck: function() {
+       runCheck: function(callback) {
+               callback = $pick(callback, Deluge.Connections.onGetHosts);
                Deluge.Client.web.get_hosts({
-                       onSuccess: Deluge.Connections.onGetHosts
+                       onSuccess: callback
                });
        }
 }

Modified: trunk/deluge/ui/web/js/deluge-login.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-login.js      2009-03-20 19:08:40 UTC (rev 
4900)
+++ trunk/deluge/ui/web/js/deluge-login.js      2009-03-20 19:20:07 UTC (rev 
4901)
@@ -28,7 +28,7 @@
             onSuccess: function(result) {
                 if (result == true) {
                     Deluge.Login.Window.hide();
-                    Deluge.Connections.Window.show();
+                    Deluge.Connections.loginShow();
                     passwordField.setRawValue('');
                     Deluge.Events.fire('login')
                 } 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