Changing how senses are added and how buttons are shown.

This commit is contained in:
2019-11-20 18:58:48 +01:00
parent 06ab8f2230
commit 1039a686cc
7 changed files with 62 additions and 63 deletions

View File

@@ -1,6 +1,6 @@
from message.simple_messages import NoReset, Reset, ModalNotOkClose
from message.translation_edit import EditTranslation, MoveRight, MoveLeft, BinTranslation
from message.show_messages import ShowMenu, ShowEntryLabelsEdit, ShowEditTranslation, ShowSenseLabelEdit, ShowSenseDefinitionEdit, ShowCommentEdit, ShowAddTranslation, ShowSenseAdd, ShowExampleEdit, ShowExampleTranslationEdit, ShowVariantsEdit
from message.show_messages import ShowMenu, ShowEntryLabelsEdit, ShowEditTranslation, ShowSenseLabelEdit, ShowSenseDefinitionEdit, ShowCommentEdit, ShowAddTranslation, ShowExampleEdit, ShowExampleTranslationEdit, ShowVariantsEdit
from message.simple_edits import EditSenseLabel, EditSenseDefinition, EditComment, AddSenseLabel, AddSense, EditExample, AddExampleTranslation, EditExampleTranslation, AddToLabelList, AddToGenericList, EditVariants, EditEntryLabels
from message.message import msg

View File

@@ -34,12 +34,6 @@ class ShowSenseDefinitionEdit(ClickMessage):
model.modal = lambda: modals.edit_sense_definition(model.sense)
class ShowSenseAdd(ClickMessage):
def update_model(self, model):
model.modal_shown = True
model.modal = lambda: modals.add_sense()
class ShowCommentEdit(ClickMessage):
def update_model(self, model):
model.modal_shown = True

View File

@@ -17,13 +17,6 @@ class EditSenseLabel(Message):
sense.labels = common_accessors.label_list_getter()
class AddSenseLabel(NoReset):
def update_model(self, model):
sense = self.get_arg(0, Sense)
# just adding to the copy to show in the modal
sense.copy().labels.append("")
class AddToGenericList(NoReset):
def update_model(self, model):
list_getter = self.get_arg(0)
@@ -46,10 +39,10 @@ class EditExampleTranslation(Message):
example.translations = common_accessors.generic_list_getter()
class AddSense(QuestionMessage):
class AddSense(Message):
def update_model(self, model):
sense = Sense.new_empty()
sense.labels = [self.new_text]
sense.definition = "New Sense"
model.entry.senses.append(sense)