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)
|
||||
else:
|
||||
message = getMessage("en", "disconnection-notification")
|
||||
self._client.ui.showMessage(message)
|
||||
self._client.ui.showErrorMessage(message)
|
||||
|
||||
def clientConnectionFailed(self, connector, reason):
|
||||
if not self.reconnecting:
|
||||
self._client.ui.showMessage(getMessage("en", "connection-failed-notification"))
|
||||
self._client.stop(True)
|
||||
self._client.ui.showErrorMessage(getMessage("en", "connection-failed-notification"))
|
||||
else:
|
||||
self.clientConnectionLost(connector, reason)
|
||||
|
||||
|
||||
@ -85,7 +85,11 @@ class MainWindow(QtGui.QMainWindow):
|
||||
print(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):
|
||||
if room == None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user