rework of update mechanism and noaction message support for faster clicks on modal
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user