Network/IRC/IrcNetworkWidget.py

changeset 2237
baddb671c326
parent 2234
1e33501a0d33
child 2239
a47b50e80a20
diff -r e30d5f978919 -r baddb671c326 Network/IRC/IrcNetworkWidget.py
--- a/Network/IRC/IrcNetworkWidget.py	Thu Nov 29 20:02:43 2012 +0100
+++ b/Network/IRC/IrcNetworkWidget.py	Fri Nov 30 20:14:50 2012 +0100
@@ -62,22 +62,33 @@
         
         self.__manager.networksChanged.connect(self.__refreshNetworks)
     
+    def autoConnect(self):
+        """
+        Public method to perform the IRC auto connection.
+        """
+        for networkName in self.__manager.getNetworkNames():
+            if self.__manager.getNetwork(networkName).autoConnect():
+                row = self.networkCombo.findText(networkName)
+                self.networkCombo.setCurrentIndex(row)
+                self.on_connectButton_clicked()
+                break
+    
     @pyqtSlot()
     def __refreshNetworks(self):
         """
         Private slot to refresh all network related widgets.
         """
         currentNetwork = self.networkCombo.currentText()
-##        currentNick = self.nickCombo.currentText()
-##        currentChannel = self.channelCombo.currentText()
+        currentNick = self.nickCombo.currentText()
+        currentChannel = self.channelCombo.currentText()
         self.networkCombo.clear()
         self.networkCombo.addItems(self.__manager.getNetworkNames())
         row = self.networkCombo.findText(currentNetwork)
         if row == -1:
             row = 0
         self.networkCombo.setCurrentIndex(row)
-##        self.nickCombo.setEditText(currentNick)
-##        self.channelCombo.setEditText(currentChannel)
+        self.nickCombo.setEditText(currentNick)
+        self.channelCombo.setEditText(currentChannel)
     
     @pyqtSlot()
     def on_connectButton_clicked(self):

eric ide

mercurial