Fix of #102. Errors are now shown up as red text.
This commit is contained in:
parent
9b21302372
commit
372ef826c0
@ -37,12 +37,11 @@ class SyncClientFactory(ClientFactory):
|
|||||||
reactor.callLater(0.1*(2**self._timesTried), connector.connect)
|
reactor.callLater(0.1*(2**self._timesTried), connector.connect)
|
||||||
else:
|
else:
|
||||||
message = getMessage("en", "disconnection-notification")
|
message = getMessage("en", "disconnection-notification")
|
||||||
self._client.ui.showMessage(message)
|
self._client.ui.showErrorMessage(message)
|
||||||
|
|
||||||
def clientConnectionFailed(self, connector, reason):
|
def clientConnectionFailed(self, connector, reason):
|
||||||
if not self.reconnecting:
|
if not self.reconnecting:
|
||||||
self._client.ui.showMessage(getMessage("en", "connection-failed-notification"))
|
self._client.ui.showErrorMessage(getMessage("en", "connection-failed-notification"))
|
||||||
self._client.stop(True)
|
|
||||||
else:
|
else:
|
||||||
self.clientConnectionLost(connector, reason)
|
self.clientConnectionLost(connector, reason)
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,11 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
print(message)
|
print(message)
|
||||||
|
|
||||||
def showErrorMessage(self, message):
|
def showErrorMessage(self, message):
|
||||||
print("ERROR:\t" + message)
|
message = unicode(message)
|
||||||
|
message = message.replace("&", "&").replace('"', """).replace("<", "<").replace(">", ">")
|
||||||
|
message = message.replace("\n", "<br />")
|
||||||
|
message = "<span style=\"color:#FF0000;\">" + message + "</span>"
|
||||||
|
self.newMessage(time.strftime(constants.UI_TIME_FORMAT, time.localtime()) + message + "<br />")
|
||||||
|
|
||||||
def joinRoom(self, room = None):
|
def joinRoom(self, room = None):
|
||||||
if room == None:
|
if room == None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user