# eric7.Network.IRC.IrcWidget

Module implementing the IRC window.

### Global Attributes

None

### Classes

IrcWidget | Class implementing the IRC window.

### Functions

None

## IrcWidget

Class implementing the IRC window.

### Signals

autoConnected()
  emitted after an automatic connection was initiated

### Derived from

QWidget, Ui_IrcWidget

### Class Attributes

ServerConnected
ServerConnecting
ServerDisconnected

### Class Methods

None

### Methods

IrcWidget | Constructor
__autoJoinChannels | Private slot to join channels automatically once a server got connected.
__away | Private slot handling the change of the away state.
__changeNick | Private slot to use a new nick name.
__closeAllChannels | Private method to close all channels.
__closeChannel | Private slot handling the closing of a channel.
__connectNetwork | Private slot to connect to or disconnect from the given network.
__editNetwork | Private slot to edit the network configuration.
__handleCtcp | Private method to handle a CTCP command.
__handleCtcpReply | Private method to handle a server message containing a CTCP reply.
__handleNamedMessage | Private method to handle a server message containing a message name.
__handleNickInUse | Private method to handle a 443 server error.
__handleNickInUseLogin | Private method to handle a 443 server error at login.
__handleNumericMessage | Private method to handle a server message containing a numeric code.
__handleServerError | Private slot to handle a server error reply.
__handleServerReply | Private slot to handle a server reply.
__hostConnected | Private slot to log in to the server after the connection was established.
__hostDisconnected | Private slot to indicate the host was disconnected.
__hostFound | Private slot to indicate the host was found.
__leaveAllChannels | Private slot to leave all channels and close their tabs.
__leaveChannel | Private slot to leave a channel and close the associated tab.
__leaveChannels | Private slot to leave a list of channels and close their associated tabs.
__networkDataChanged | Private slot handling changes of the network and identity definitions.
__openPrivate | Private slot to open a private chat with the given user.
__ping | Private method to handle a PING message.
__query | Private method to handle a new private connection.
__readyRead | Private slot to read data from the socket.
__registerWithServices | Private method to register to services.
__send | Private slot to send data to the IRC server.
__sendCtcpReply | Private slot to send a CTCP reply.
__sendCtcpRequest | Private slot to send a CTCP request.
__setChannelTypePrefixes | Private method to set the channel type prefixes.
__setUserPrivilegePrefix | Private method to set the user privilege prefix.
__sslErrors | Private slot to handle SSL errors.
__tcpError | Private slot to handle errors reported by the TCP socket.
__updateUsersCount | Private method to update the users count on the channel tabs.
autoConnect | Public method to initiate the IRC auto connection.
isChannelName | Public method to check, if the given name is a channel name.
joinChannel | Public slot to join a channel.
on_channelsWidget_tabCloseRequested | Private slot to close a channel by pressing the close button of the channels widget.
shutdown | Public method to shut down the widget.

### Static Methods

None

#### IrcWidget (Constructor)

IrcWidget(parent=None)

Constructor

parent
  reference to the parent widget (QWidget)

#### IrcWidget.__autoJoinChannels

__autoJoinChannels()

Private slot to join channels automatically once a server got connected.

#### IrcWidget.__away

__away(isAway)

Private slot handling the change of the away state.

isAway
  flag indicating the current away state (boolean)

#### IrcWidget.__changeNick

__changeNick(nick)

Private slot to use a new nick name.

nick
  nick name to use (str)

#### IrcWidget.__closeAllChannels

__closeAllChannels()

Private method to close all channels.

#### IrcWidget.__closeChannel

__closeChannel(name)

Private slot handling the closing of a channel.

name
  name of the closed channel (string)

#### IrcWidget.__connectNetwork

__connectNetwork(name, connect, silent)

Private slot to connect to or disconnect from the given network.

name
  name of the network to connect to (string)
connect
  flag indicating to connect (boolean)
silent
  flag indicating a silent connect/disconnect (boolean)

#### IrcWidget.__editNetwork

__editNetwork(name)

Private slot to edit the network configuration.

name
  name of the network to edit (string)

#### IrcWidget.__handleCtcp

__handleCtcp(match)

Private method to handle a CTCP command.

match
  reference to the match object

Return:
  flag indicating, if the message was handled (boolean)

#### IrcWidget.__handleCtcpReply

__handleCtcpReply(match)

Private method to handle a server message containing a CTCP reply.

match
  reference to the match object

#### IrcWidget.__handleNamedMessage

__handleNamedMessage(match)

Private method to handle a server message containing a message name.

match
  reference to the match object

Return:
  flag indicating, if the message was handled (boolean)

#### IrcWidget.__handleNickInUse

