rework of update mechanism and noaction message support for faster clicks on modal

This commit is contained in:
2020-03-30 20:25:17 +02:00
parent 02ea272aae
commit 1e84d965ff
5 changed files with 30 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
from message.simple_messages import NoReset, Reset, ModalNotOkClose, ClickMessage, DataChgClickMessage, KeyboardPress
from message.simple_messages import NoReset, Reset, ModalNotOkClose, ClickMessage, DataChgClickMessage, KeyboardPress, NoAction
from message.translation_edit import EditTranslation, MoveRight, MoveLeft, BinTranslation
from message.show_messages import ShowEntryLabelsEdit, ShowEditTranslation, ShowSenseLabelEdit, ShowSenseDefinitionEdit, ShowCommentEdit, ShowAddTranslation, ShowExampleEdit, ShowVariantsEdit, ShowRelatedEntriesEdit
from message.simple_edits import EditSenseLabel, EditSenseDefinition, EditComment, AddSenseLabel, AddSense, AddExampleTranslation, DoChosenExamples, AddToLabelList, AddToGenericList, EditVariants, EditRelatedEntries, EditEntryLabels, ExampleClusterEdit, ExampleClusterAdd

View File

@@ -39,6 +39,9 @@ class Message:
def clear_args(self):
self._args = []
def no_action(self):
return False
def msg(message_class, *params):
@@ -49,5 +52,5 @@ def msg(message_class, *params):
return
message.on_event(event)
update.schedule(message)
update.update_model(message)
return callback

View File

@@ -28,6 +28,11 @@ class NoReset(Reset):
return False
class NoAction(NoReset):
def no_action(self):
return True
class KeyboardPress(Message):
def on_event(self, event):
self.add_arg(event.key)