示例#1
0
 def edit_event(self, menu, event, lat, lon, mark):
     """
     Edit the selected event at the marker position
     """
     _LOG.debug("edit_event : %s", mark[10])
     event = self.dbstate.db.get_event_from_gramps_id(mark[10])
     try:
         EditEvent(self.dbstate, self.uistate, [], event)
     except WindowActiveError:
         pass
示例#2
0
 def edit_event(self, treeview):
     """
     Edit the selected event.
     """
     model, iter_ = treeview.get_selection().get_selected()
     if iter_:
         handle = model.get_value(iter_, 0)
         try:
             event = self.dbstate.db.get_event_from_handle(handle)
             EditEvent(self.dbstate, self.uistate, [], event)
         except WindowActiveError:
             pass
示例#3
0
 def edit_menu(self, obj, handle, obj_type):
     if obj_type == 'Person':
         person = self.dbstate.db.get_person_from_handle(handle)
         try:
             EditPerson(self.dbstate, self.uistate, [], person)
         except WindowActiveError:
             pass
     elif obj_type == 'Event':
         event = self.dbstate.db.get_event_from_handle(handle)
         try:
             EditEvent(self.dbstate, self.uistate, [], event)
         except WindowActiveError:
             pass
示例#4
0
    def clone(self, obj):
        """
        Clones the selected event.
        """
        event_list = self.selected_handles()

        if len(event_list) != 1:
            msg = _("Cannot clone event object.")
            msg2 = _("Exactly one event must be selected to perform a clone.")
            ErrorDialog(msg, msg2, parent=self.uistate.window)
        else:
            event = Event()
            event = copy.deepcopy(
                self.dbstate.db.get_event_from_handle(event_list[0]))
            event.gramps_id = None

            try:
                self.uistate.action = 'event-clone'
                EditEvent(self.dbstate, self.uistate, [], event)
            except WindowActiveError:
                pass
示例#5
0
文件: eventview.py 项目: oluul/gramps
 def add(self, obj):
     try:
         EditEvent(self.dbstate, self.uistate, [], Event())
     except WindowActiveError:
         pass
示例#6
0
 def edit_event(self, handle):
     event = self.dbstate.db.get_event_from_handle(handle)
     try:
         EditEvent(self.dbstate, self.uistate, [], event)
     except WindowActiveError:
         pass
示例#7
0
 def add(self, obj):
     try:
         self.uistate.action = 'event-add'
         EditEvent(self.dbstate, self.uistate, [], Event())
     except WindowActiveError:
         pass