Added a signal to the IRC widget fired after the autoconnect was initiated. This will make the IRC pane the current one on the right side.

Mon, 10 Dec 2012 18:38:08 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 10 Dec 2012 18:38:08 +0100
changeset 2258
9ca42fd3ecc0
parent 2257
4c3bda2b71f2
child 2260
e5146f38a03a

Added a signal to the IRC widget fired after the autoconnect was initiated. This will make the IRC pane the current one on the right side.

Network/IRC/IrcNetworkWidget.py file | annotate | diff | comparison | revisions
Network/IRC/IrcWidget.py file | annotate | diff | comparison | revisions
UI/UserInterface.py file | annotate | diff | comparison | revisions
--- a/Network/IRC/IrcNetworkWidget.py	Mon Dec 10 18:36:29 2012 +0100
+++ b/Network/IRC/IrcNetworkWidget.py	Mon Dec 10 18:38:08 2012 +0100
@@ -31,6 +31,7 @@
     @signal nickChanged(str) emitted to change the nick name
     @signal sendData(str) emitted to send a message to the channel
     @signal away(bool) emitted to indicate the away status
+    @signal autoConnected() emitted after an automatic connection was initiated
     """
     connectNetwork = pyqtSignal(str, bool)
     editNetwork = pyqtSignal(str)
@@ -38,6 +39,7 @@
     nickChanged = pyqtSignal(str)
     sendData = pyqtSignal(str)
     away = pyqtSignal(bool)
+    autoConnected = pyqtSignal()
     
     def __init__(self, parent=None):
         """
@@ -89,6 +91,7 @@
                 row = self.networkCombo.findText(networkName)
                 self.networkCombo.setCurrentIndex(row)
                 self.on_connectButton_clicked()
+                self.autoConnected.emit()
                 break
     
     @pyqtSlot()
--- a/Network/IRC/IrcWidget.py	Mon Dec 10 18:36:29 2012 +0100
+++ b/Network/IRC/IrcWidget.py	Mon Dec 10 18:38:08 2012 +0100
@@ -10,7 +10,7 @@
 import re
 import logging
 
-from PyQt4.QtCore import pyqtSlot, Qt, QByteArray, QTimer
+from PyQt4.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QTimer
 from PyQt4.QtGui import QWidget, QToolButton, QLabel
 from PyQt4.QtNetwork import QTcpSocket, QAbstractSocket
 try:
@@ -34,7 +34,11 @@
 class IrcWidget(QWidget, Ui_IrcWidget):
     """
     Class implementing the IRC window.
+    
+    @signal autoConnected() emitted after an automatic connection was initiated
     """
+    autoConnected = pyqtSignal()
+    
     ServerDisconnected = 1
     ServerConnected = 2
     ServerConnecting = 3
@@ -104,6 +108,7 @@
         self.networkWidget.nickChanged.connect(self.__changeNick)
         self.networkWidget.sendData.connect(self.__send)
         self.networkWidget.away.connect(self.__away)
+        self.networkWidget.autoConnected.connect(self.autoConnected)
     
     def shutdown(self):
         """
--- a/UI/UserInterface.py	Mon Dec 10 18:36:29 2012 +0100
+++ b/UI/UserInterface.py	Mon Dec 10 18:38:08 2012 +0100
@@ -462,6 +462,8 @@
         
         self.numbersViewer.insertNumber.connect(self.viewmanager.insertNumber)
         
+        self.irc.autoConnected.connect(self.__ircAutoConnected)
+        
         # create the toolbar manager object
         self.toolbarManager = E5ToolBarManager(self, self)
         self.toolbarManager.setMainWindow(self)
@@ -5605,3 +5607,9 @@
         Public method to initiate the IRC auto connection.
         """
         self.irc.autoConnect()
+    
+    def __ircAutoConnected(self):
+        """
+        Private slot handling the automatic connection of the IRC client.
+        """
+        self.__activateIRC()

eric ide

mercurial