# HG changeset patch # User souliane # Date 1452627260 -3600 # Node ID ab87da50082058044b0a07135d87bedc2a1ccc86 # Parent 620306b3d5be1ac975eead0b1f84dd8de184ea59 browser: validate the status with ENTER (fixes bug 111) diff -r 620306b3d5be -r ab87da500820 src/browser/sat_browser/editor_widget.py --- a/src/browser/sat_browser/editor_widget.py Tue Jan 12 20:24:30 2016 +0100 +++ b/src/browser/sat_browser/editor_widget.py Tue Jan 12 20:34:20 2016 +0100 @@ -226,6 +226,7 @@ """Base class for manage a simple text editor.""" CONVERT_NEW_LINES = True + VALIDATE_WITH_SHIFT_ENTER = True def __init__(self, content=None, modifiedCb=None, afterEditCb=None, options=None): """ @@ -303,7 +304,7 @@ listener(self.textarea, keycode, modifiers) # FIXME: edit_listeners must either be removed, or send an action instead of keycode/modifiers if not self.options['listen_keyboard']: return - if keycode == keyb.KEY_ENTER and modifiers & keyb.MODIFIER_SHIFT: + if keycode == keyb.KEY_ENTER and (not self.VALIDATE_WITH_SHIFT_ENTER or modifiers & keyb.MODIFIER_SHIFT): self.textarea.setFocus(False) if not self.options['listen_focus']: self.edit(False) diff -r 620306b3d5be -r ab87da500820 src/browser/sat_browser/main_panel.py --- a/src/browser/sat_browser/main_panel.py Tue Jan 12 20:24:30 2016 +0100 +++ b/src/browser/sat_browser/main_panel.py Tue Jan 12 20:34:20 2016 +0100 @@ -125,6 +125,7 @@ class StatusPanel(editor_widget.HTMLTextEditor): EMPTY_STATUS = '<click to set a status>' + VALIDATE_WITH_SHIFT_ENTER = False def __init__(self, host, status=''): self.host = host