51 lines
1.5 KiB
Diff
51 lines
1.5 KiB
Diff
46a47,49
|
|
> self.note_type = "To Do"
|
|
> self.show_toolbar = True
|
|
>
|
|
51a55,63
|
|
>
|
|
> def build_options(self):
|
|
> from gramps.gen.plug.menu import StringOption, BooleanOption
|
|
>
|
|
> self.add_option(StringOption(_("Note type"),
|
|
> self.note_type))
|
|
> self.add_option(BooleanOption(_("Show toolbar"),
|
|
> self.show_toolbar))
|
|
>
|
|
62c74
|
|
< hbox.pack_start(self.left, False, False, 0)
|
|
---
|
|
> pack_start(self.left, False, False, 0)
|
|
76a89,90
|
|
> self.hbox = hbox
|
|
>
|
|
93a108,124
|
|
> def save_options(self):
|
|
> self.note_type = self.get_option(_("Note type")).get_value()
|
|
> self.show_toolbar = self.get_option(_("Show toolbar")).get_value()
|
|
>
|
|
>
|
|
> def on_load(self):
|
|
> if len(self.gui.data) == 2:
|
|
> self.note_type = self.gui.data[0]
|
|
> self.show_toolbar = bool(self.gui.data[1])
|
|
>
|
|
> def save_update_options(self, widget=None):
|
|
> self.note_type = self.get_option(_("Note type")).get_value()
|
|
> self.show_toolbar = self.get_option(_("Show toolbar")).get_value()
|
|
> self.gui.data = [self.note_type, self.show_toolbar]
|
|
>
|
|
> self.update()
|
|
>
|
|
104c135
|
|
< filter.add_rule(rules.note.HasType(["To Do"]))
|
|
---
|
|
> filter.add_rule(rules.note.HasType([self.note_type]))
|
|
154a186,187
|
|
> self.hbox.set_visible(self.show_toolbar)
|
|
>
|
|
203c236
|
|
< note.set_type(NoteType.TODO)
|
|
---
|
|
> note.set_type(self.note_type)
|