eric6/Network/IRC/IrcWidget.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
64 self.__leaveButton.setToolTip( 64 self.__leaveButton.setToolTip(
65 self.tr("Press to leave the current channel")) 65 self.tr("Press to leave the current channel"))
66 self.__leaveButton.clicked.connect(self.__leaveChannel) 66 self.__leaveButton.clicked.connect(self.__leaveChannel)
67 self.__leaveButton.setEnabled(False) 67 self.__leaveButton.setEnabled(False)
68 self.channelsWidget.setCornerWidget( 68 self.channelsWidget.setCornerWidget(
69 self.__leaveButton, Qt.BottomRightCorner) 69 self.__leaveButton, Qt.Corner.BottomRightCorner)
70 self.channelsWidget.setTabsClosable(False) 70 self.channelsWidget.setTabsClosable(False)
71 if not isMacPlatform(): 71 if not isMacPlatform():
72 self.channelsWidget.setTabPosition(QTabWidget.South) 72 self.channelsWidget.setTabPosition(QTabWidget.TabPosition.South)
73 73
74 height = self.height() 74 height = self.height()
75 self.splitter.setSizes([height * 0.6, height * 0.4]) 75 self.splitter.setSizes([height * 0.6, height * 0.4])
76 76
77 self.__channelList = [] 77 self.__channelList = []
113 self.__chanTypesRe = re.compile(r""".*\sCHANTYPES=([^ ]+).*""") 113 self.__chanTypesRe = re.compile(r""".*\sCHANTYPES=([^ ]+).*""")
114 114
115 ircPic = UI.PixmapCache.getPixmap("irc128") 115 ircPic = UI.PixmapCache.getPixmap("irc128")
116 self.__emptyLabel = QLabel() 116 self.__emptyLabel = QLabel()
117 self.__emptyLabel.setPixmap(ircPic) 117 self.__emptyLabel.setPixmap(ircPic)
118 self.__emptyLabel.setAlignment(Qt.AlignVCenter | Qt.AlignHCenter) 118 self.__emptyLabel.setAlignment(
119 Qt.AlignmentFlag.AlignVCenter | Qt.AlignmentFlag.AlignHCenter)
119 self.channelsWidget.addTab(self.__emptyLabel, "") 120 self.channelsWidget.addTab(self.__emptyLabel, "")
120 121
121 # all initialized, do connections now 122 # all initialized, do connections now
122 self.__ircNetworkManager.dataChanged.connect(self.__networkDataChanged) 123 self.__ircNetworkManager.dataChanged.connect(self.__networkDataChanged)
123 self.networkWidget.initialize(self.__ircNetworkManager) 124 self.networkWidget.initialize(self.__ircNetworkManager)
868 Private slot to handle errors reported by the TCP socket. 869 Private slot to handle errors reported by the TCP socket.
869 870
870 @param error error code reported by the socket 871 @param error error code reported by the socket
871 (QAbstractSocket.SocketError) 872 (QAbstractSocket.SocketError)
872 """ 873 """
873 if error == QAbstractSocket.RemoteHostClosedError: 874 if error == QAbstractSocket.SocketError.RemoteHostClosedError:
874 # ignore this one, it's a disconnect 875 # ignore this one, it's a disconnect
875 if self.__sslErrorLock: 876 if self.__sslErrorLock:
876 self.networkWidget.addErrorMessage( 877 self.networkWidget.addErrorMessage(
877 self.tr("SSL Error"), 878 self.tr("SSL Error"),
878 self.tr( 879 self.tr(
879 """Connection to server {0} (port {1}) lost while""" 880 """Connection to server {0} (port {1}) lost while"""
880 """ waiting for user response to an SSL error.""") 881 """ waiting for user response to an SSL error.""")
881 .format(self.__server.getName(), self.__server.getPort())) 882 .format(self.__server.getName(), self.__server.getPort()))
882 self.__connectionState = IrcWidget.ServerDisconnected 883 self.__connectionState = IrcWidget.ServerDisconnected
883 elif error == QAbstractSocket.HostNotFoundError: 884 elif error == QAbstractSocket.SocketError.HostNotFoundError:
884 self.networkWidget.addErrorMessage( 885 self.networkWidget.addErrorMessage(
885 self.tr("Socket Error"), 886 self.tr("Socket Error"),
886 self.tr( 887 self.tr(
887 "The host was not found. Please check the host name" 888 "The host was not found. Please check the host name"
888 " and port settings.")) 889 " and port settings."))
889 elif error == QAbstractSocket.ConnectionRefusedError: 890 elif error == QAbstractSocket.SocketError.ConnectionRefusedError:
890 self.networkWidget.addErrorMessage( 891 self.networkWidget.addErrorMessage(
891 self.tr("Socket Error"), 892 self.tr("Socket Error"),
892 self.tr( 893 self.tr(
893 "The connection was refused by the peer. Please check the" 894 "The connection was refused by the peer. Please check the"
894 " host name and port settings.")) 895 " host name and port settings."))
895 elif error == QAbstractSocket.SslHandshakeFailedError: 896 elif error == QAbstractSocket.SocketError.SslHandshakeFailedError:
896 self.networkWidget.addErrorMessage( 897 self.networkWidget.addErrorMessage(
897 self.tr("Socket Error"), 898 self.tr("Socket Error"),
898 self.tr("The SSL handshake failed.")) 899 self.tr("The SSL handshake failed."))
899 else: 900 else:
900 if self.__socket: 901 if self.__socket:

eric ide

mercurial