10 from PyQt5.QtCore import pyqtSlot, pyqtSignal, QPoint, QFileInfo, QUrl, QThread |
10 from PyQt5.QtCore import pyqtSlot, pyqtSignal, QPoint, QFileInfo, QUrl, QThread |
11 from PyQt5.QtGui import QDesktopServices |
11 from PyQt5.QtGui import QDesktopServices |
12 from PyQt5.QtWidgets import QWidget, QApplication, QMenu |
12 from PyQt5.QtWidgets import QWidget, QApplication, QMenu |
13 |
13 |
14 from E5Gui import E5MessageBox, E5FileDialog |
14 from E5Gui import E5MessageBox, E5FileDialog |
15 from E5Gui.E5Application import e5App |
|
16 |
15 |
17 from .Ui_IrcNetworkWidget import Ui_IrcNetworkWidget |
16 from .Ui_IrcNetworkWidget import Ui_IrcNetworkWidget |
18 |
17 |
19 from .IrcUtilities import ircFilter, ircTimestamp |
18 from .IrcUtilities import ircFilter, ircTimestamp |
20 |
19 |
91 |
90 |
92 def autoConnect(self): |
91 def autoConnect(self): |
93 """ |
92 """ |
94 Public method to perform the IRC auto connection. |
93 Public method to perform the IRC auto connection. |
95 """ |
94 """ |
96 userInterface = e5App().getObject("UserInterface") |
95 self.__autoConnect() |
97 online = userInterface.isOnline() |
|
98 self.connectButton.setEnabled(online) |
|
99 userInterface.onlineStateChanged.connect(self.__onlineStateChanged) |
|
100 if online: |
|
101 self.__autoConnect() |
|
102 |
96 |
103 def __autoConnect(self): |
97 def __autoConnect(self): |
104 """ |
98 """ |
105 Private method to perform the IRC auto connection. |
99 Private method to perform the IRC auto connection. |
106 """ |
100 """ |
305 """ |
299 """ |
306 Public method to add a server message. |
300 Public method to add a server message. |
307 |
301 |
308 @param msgType txpe of the message (string) |
302 @param msgType txpe of the message (string) |
309 @param msg message to be added (string) |
303 @param msg message to be added (string) |
310 @keyparam filterMsg flag indicating to filter the message (boolean) |
304 @param filterMsg flag indicating to filter the message (boolean) |
311 """ |
305 """ |
312 if filterMsg: |
306 if filterMsg: |
313 msg = ircFilter(msg) |
307 msg = ircFilter(msg) |
314 s = '<font color="{0}">{1} <b>[</b>{2}<b>]</b> {3}</font>'.format( |
308 s = '<font color="{0}">{1} <b>[</b>{2}<b>]</b> {3}</font>'.format( |
315 Preferences.getIrc("ServerMessageColour"), |
309 Preferences.getIrc("ServerMessageColour"), |