Author: andar

Revision: 4930

Log:
        Add daemon autoconnecting on startup

Diff:
Modified: trunk/deluge/ui/gtkui/gtkui.py
===================================================================
--- trunk/deluge/ui/gtkui/gtkui.py      2009-03-25 09:12:48 UTC (rev 4929)
+++ trunk/deluge/ui/gtkui/gtkui.py      2009-03-25 18:01:16 UTC (rev 4930)
@@ -218,16 +218,26 @@
 
     def _on_reactor_start(self):
         log.debug("_on_reactor_start")
-        if self.config["show_connection_manager_on_start"] and not 
self.config["classic_mode"]:
-            # XXX: We need to call a simulate() here, but this could be a bug 
in twisted
-            reactor.simulate()
-            self.connectionmanager.show()
-
         if self.config["classic_mode"]:
             client.start_classic_mode()
             component.start()
             return
 
+        # Autoconnect to a host
+        if self.config["autoconnect"]:
+            for host in self.connectionmanager.config["hosts"]:
+                if host[0] == self.config["autoconnect_host_id"]:
+                    def on_connect(connector):
+                        component.start()
+                    client.connect(*host[1:]).addCallback(on_connect)
+
+        if self.config["show_connection_manager_on_start"]:
+            # XXX: We need to call a simulate() here, but this could be a bug 
in twisted
+            reactor.simulate()
+            self.connectionmanager.show()
+
+
+
     def __on_disconnect(self):
         """
         Called when disconnected from the daemon.  We basically just stop all



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