# HG changeset patch # User souliane # Date 1406281407 -7200 # Node ID ec3f30253040590470f4a06f6038414515fd1f20 # Parent 60be99de3808c3b075167c90582b733e67b6977a browser_side: also display the warning banner when writing to a single contact and unibox is disabled diff -r 60be99de3808 -r ec3f30253040 src/browser/sat_browser/panels.py --- a/src/browser/sat_browser/panels.py Fri Jul 25 02:38:30 2014 +0200 +++ b/src/browser/sat_browser/panels.py Fri Jul 25 11:43:27 2014 +0200 @@ -662,7 +662,7 @@ class MicroblogPanel(base_widget.LiberviaWidget): - warning_msg_public = "This message will be PUBLIC and everybody will be able to see it, even people you don't know" + warning_msg_public = "This message will be PUBLIC and everybody will be able to see it, even people you don't know" warning_msg_group = "This message will be published for all the people of the group %s" def __init__(self, host, accepted_groups): @@ -1093,7 +1093,7 @@ self.host.setSelected(None) -class ChatPanel(base_widget.LiberviaWidget): +class ChatPanel(base_widget.LiberviaWidget, KeyboardHandler): def __init__(self, host, target, type_='one2one'): """Panel used for conversation (one 2 one or group chat) @@ -1156,8 +1156,15 @@ if enable_box: self.message_box = MessageBox(self.host) self.message_box.onSelectedChange(self) + self.message_box.addKeyboardListener(self) self.vpanel.add(self.message_box) + def onKeyDown(self, sender, keycode, modifiers): + if keycode == KEY_ENTER: + self.host.showWarning(None, None) + else: + self.host.showWarning(*self.getWarningData()) + def matchEntity(self, entity): """ @param entity: target jid as a string or jid.JID instance.