Author: damoxc

Revision: 5788

Log:
        disable the connect button if the host is offline

Diff:
Modified: trunk/deluge/ui/web/js/Deluge.ConnectionManager.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.ConnectionManager.js  2009-09-29 09:24:16 UTC 
(rev 5787)
+++ trunk/deluge/ui/web/js/Deluge.ConnectionManager.js  2009-10-01 10:09:21 UTC 
(rev 5788)
@@ -325,6 +325,7 @@
                        record.set('version', host[4])
                        record.commit();
                        
+                       var button = this.buttons[1], status = 
record.get('status');
                        if (this.grid.getSelectionModel().getSelected() == 
record) {
                                var status = record.get('status');
                                if (status == _('Offline')) {
@@ -401,15 +402,17 @@
                        
                        var button = this.buttons[1], status = 
record.get('status');
                        if (status == _('Connected')) {
+                               button.enable();
                                button.setText(_('Disconnect'));
                        } else if (status == _('Offline')) {
+                               button.disable();
                                if (record.get('host') == '127.0.0.1' || 
record.get('host') == 'localhost') {
                                        this.stopHostButton.setText(_('Start 
Daemon'));
                                } else {
                                        this.stopHostButton.disable();
                                }
-                               
                        } else {
+                               button.enable();
                                button.setText(_('Connect'));
                        }
                },



--~--~---------~--~----~------------~-------~--~----~
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