Exemplo n.º 1
0
 def edit(self, obj):
     for handle in self.selected_handles():
         note = self.dbstate.db.get_note_from_handle(handle)
         try:
             EditNote(self.dbstate, self.uistate, [], note)
         except WindowActiveError:
             pass
Exemplo n.º 2
0
 def edit(self, indx):
     """
     Edit the note object with the given handle.
     """
     handle = self.changelist[indx][0]
     note = self.db.get_note_from_handle(handle)
     try:
         EditNote(self.dbstate, self.uistate, [], note)
     except WindowActiveError:
         pass
Exemplo n.º 3
0
 def edit_clicked(self, obj):
     """
     Edit current To Do note.
     """
     from gramps.gui.editors import EditNote
     note_handle = self.note_list[self.current]
     note = self.dbstate.db.get_note_from_handle(note_handle)
     try:
         EditNote(self.gui.dbstate, self.gui.uistate, [], note)
     except AttributeError:
         pass
Exemplo n.º 4
0
 def new_clicked(self, obj):
     """
     Create a new To Do note.
     """
     from gramps.gui.editors import EditNote
     note = Note()
     note.set_type(NoteType.TODO)
     try:
         EditNote(self.gui.dbstate, self.gui.uistate, [], note)
     except AttributeError:
         pass
Exemplo n.º 5
0
    def button_press(self, _view, path, _column):
        """
        Called when a right tree row is activated.  Edit the object.
        """
        iter_ = self.model_r.get_iter(path)
        (objclass, handle) = (self.model_r.get_value(iter_, 3),
                              self.model_r.get_value(iter_, 2))

        if objclass == 'Note':  # the method below did not include notes!!!
            try:
                note = self.db.get_note_from_handle(handle)
                EditNote(self.dbstate, self.uistate, [], note)
            except WindowActiveError:
                pass
        else:
            edit_object(self.dbstate, self.uistate, objclass, handle)
Exemplo n.º 6
0
 def new_clicked(self, obj):
     """
     Create a new To Do note.
     """
     nav_type = self.uistate.viewmanager.active_page.navigation_type()
     active_handle = self.get_active(nav_type)
     if active_handle:
         from gramps.gui.editors import EditNote
         note = Note()
         note.set_type(NoteType.TODO)
         try:
             EditNote(self.gui.dbstate, self.gui.uistate, [], note,
                      self.created)
         except WindowActiveError:
             pass
     else:
         WarningDialog(
             _("No active object"),
             _("First select the object to which you want to attach a note")
             + _(":") + _(nav_type),
             parent=self.uistate.window)
Exemplo n.º 7
0
 def add(self, obj):
     try:
         EditNote(self.dbstate, self.uistate, [], Note())
     except WindowActiveError:
         pass