Fix ToDo Gramplet for multiple attempts to edit a note (#719)

Fixes #10645
This commit is contained in:
Paul Culley 2018-11-27 22:34:12 -06:00 committed by Sam Manzi
parent 9cc6e3a05e
commit b934b0d424

View File

@ -34,6 +34,7 @@ from gramps.gui.widgets.styledtexteditor import StyledTextEditor
from gramps.gui.widgets import SimpleButton from gramps.gui.widgets import SimpleButton
from gramps.gen.lib import StyledText, Note, NoteType from gramps.gen.lib import StyledText, Note, NoteType
from gramps.gen.db import DbTxn from gramps.gen.db import DbTxn
from gramps.gen.errors import WindowActiveError
from gramps.gen.const import GRAMPS_LOCALE as glocale from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
@ -177,7 +178,7 @@ class ToDo(Gramplet):
note = self.dbstate.db.get_note_from_handle(note_handle) note = self.dbstate.db.get_note_from_handle(note_handle)
try: try:
EditNote(self.gui.dbstate, self.gui.uistate, [], note) EditNote(self.gui.dbstate, self.gui.uistate, [], note)
except AttributeError: except WindowActiveError:
pass pass
def new_clicked(self, obj): def new_clicked(self, obj):
@ -189,7 +190,7 @@ class ToDo(Gramplet):
note.set_type(NoteType.TODO) note.set_type(NoteType.TODO)
try: try:
EditNote(self.gui.dbstate, self.gui.uistate, [], note, self.created) EditNote(self.gui.dbstate, self.gui.uistate, [], note, self.created)
except AttributeError: except WindowActiveError:
pass pass
class PersonToDo(ToDo): class PersonToDo(ToDo):