__handleNickInUse()

Private method to handle a 443 server error.

#### IrcWidget.__handleNickInUseLogin

__handleNickInUseLogin()

Private method to handle a 443 server error at login.

#### IrcWidget.__handleNumericMessage

__handleNumericMessage(match)

Private method to handle a server message containing a numeric code.

match
  reference to the match object

Return:
  flag indicating, if the message was handled (boolean)

#### IrcWidget.__handleServerError

__handleServerError(code, server, message)

Private slot to handle a server error reply.

code
  numerical code sent by the server (integer)
server
  name of the server (string)
message
  message sent by the server (string)

Return:
  flag indicating, if the message was handled (boolean)

#### IrcWidget.__handleServerReply

__handleServerReply(code, server, message)

Private slot to handle a server reply.

code
  numerical code sent by the server (integer)
server
  name of the server (string)
message
  message sent by the server (string)

Return:
  flag indicating, if the message was handled (boolean)

#### IrcWidget.__hostConnected

__hostConnected()

Private slot to log in to the server after the connection was established.

#### IrcWidget.__hostDisconnected

__hostDisconnected()

Private slot to indicate the host was disconnected.

#### IrcWidget.__hostFound

__hostFound()

Private slot to indicate the host was found.

#### IrcWidget.__leaveAllChannels

__leaveAllChannels()

Private slot to leave all channels and close their tabs.

#### IrcWidget.__leaveChannel

__leaveChannel()

Private slot to leave a channel and close the associated tab.

#### IrcWidget.__leaveChannels

__leaveChannels(channelNames)

Private slot to leave a list of channels and close their associated tabs.

channelNames (list of str)
  list of channels to leave

#### IrcWidget.__networkDataChanged

__networkDataChanged()

Private slot handling changes of the network and identity definitions.

#### IrcWidget.__openPrivate

__openPrivate(name)

Private slot to open a private chat with the given user.

name
  name of the user (string)

#### IrcWidget.__ping

__ping(match)

Private method to handle a PING message.

match
  reference to the match object

Return:
  flag indicating, if the message was handled (boolean)

#### IrcWidget.__query

__query(match)

Private method to handle a new private connection.

match
  reference to the match object

Return:
  flag indicating, if the message was handled (boolean)

#### IrcWidget.__readyRead

__readyRead()

Private slot to read data from the socket.

#### IrcWidget.__registerWithServices

__registerWithServices()

Private method to register to services.

#### IrcWidget.__send

__send(data)

Private slot to send data to the IRC server.

data
  data to be sent (string)

#### IrcWidget.__sendCtcpReply

__sendCtcpReply(receiver, text)

Private slot to send a CTCP reply.

receiver (str)
  nick name of the receiver
text (str)
  text to be sent

#### IrcWidget.__sendCtcpRequest

__sendCtcpRequest(receiver, request, arguments)

Private slot to send a CTCP request.

receiver (str)
  nick name of the receiver
request (str)
  CTCP request to be sent
arguments (str)
  arguments to be sent

#### IrcWidget.__setChannelTypePrefixes

__setChannelTypePrefixes(prefixes)

Private method to set the channel type prefixes.

prefixes
  channel prefix characters (string)

#### IrcWidget.__setUserPrivilegePrefix

__setUserPrivilegePrefix(prefix1, prefix2)

Private method to set the user privilege prefix.

prefix1
  first part of the prefix (string)
prefix2
  indictors the first part gets mapped to (string)

#### IrcWidget.__sslErrors

__sslErrors(errors)

Private slot to handle SSL errors.

errors
  list of SSL errors (list of QSslError)

#### IrcWidget.__tcpError

__tcpError(error)

Private slot to handle errors reported by the TCP socket.

error
  error code reported by the socket (QAbstractSocket.SocketError)

#### IrcWidget.__updateUsersCount

__updateUsersCount()

Private method to update the users count on the channel tabs.

#### IrcWidget.autoConnect

autoConnect()

Public method to initiate the IRC auto connection.

#### IrcWidget.isChannelName

isChannelName(name)

Public method to check, if the given name is a channel name.

name
  name to check (string)

Return:
  flag indicating a channel name (boolean)

#### IrcWidget.joinChannel

joinChannel(name, key="")

Public slot to join a channel.

name
  name of the channel (string)
key
  key of the channel (string)

#### IrcWidget.on_channelsWidget_tabCloseRequested

on_channelsWidget_tabCloseRequested(index)

Private slot to close a channel by pressing the close button of the channels widget.

index
  index of the tab to be closed (integer)

#### IrcWidget.shutdown

shutdown()

Public method to shut down the widget.

Return:
  flag indicating successful shutdown (boolean)

Up