Fix of #102. Errors are now shown up as red text.

This commit is contained in:
Uriziel 2013-06-15 14:52:57 +02:00
parent 9b21302372
commit 372ef826c0
2 changed files with 7 additions and 4 deletions

View File

@ -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)

View File

@ -85,7 +85,11 @@ class MainWindow(QtGui.QMainWindow):
print(message)
def showErrorMessage(self, message):
print("ERROR:\t" + message)
message = unicode(message)
message = message.replace("&", "&amp;").replace('"', "&quot;").replace("<", "&lt;").replace(">", "&gt;")
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: