changeset 2134:f45250052846

primitivus: fixed display of error if a message can't be sent
author Goffi <goffi@goffi.org>
date Sun, 05 Feb 2017 14:55:21 +0100
parents 7de291c3cd0c
children 4e67d6ffea66
files frontends/src/primitivus/primitivus
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/primitivus/primitivus	Sun Feb 05 14:55:21 2017 +0100
+++ b/frontends/src/primitivus/primitivus	Sun Feb 05 14:55:21 2017 +0100
@@ -88,7 +88,7 @@
                     chat_widget.target,
                     {'': editBar.get_edit_text()}, # TODO: handle language
                     mess_type = C.MESS_TYPE_GROUPCHAT if chat_widget.type == C.CHAT_GROUP else C.MESS_TYPE_CHAT, # TODO: put this in QuickChat
-                    errback=lambda failure: self.host.notify(_("Error while sending message ({})").format(failure)),
+                    errback=lambda failure: self.host.showDialog(_("Error while sending message ({})").format(failure), type="error"),
                     profile_key=chat_widget.profile
                     )
                 editBar.set_edit_text('')
@@ -717,16 +717,16 @@
         if answer_cb is not None:
             answer_cb(False, answer_data)
 
-    def showDialog(self, message, title="", type_="info", answer_cb = None, answer_data = None):
-        if type_ == 'info':
+    def showDialog(self, message, title="", type="info", answer_cb = None, answer_data = None):
+        if type == 'info':
             popup = sat_widgets.Alert(title, message, ok_cb=answer_cb)
             if answer_cb is None:
                 popup.setCallback('ok', lambda dummy: self.removePopUp(popup))
-        elif type_ == 'error':
+        elif type == 'error':
             popup = sat_widgets.Alert(title, message, ok_cb=answer_cb)
             if answer_cb is None:
                 popup.setCallback('ok', lambda dummy: self.removePopUp(popup))
-        elif type_ == 'yes/no':
+        elif type == 'yes/no':
             popup = sat_widgets.ConfirmDialog(message)
             popup.setCallback('yes', self._dialogOkCb, (popup, answer_cb, answer_data))
             popup.setCallback('no', self._dialogCancelCb, (popup, answer_cb, answer_data))
@@ -734,7 +734,7 @@
             popup = sat_widgets.Alert(title, message, ok_cb=answer_cb)
             if answer_cb is None:
                 popup.setCallback('ok', lambda dummy: self.removePopUp(popup))
-            log.error(u'unmanaged dialog type: {}'.format(type_))
+            log.error(u'unmanaged dialog type: {}'.format(type))
         self.showPopUp(popup)
 
     def dialogFailure(self, failure):