eric6/Network/IRC/IrcNetworkWidget.py

branch
maintenance
changeset 8273
698ae46f40a4
parent 8176
31965986ecd1
parent 8259
2bbec88047dd
equal deleted inserted replaced
8190:fb0ef164f536 8273:698ae46f40a4
47 """ 47 """
48 Constructor 48 Constructor
49 49
50 @param parent reference to the parent widget (QWidget) 50 @param parent reference to the parent widget (QWidget)
51 """ 51 """
52 super(IrcNetworkWidget, self).__init__(parent) 52 super().__init__(parent)
53 self.setupUi(self) 53 self.setupUi(self)
54 54
55 self.connectButton.setIcon(UI.PixmapCache.getIcon("ircConnect")) 55 self.connectButton.setIcon(UI.PixmapCache.getIcon("ircConnect"))
56 self.editButton.setIcon(UI.PixmapCache.getIcon("ircConfigure")) 56 self.editButton.setIcon(UI.PixmapCache.getIcon("ircConfigure"))
57 self.joinButton.setIcon(UI.PixmapCache.getIcon("ircJoinChannel")) 57 self.joinButton.setIcon(UI.PixmapCache.getIcon("ircJoinChannel"))
442 if not res: 442 if not res:
443 return 443 return
444 fname = Utilities.toNativeSeparators(fname) 444 fname = Utilities.toNativeSeparators(fname)
445 445
446 try: 446 try:
447 if ext.lower() in ["htm", "html"]: 447 txt = (
448 txt = self.messages.toHtml() 448 self.messages.toHtml()
449 else: 449 if ext.lower() in ["htm", "html"] else
450 txt = self.messages.toPlainText() 450 self.messages.toPlainText()
451 )
451 with open(fname, "w", encoding="utf-8") as f: 452 with open(fname, "w", encoding="utf-8") as f:
452 f.write(txt) 453 f.write(txt)
453 except OSError as err: 454 except OSError as err:
454 E5MessageBox.critical( 455 E5MessageBox.critical(
455 self, 456 self,

eric ide

mercurial