Changing how senses are added and how buttons are shown.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user