Network/IRC/IrcWidget.py

changeset 2404
cba0ff902c2b
parent 2360
b6bf3925e3e1
child 2469
20d2166280bb
equal deleted inserted replaced
2403:e3d7a861547c 2404:cba0ff902c2b
22 22
23 from E5Gui import E5MessageBox 23 from E5Gui import E5MessageBox
24 24
25 from .Ui_IrcWidget import Ui_IrcWidget 25 from .Ui_IrcWidget import Ui_IrcWidget
26 26
27 from .IrcNetworkManager import IrcNetworkManager
28 from .IrcChannelWidget import IrcChannelWidget
29 from .IrcNetworkListDialog import IrcNetworkListDialog
30
31 import Preferences 27 import Preferences
32 import UI.PixmapCache 28 import UI.PixmapCache
33 29
34 from Globals import isMacPlatform 30 from Globals import isMacPlatform
35 31
55 @param parent reference to the parent widget (QWidget) 51 @param parent reference to the parent widget (QWidget)
56 """ 52 """
57 super().__init__(parent) 53 super().__init__(parent)
58 self.setupUi(self) 54 self.setupUi(self)
59 55
56 from .IrcNetworkManager import IrcNetworkManager
60 self.__ircNetworkManager = IrcNetworkManager(self) 57 self.__ircNetworkManager = IrcNetworkManager(self)
61 58
62 self.__leaveButton = QToolButton(self) 59 self.__leaveButton = QToolButton(self)
63 self.__leaveButton.setIcon(UI.PixmapCache.getIcon("ircCloseChannel.png")) 60 self.__leaveButton.setIcon(UI.PixmapCache.getIcon("ircCloseChannel.png"))
64 self.__leaveButton.setToolTip(self.trUtf8("Press to leave the current channel")) 61 self.__leaveButton.setToolTip(self.trUtf8("Press to leave the current channel"))
240 """ 237 """
241 Private slot to edit the network configuration. 238 Private slot to edit the network configuration.
242 239
243 @param name name of the network to edit (string) 240 @param name name of the network to edit (string)
244 """ 241 """
242 from .IrcNetworkListDialog import IrcNetworkListDialog
245 dlg = IrcNetworkListDialog(self.__ircNetworkManager, self) 243 dlg = IrcNetworkListDialog(self.__ircNetworkManager, self)
246 dlg.exec_() 244 dlg.exec_()
247 245
248 def __networkDataChanged(self): 246 def __networkDataChanged(self):
249 """ 247 """
265 # step 1: check, if this channel is already joined 263 # step 1: check, if this channel is already joined
266 for channel in self.__channelList: 264 for channel in self.__channelList:
267 if channel.name() == name: 265 if channel.name() == name:
268 return 266 return
269 267
268 from .IrcChannelWidget import IrcChannelWidget
270 channel = IrcChannelWidget(self) 269 channel = IrcChannelWidget(self)
271 channel.setName(name) 270 channel.setName(name)
272 channel.setUserName(self.__nickName) 271 channel.setUserName(self.__nickName)
273 identity = self.__ircNetworkManager.getIdentity(self.__identityName) 272 identity = self.__ircNetworkManager.getIdentity(self.__identityName)
274 channel.setPartMessage(identity.getPartMessage()) 273 channel.setPartMessage(identity.getPartMessage())
323 """ 322 """
324 Private slot to open a private chat with the given user. 323 Private slot to open a private chat with the given user.
325 324
326 @param name name of the user (string) 325 @param name name of the user (string)
327 """ 326 """
327 from .IrcChannelWidget import IrcChannelWidget
328 channel = IrcChannelWidget(self) 328 channel = IrcChannelWidget(self)
329 channel.setName(self.__nickName) 329 channel.setName(self.__nickName)
330 channel.setUserName(self.__nickName) 330 channel.setUserName(self.__nickName)
331 identity = self.__ircNetworkManager.getIdentity(self.__identityName) 331 identity = self.__ircNetworkManager.getIdentity(self.__identityName)
332 channel.setPartMessage(identity.getPartMessage()) 332 channel.setPartMessage(identity.getPartMessage())

eric ide

mercurial