Пример #1
1
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'citation-add'     : self._citation_row_add,
            'citation-update'  : self._citation_row_update,
            'citation-delete'  : self._citation_row_delete,
            'citation-rebuild' : self._citation_object_build,
            'source-add'       : self._source_row_add,
            'source-update'    : self._source_row_update,
            'source-delete'    : self._source_row_delete,
            'source-rebuild'   : self._source_object_build,
            }

        ListView.__init__(
            self, _('Citation Tree View'), pdata, dbstate, uistate,
            CitationTreeModel, signal_map,
            CitationBookmarks, nav_group,
            multiple=True,
            filter_class=SourceSidebarFilter)

        self.func_list.update({
            '<PRIMARY>J' : self.jump,
            '<PRIMARY>BackSpace' : self.key_delete,
            })

        self.additional_uis.append(self.additional_ui())
Пример #2
0
    def __init__(self, pdata, dbstate, uistate, title, model, nav_group):

        signal_map = {
            'place-add'     : self.row_add,
            'place-update'  : self.row_update,
            'place-delete'  : self.row_delete,
            'place-rebuild' : self.object_build,
            }

        self.mapservice = config.get('interface.mapservice')
        self.mapservicedata = {}

        ListView.__init__(
            self, title, pdata, dbstate, uistate,
            model, signal_map,
            PlaceBookmarks, nav_group,
            multiple=True,
            filter_class=PlaceSidebarFilter)

        self.func_list.update({
            '<PRIMARY>J' : self.jump,
            '<PRIMARY>BackSpace' : self.key_delete,
            })
        self.maptoolbtn = None

        uistate.connect('placeformat-changed', self.build_tree)

        self.additional_uis.append(self.additional_ui())
Пример #3
0
    def __init__(self, pdata, dbstate, uistate, title, model, nav_group=0):
        """
        Create the Person View
        """
        signal_map = {
            'person-add'     : self.row_add,
            'person-update'  : self.row_update,
            'person-delete'  : self.row_delete,
            'person-rebuild' : self.object_build,
            'person-groupname-rebuild' : self.object_build,
            'no-database': self.no_database,
            'family-update'  : self.related_update,
            'family-add'     : self.related_update,
            'event-update'   : self.related_update,
            'place-update'   : self.related_update,
            }

        ListView.__init__(
            self, title, pdata, dbstate, uistate,
            model, signal_map,
            PersonBookmarks, nav_group,
            multiple=True,
            filter_class=PersonSidebarFilter)

        uistate.connect('nameformat-changed', self.build_tree)
        uistate.connect('placeformat-changed', self.build_tree)

        self.additional_uis.append(self.additional_ui)
Пример #4
0
 def set_inactive(self):
     """called by viewmanager when moving away from the page
     Here we need to remove the menutoolbutton from the menu
     """
     tb = self.uistate.viewmanager.uimanager.get_widget('/ToolBar')
     tb.remove(self.maptoolbtn)
     ListView.set_inactive(self)
Пример #5
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'repository-add': self.row_add,
            'repository-update': self.row_update,
            'repository-delete': self.row_delete,
            'repository-rebuild': self.object_build,
        }

        ListView.__init__(self,
                          _('Repositories'),
                          pdata,
                          dbstate,
                          uistate,
                          RepositoryModel,
                          signal_map,
                          RepoBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=RepoSidebarFilter)

        self.func_list.update({
            '<PRIMARY>J': self.jump,
            '<PRIMARY>BackSpace': self.key_delete,
        })

        self.additional_uis.append(self.additional_ui())
Пример #6
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):
        """
        Create the Event View
        """
        signal_map = {
            'event-add'     : self.row_add,
            'event-update'  : self.row_update,
            'event-delete'  : self.row_delete,
            'event-rebuild' : self.object_build,
            'person-update' : self.person_update,
            'person-add'    : self.person_update,
            'person-delete' : self.object_build,  # TODO slow way to do this
            'family-update' : self.family_update,
            'family-add'    : self.family_update,
            'family-delete' : self.object_build,  # TODO slow way to do this
            'place-update'  : self.related_update,
            }

        ListView.__init__(
            self, _('Events'), pdata, dbstate, uistate,
            EventModel,
            signal_map,
            EventBookmarks, nav_group,
            multiple=True,
            filter_class=EventSidebarFilter)

        self.func_list.update({
            '<PRIMARY>J' : self.jump,
            '<PRIMARY>BackSpace' : self.key_delete,
            })

        uistate.connect('nameformat-changed', self.build_tree)
        uistate.connect('placeformat-changed', self.build_tree)

        self.additional_uis.append(self.additional_ui())
Пример #7
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):
        """
        Create the Event View
        """
        signal_map = {
            'event-add': self.row_add,
            'event-update': self.row_update,
            'event-delete': self.row_delete,
            'event-rebuild': self.object_build,
        }

        ListView.__init__(self,
                          _('Events'),
                          pdata,
                          dbstate,
                          uistate,
                          EventModel,
                          signal_map,
                          EventBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=EventSidebarFilter)

        self.func_list.update({
            '<PRIMARY>J': self.jump,
            '<PRIMARY>BackSpace': self.key_delete,
        })

        uistate.connect('nameformat-changed', self.build_tree)

        self.additional_uis.append(self.additional_ui())
Пример #8
0
    def define_actions(self):
        """
        This defines the possible actions for the citation views.
        Possible actions are:
        add_source: Add a new source (this is also available from the
                      source view)
        add:        Add a new citation and a new source (this can also be done
                      by source view add a source, then citation view add a new
                      citation to an existing source)
        share:      Add a new citation to an existing source (when a source is
                      selected)
        edit:       Edit a source or a citation.
        merge:      Merge the selected sources or citations.
        remove:     Delete the selected sources or citations.


        """
        ListView.define_actions(self)

        self.action_list.extend([
            ('AddSource', self.add_source),
            ('AddCitation', self.share),
            ('OpenAllNodes', self.open_all_nodes),
            ('CloseAllNodes', self.close_all_nodes),
        ])
Пример #9
0
    def __init__(self, pdata, dbstate, uistate, title, model, nav_group=0):
        """
        Create the Person View
        """
        signal_map = {
            'person-add': self.row_add,
            'person-update': self.row_update,
            'person-delete': self.row_delete,
            'person-rebuild': self.object_build,
            'person-groupname-rebuild': self.object_build,
            'no-database': self.no_database,
            'family-update': self.related_update,
            'family-add': self.related_update,
            'event-update': self.related_update,
            'place-update': self.related_update,
        }

        ListView.__init__(self,
                          title,
                          pdata,
                          dbstate,
                          uistate,
                          model,
                          signal_map,
                          PersonBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=PersonSidebarFilter)

        uistate.connect('nameformat-changed', self.build_tree)
        uistate.connect('placeformat-changed', self.build_tree)

        self.additional_uis.append(self.additional_ui)
Пример #10
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'note-add': self.row_add,
            'note-update': self.row_update,
            'note-delete': self.row_delete,
            'note-rebuild': self.object_build,
        }

        ListView.__init__(self,
                          _('Notes'),
                          pdata,
                          dbstate,
                          uistate,
                          NoteModel,
                          signal_map,
                          NoteBookmarks,
                          nav_group,
                          filter_class=NoteSidebarFilter,
                          multiple=True)

        self.func_list.update({
            '<PRIMARY>J': self.jump,
            '<PRIMARY>BackSpace': self.key_delete,
        })

        self.additional_uis.append(self.additional_ui())
Пример #11
0
    def define_actions(self):
        """
        This defines the possible actions for the citation views.
        Possible actions are:
        add:        Add a new citation and a new source (this can also be done
                      by source view add a source, then citation view add a new
                      citation to an existing source)
        edit:       Edit a citation.
        merge:      Merge the selected citations.
        remove:     Delete the selected citations.


        """
        ListView.define_actions(self)

        self.all_action = Gtk.ActionGroup(name=self.title + "/CitationAll")
        self.edit_action = Gtk.ActionGroup(name=self.title + "/CitationEdit")

        self._add_action(
            'FilterEdit',
            None,
            _('Citation Filter Editor'),
            callback=self.filter_editor,
        )
        self._add_action('QuickReport', None, _("Quick View"), None, None,
                         None)

        self._add_action_group(self.edit_action)
        self._add_action_group(self.all_action)
Пример #12
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'citation-add': self._citation_row_add,
            'citation-update': self._citation_row_update,
            'citation-delete': self._citation_row_delete,
            'citation-rebuild': self._citation_object_build,
            'source-add': self._source_row_add,
            'source-update': self._source_row_update,
            'source-delete': self._source_row_delete,
            'source-rebuild': self._source_object_build,
        }

        ListView.__init__(self,
                          _('Citation Tree View'),
                          pdata,
                          dbstate,
                          uistate,
                          CitationTreeModel,
                          signal_map,
                          CitationBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=SourceSidebarFilter)

        self.func_list.update({
            '<PRIMARY>J': self.jump,
            '<PRIMARY>BackSpace': self.key_delete,
        })

        self.additional_uis.append(self.additional_ui())
Пример #13
0
    def __init__(self, pdata, dbstate, uistate, title, model, nav_group):

        signal_map = {
            'place-add': self.row_add,
            'place-update': self.row_update,
            'place-delete': self.row_delete,
            'place-rebuild': self.object_build,
        }

        self.mapservice = config.get('interface.mapservice')
        self.mapservicedata = {}
        self.map_action_group = None

        ListView.__init__(self,
                          title,
                          pdata,
                          dbstate,
                          uistate,
                          model,
                          signal_map,
                          PlaceBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=PlaceSidebarFilter)

        uistate.connect('placeformat-changed', self.build_tree)

        _ui = self.__create_maps_menu_actions()
        self.additional_uis.append(_ui)
Пример #14
0
    def define_actions(self):
        """
        Defines the UIManager actions specific to Media View. We need to make
        sure that the common List View actions are defined as well, so we
        call the parent function.
        """
        ListView.define_actions(self)

        self._add_action('FilterEdit',
                         None,
                         _('Media Filter Editor'),
                         callback=self.filter_editor)
        self._add_action('OpenMedia',
                         'gramps-viewmedia',
                         _('View'),
                         tip=_("View in the default viewer"),
                         callback=self.view_media)
        self._add_action('OpenContainingFolder',
                         None,
                         _('Open Containing _Folder'),
                         tip=_("Open the folder containing the media file"),
                         callback=self.open_containing_folder)

        self._add_action('QuickReport', None, _("Quick View"), None, None,
                         None)
Пример #15
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'family-add': self.row_add,
            'family-update': self.row_update,
            'family-delete': self.row_delete,
            'family-rebuild': self.object_build,
            'event-update': self.related_update,
            'person-update': self.related_update,
        }

        ListView.__init__(self,
                          _('Families'),
                          pdata,
                          dbstate,
                          uistate,
                          FamilyModel,
                          signal_map,
                          FamilyBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=FamilySidebarFilter)

        uistate.connect('nameformat-changed', self.build_tree)

        self.additional_uis.append(self.additional_ui)
Пример #16
0
    def __init__(self, pdata, dbstate, uistate, title, model, nav_group=0):
        """
        Create the Person View
        """
        signal_map = {
            'person-add'     : self.row_add,
            'person-update'  : self.row_update,
            'person-delete'  : self.row_delete,
            'person-rebuild' : self.object_build,
            'person-groupname-rebuild' : self.object_build,
            'no-database': self.no_database,
            'family-update'  : self.object_build,
            'family-add'     : self.object_build,
            'family-delete'  : self.object_build,
            }

        ListView.__init__(
            self, title, pdata, dbstate, uistate,
            model, signal_map,
            PersonBookmarks, nav_group,
            multiple=True,
            filter_class=PersonSidebarFilter)

        self.func_list.update({
            '<PRIMARY>J' : self.jump,
            '<PRIMARY>BackSpace' : self.key_delete,
            })

        uistate.connect('nameformat-changed', self.build_tree)

        self.additional_uis.append(self.additional_ui())
Пример #17
0
    def __init__(self, pdata, dbstate, uistate, title, model, nav_group=0):
        """
        Create the Person View
        """
        signal_map = {
            'person-add': self.row_add,
            'person-update': self.row_update,
            'person-delete': self.row_delete,
            'person-rebuild': self.object_build,
            'person-groupname-rebuild': self.object_build,
            'no-database': self.no_database,
        }

        ListView.__init__(self,
                          title,
                          pdata,
                          dbstate,
                          uistate,
                          model,
                          signal_map,
                          PersonBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=PersonSidebarFilter)

        self.func_list.update({
            '<PRIMARY>J': self.jump,
            '<PRIMARY>BackSpace': self.key_delete,
        })

        uistate.connect('nameformat-changed', self.build_tree)

        self.additional_uis.append(self.additional_ui())
Пример #18
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'family-add'     : self.row_add,
            'family-update'  : self.row_update,
            'family-delete'  : self.row_delete,
            'family-rebuild' : self.object_build,
            }

        ListView.__init__(
            self, _('Families'), pdata, dbstate, uistate,
            FamilyModel,
            signal_map,
            FamilyBookmarks, nav_group,
            multiple=True,
            filter_class=FamilySidebarFilter)

        self.func_list.update({
            '<PRIMARY>J' : self.jump,
            '<PRIMARY>BackSpace' : self.key_delete,
            })

        uistate.connect('nameformat-changed', self.build_tree)

        self.additional_uis.append(self.additional_ui())
Пример #19
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):
        """
        Create the Event View
        """
        signal_map = {
            'event-add': self.row_add,
            'event-update': self.row_update,
            'event-delete': self.row_delete,
            'event-rebuild': self.object_build,
            'person-update': self.person_update,
            'person-add': self.person_update,
            'person-delete': self.object_build,  # TODO slow way to do this
            'family-update': self.family_update,
            'family-add': self.family_update,
            'family-delete': self.object_build,  # TODO slow way to do this
            'place-update': self.related_update,
        }

        ListView.__init__(self,
                          _('Events'),
                          pdata,
                          dbstate,
                          uistate,
                          EventModel,
                          signal_map,
                          EventBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=EventSidebarFilter)

        uistate.connect('nameformat-changed', self.build_tree)
        uistate.connect('placeformat-changed', self.build_tree)

        self.additional_uis.append(self.additional_ui)
Пример #20
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'family-add': self.row_add,
            'family-update': self.row_update,
            'family-delete': self.row_delete,
            'family-rebuild': self.object_build,
        }

        ListView.__init__(self,
                          _('Families'),
                          pdata,
                          dbstate,
                          uistate,
                          FamilyModel,
                          signal_map,
                          FamilyBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=FamilySidebarFilter)

        self.func_list.update({
            '<PRIMARY>J': self.jump,
            '<PRIMARY>BackSpace': self.key_delete,
        })

        uistate.connect('nameformat-changed', self.build_tree)

        self.additional_uis.append(self.additional_ui())
Пример #21
0
 def define_actions(self):
     ListView.define_actions(self)
     self._add_action('FilterEdit',
                      None,
                      _('Event Filter Editor'),
                      callback=self.filter_editor)
     self._add_action('QuickReport', None, _("Quick View"), None, None,
                      None)
Пример #22
0
 def enable_action_group(self, obj):
     """
     Turns on the visibility of the View's action group.
     """
     ListView.enable_action_group(self, obj)
     self.all_action.set_visible(True)
     self.edit_action.set_visible(True)
     self.edit_action.set_sensitive(not self.dbstate.db.readonly)
Пример #23
0
    def disable_action_group(self):
        """
        Turns off the visibility of the View's action group.
        """
        ListView.disable_action_group(self)

        self.all_action.set_visible(False)
        self.edit_action.set_visible(False)
Пример #24
0
 def enable_action_group(self, obj):
     """
     Turns on the visibility of the View's action group.
     """
     ListView.enable_action_group(self, obj)
     self.all_action.set_visible(True)
     self.edit_action.set_visible(True)
     self.edit_action.set_sensitive(not self.dbstate.db.readonly)
Пример #25
0
    def disable_action_group(self):
        """
        Turns off the visibility of the View's action group.
        """
        ListView.disable_action_group(self)

        self.all_action.set_visible(False)
        self.edit_action.set_visible(False)
Пример #26
0
    def define_actions(self):
        """Add the Forward action group to handle the Forward button."""

        ListView.define_actions(self)

        self.action_list.extend([
            ('MakeFatherActive', self._make_father_active),
            ('MakeMotherActive', self._make_mother_active),
        ])
Пример #27
0
    def define_actions(self):
        """
        Defines the UIManager actions specific to Media View. We need to make
        sure that the common List View actions are defined as well, so we
        call the parent function.
        """
        ListView.define_actions(self)

        self._add_action('OpenMedia', self.view_media)
        self._add_action('OpenContainingFolder', self.open_containing_folder)
Пример #28
0
    def define_actions(self):
        """
        Defines the UIManager actions specific to Media View. We need to make
        sure that the common List View actions are defined as well, so we
        call the parent function.
        """
        ListView.define_actions(self)

        self._add_action('OpenMedia', self.view_media)
        self._add_action('OpenContainingFolder', self.open_containing_folder)
Пример #29
0
 def change_page(self):
     """
     Called by viewmanager at end of realization when arriving on the page
     At this point the Toolbar is created. We need to:
       1. get the menutoolbutton
       2. add all possible map services in the drop down menu
       3. add the actions that correspond to clicking in this drop down menu
       4. set icon and label of the menutoolbutton now that it is realized
       5. store label so it can be changed when selection changes
     """
     ListView.change_page(self)
Пример #30
0
    def row_update(self, handle_list):
        """
        Called when a place is updated.
        """
        ListView.row_update(self, handle_list)

        for handle in handle_list:
            # Rebuild the model if the primary parent has changed.
            if self._parent_changed(handle):
                self.build_tree()
                break
Пример #31
0
    def change_page(self):
        """
        Called by viewmanager at end of realization when arriving on the page
        At this point the Toolbar is created. We need to:
          1. get the menutoolbutton
          2. add all possible map services in the drop down menu
          3. add the actions that correspond to clicking in this drop down menu
          4. set icon and label of the menutoolbutton now that it is realized
          5. store label so it can be changed when selection changes
        """
        ListView.change_page(self)
        #menutoolbutton has to be made and added in correct place on toolbar
        if not self.maptoolbtn:
            self.maptoolbtn = Gtk.MenuToolButton()
            self.maptoolbtn.set_icon_name('go-jump')
            self.maptoolbtn.connect('clicked', self.gotomap)
            self.mmenu = self.__create_maps_menu_actions()
            self.maptoolbtn.set_menu(self.mmenu)
            self.maptoolbtn.show()
        tb = self.uistate.viewmanager.uimanager.get_widget('/ToolBar')
        ind = tb.get_item_index(self.uistate.viewmanager.uimanager.get_widget(
                        '/ToolBar/CommonEdit/Merge'))
        tb.insert(self.maptoolbtn, ind+1)
        widget = self.maptoolbtn

        if not self.mapservicedata:
            return

        self.mapslistlabel = []
        if not self.mapservice in self.mapservicedata:
            #stored val no longer exists, use the first key instead
            self.set_mapservice(list(self.mapservicedata.keys())[0])

        #store all gtk labels to be able to update label on selection change_('Loading...'),
        widget.set_menu(self.mmenu)
        widget.set_arrow_tooltip_text(_('Select a Map Service'))
        widget.set_tooltip_text(
                          _("Attempt to see selected locations with a Map "
                            "Service (OpenstreetMap, Google Maps, ...)"))
        lbl = Gtk.Label(label=self.mapservice_label())
        lbl.show()
        self.mapslistlabel.append(lbl)
        widget.set_label_widget(self.mapslistlabel[-1])
        widget.set_icon_name('go-jump')
        if self.drag_info():
            self.list.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK,
              [],
              Gdk.DragAction.COPY)
            tglist = Gtk.TargetList.new([])
            tglist.add(self.drag_info().atom_drag_type,
                       self.drag_info().target_flags,
                       self.drag_info().app_id)
            tglist.add_text_targets (0)
            self.list.drag_source_set_target_list(tglist)
Пример #32
0
    def row_update(self, handle_list):
        """
        Called when a place is updated.
        """
        ListView.row_update(self, handle_list)

        for handle in handle_list:
            # Rebuild the model if the primary parent has changed.
            if self._parent_changed(handle):
                self.build_tree()
                break
Пример #33
0
 def change_page(self):
     """
     Called by viewmanager at end of realization when arriving on the page
     At this point the Toolbar is created. We need to:
       1. get the menutoolbutton
       2. add all possible map services in the drop down menu
       3. add the actions that correspond to clicking in this drop down menu
       4. set icon and label of the menutoolbutton now that it is realized
       5. store label so it can be changed when selection changes
     """
     ListView.change_page(self)
Пример #34
0
    def define_actions(self):
        """
        This defines the possible actions for the citation views.
        Possible actions are:
        add_source: Add a new source (this is also available from the
                      source view)
        add:        Add a new citation and a new source (this can also be done
                      by source view add a source, then citation view add a new
                      citation to an existing source)
        share:      Add a new citation to an existing source (when a source is
                      selected)
        edit:       Edit a source or a citation.
        merge:      Merge the selected sources or citations.
        remove:     Delete the selected sources or citations.


        """
        ListView.define_actions(self)

        self._add_action('Add source',
                         'gramps-source',
                         _("Add source..."),
                         accel=None,
                         tip=self.ADD_SOURCE_MSG,
                         callback=self.add_source)
        self._add_action('Add citation',
                         'gramps-citation',
                         _("Add citation..."),
                         accel=None,
                         tip=self.ADD_CITATION_MSG,
                         callback=self.share)

        self.all_action = Gtk.ActionGroup(name=self.title + "/CitationAll")
        self.edit_action = Gtk.ActionGroup(name=self.title + "/CitationEdit")

        self._add_action(
            'FilterEdit',
            None,
            _('Citation Filter Editor'),
            callback=self.filter_editor,
        )
        self._add_action('QuickReport', None, _("Quick View"), None, None,
                         None)

        self._add_action_group(self.edit_action)
        self._add_action_group(self.all_action)

        self.all_action.add_actions([
            ('OpenAllNodes', None, _("Expand all Nodes"), None, None,
             self.open_all_nodes),
            ('CloseAllNodes', None, _("Collapse all Nodes"), None, None,
             self.close_all_nodes),
        ])
Пример #35
0
 def define_actions(self):
     ListView.define_actions(self)
     self.edit_action.add_actions([
         ('Clone', 'gramps-clone', _('Clone...'), None, self.CLONE_MSG,
          self.clone),
     ])
     self._add_action(
         'FilterEdit',
         None,
         _('Event Filter Editor'),
         callback=self.filter_editor,
     )
     self._add_action('QuickReport', None, _("Quick View"), None, None,
                      None)
Пример #36
0
    def define_actions(self):
        """
        Required define_actions function for PageView. Builds the action
        group information required. We extend beyond the normal here,
        since we want to have more than one action group for the PersonView.
        Most PageViews really won't care about this.

        Special action groups for Forward and Back are created to allow the
        handling of navigation buttons. Forward and Back allow the user to
        advance or retreat throughout the history, and we want to have these
        be able to toggle these when you are at the end of the history or
        at the beginning of the history.
        """

        ListView.define_actions(self)
Пример #37
0
    def define_actions(self):
        """
        Required define_actions function for PageView. Builds the action
        group information required. We extend beyond the normal here,
        since we want to have more than one action group for the PersonView.
        Most PageViews really won't care about this.

        Special action groups for Forward and Back are created to allow the
        handling of navigation buttons. Forward and Back allow the user to
        advance or retreat throughout the history, and we want to have these
        be able to toggle these when you are at the end of the history or
        at the beginning of the history.
        """

        ListView.define_actions(self)
Пример #38
0
 def define_actions(self):
     ListView.define_actions(self)
     self._add_toolmenu_action('MapsList', _('Loading...'),
                     _("Attempt to see selected locations with a Map "
                             "Service (OpenstreetMap, Google Maps, ...)"),
                     self.gotomap,
                     _('Select a Map Service'))
     self._add_action('GotoMap', 'go-jump',
                     _('_Look up with Map Service'),
                     callback=self.gotomap,
                     tip=_("Attempt to see this location with a Map "
                             "Service (OpenstreetMap, Google Maps, ...)"))
     self._add_action('FilterEdit', None, _('Place Filter Editor'),
                      callback=self.filter_editor)
     self._add_action('QuickReport', None, _("Quick View"), None, None, None)
Пример #39
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'citation-add'     : self.row_add,
            'citation-update'  : self.row_update,
            'citation-delete'  : self.row_delete,
            'citation-rebuild' : self.object_build,
            }

        ListView.__init__(
            self, _('Citation View'), pdata, dbstate, uistate,
            CitationListModel, signal_map,
            CitationBookmarks, nav_group,
            multiple=True,
            filter_class=CitationSidebarFilter)

        self.additional_uis.append(self.additional_ui)
Пример #40
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'repository-add'     : self.row_add,
            'repository-update'  : self.row_update,
            'repository-delete'  : self.row_delete,
            'repository-rebuild' : self.object_build,
            }

        ListView.__init__(
            self, _('Repositories'), pdata, dbstate, uistate,
            RepositoryModel, signal_map,
            RepoBookmarks, nav_group,
            multiple=True,
            filter_class=RepoSidebarFilter)

        self.additional_uis.append(self.additional_ui)
Пример #41
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'citation-add'     : self.row_add,
            'citation-update'  : self.row_update,
            'citation-delete'  : self.row_delete,
            'citation-rebuild' : self.object_build,
            }

        ListView.__init__(
            self, _('Citation View'), pdata, dbstate, uistate,
            CitationListModel, signal_map,
            CitationBookmarks, nav_group,
            multiple=True,
            filter_class=CitationSidebarFilter)

        self.additional_uis.append(self.additional_ui)
Пример #42
0
    def define_actions(self):
        """Add the Forward action group to handle the Forward button."""

        ListView.define_actions(self)

        self._add_action('FilterEdit', None, _('Family Filter Editor'),
                        callback=self.filter_editor,)

        self.all_action = Gtk.ActionGroup(name=self.title + "/FamilyAll")
        self.all_action.add_actions([
                ('MakeFatherActive', None, _("Make Father Active Person"),
                 None, None, self._make_father_active),
                ('MakeMotherActive', None, _("Make Mother Active Person"),
                 None, None, self._make_mother_active),
                ('QuickReport', None, _("Quick View"), None, None, None),
                ])
        self._add_action_group(self.all_action)
Пример #43
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'source-add'     : self.row_add,
            'source-update'  : self.row_update,
            'source-delete'  : self.row_delete,
            'source-rebuild' : self.object_build,
            }

        ListView.__init__(
            self, _('Sources'), pdata, dbstate, uistate,
            SourceModel, signal_map,
            SourceBookmarks, nav_group,
            multiple=True,
            filter_class=SourceSidebarFilter)

        self.additional_uis.append(self.additional_ui)
Пример #44
0
    def define_actions(self):
        """
        This defines the possible actions for the citation views.
        Possible actions are:
        add_source: Add a new source (this is also available from the
                      source view)
        add:        Add a new citation and a new source (this can also be done
                      by source view add a source, then citation view add a new
                      citation to an existing source)
        share:      Add a new citation to an existing source (when a source is
                      selected)
        edit:       Edit a source or a citation.
        merge:      Merge the selected sources or citations.
        remove:     Delete the selected sources or citations.


        """
        ListView.define_actions(self)

        self._add_action('Add source', 'gramps-source', _("Add source..."),
                         accel=None,
                         tip=self.ADD_SOURCE_MSG,
                         callback=self.add_source)
        self._add_action('Add citation', 'gramps-citation',
                         _("Add citation..."),
                         accel=None,
                         tip=self.ADD_CITATION_MSG,
                         callback=self.share)

        self.all_action = Gtk.ActionGroup(name=self.title + "/CitationAll")
        self.edit_action = Gtk.ActionGroup(name=self.title + "/CitationEdit")

        self._add_action('FilterEdit', None, _('Citation Filter Editor'),
                         callback=self.filter_editor,)
        self._add_action('QuickReport', None, _("Quick View"), None, None, None)

        self._add_action_group(self.edit_action)
        self._add_action_group(self.all_action)

        self.all_action.add_actions([
                ('OpenAllNodes', None, _("Expand all Nodes"), None, None,
                 self.open_all_nodes),
                ('CloseAllNodes', None, _("Collapse all Nodes"), None, None,
                 self.close_all_nodes),
                ])
Пример #45
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'media-add'     : self.row_add,
            'media-update'  : self.row_update,
            'media-delete'  : self.row_delete,
            'media-rebuild' : self.object_build,
            }

        ListView.__init__(
            self, _('Media'), pdata, dbstate, uistate,
            MediaModel,
            signal_map,
            MediaBookmarks, nav_group,
            filter_class=MediaSidebarFilter,
            multiple=True)

        self.additional_uis.append(self.additional_ui)
        self.uistate = uistate
Пример #46
0
    def define_actions(self):
        """
        Defines the UIManager actions specific to Media View. We need to make
        sure that the common List View actions are defined as well, so we
        call the parent function.
        """
        ListView.define_actions(self)

        self._add_action('FilterEdit', None, _('Media Filter Editor'),
                         callback=self.filter_editor)
        self._add_action('OpenMedia', 'gramps-viewmedia', _('View'),
                         tip=_("View in the default viewer"),
                         callback=self.view_media)
        self._add_action('OpenContainingFolder', None,
                         _('Open Containing _Folder'),
                         tip=_("Open the folder containing the media file"),
                         callback=self.open_containing_folder)

        self._add_action('QuickReport', None, _("Quick View"), None, None, None)
Пример #47
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'media-add'     : self.row_add,
            'media-update'  : self.row_update,
            'media-delete'  : self.row_delete,
            'media-rebuild' : self.object_build,
            }

        ListView.__init__(
            self, _('Media'), pdata, dbstate, uistate,
            MediaModel,
            signal_map,
            MediaBookmarks, nav_group,
            filter_class=MediaSidebarFilter,
            multiple=True)

        self.additional_uis.append(self.additional_ui)
        self.uistate = uistate
Пример #48
0
    def define_actions(self):
        """
        Required define_actions function for PageView. Builds the action
        group information required. We extend beyond the normal here,
        since we want to have more than one action group for the PersonView.
        Most PageViews really won't care about this.

        Special action groups for Forward and Back are created to allow the
        handling of navigation buttons. Forward and Back allow the user to
        advance or retreat throughout the history, and we want to have these
        be able to toggle these when you are at the end of the history or
        at the beginning of the history.
        """

        ListView.define_actions(self)

        self.all_action = ActionGroup(name=self.title + "/PersonAll")
        self.edit_action = ActionGroup(name=self.title + "/PersonEdit")

        self.all_action.add_actions([
                ('FilterEdit', None, _('Person Filter Editor'), None, None,
                self.filter_editor),
                ('Edit', 'gtk-edit', _("action|_Edit..."),
                "<PRIMARY>Return", self.EDIT_MSG, self.edit),
                ('QuickReport', None, _("Quick View"), None, None, None),
                ('WebConnect', None, _("Web Connection"), None, None, None),
                ])


        self.edit_action.add_actions(
            [
                ('Add', 'list-add', _("_Add..."), "<PRIMARY>Insert",
                 self.ADD_MSG, self.add),
                ('Remove', 'list-remove', _("_Delete"), "<PRIMARY>Delete",
                 self.DEL_MSG, self.remove),
                ('Merge', 'gramps-merge', _('_Merge...'), None,
                 self.MERGE_MSG, self.merge),
                ('ExportTab', None, _('Export View...'), None, None,
                 self.export),
                ])

        self._add_action_group(self.edit_action)
        self._add_action_group(self.all_action)
Пример #49
0
    def __init__(self, pdata, dbstate, uistate, nav_group=0):

        signal_map = {
            'note-add'     : self.row_add,
            'note-update'  : self.row_update,
            'note-delete'  : self.row_delete,
            'note-rebuild' : self.object_build,
        }

        ListView.__init__(
            self, _('Notes'), pdata, dbstate, uistate,
            NoteModel, signal_map,
            NoteBookmarks, nav_group,
            filter_class=NoteSidebarFilter,
            multiple=True)

        self.func_list.update({
            '<PRIMARY>J' : self.jump,
            '<PRIMARY>BackSpace' : self.key_delete,
        })

        self.additional_uis.append(self.additional_ui())
Пример #50
0
    def __init__(self, pdata, dbstate, uistate, title, model, nav_group):

        signal_map = {
            'place-add'     : self.row_add,
            'place-update'  : self.row_update,
            'place-delete'  : self.row_delete,
            'place-rebuild' : self.object_build,
            }

        self.mapservice = config.get('interface.mapservice')
        self.mapservicedata = {}
        self.map_action_group = None

        ListView.__init__(
            self, title, pdata, dbstate, uistate,
            model, signal_map,
            PlaceBookmarks, nav_group,
            multiple=True,
            filter_class=PlaceSidebarFilter)

        uistate.connect('placeformat-changed', self.build_tree)

        _ui = self.__create_maps_menu_actions()
        self.additional_uis.append(_ui)
Пример #51
0
    def define_actions(self):
        """
        This defines the possible actions for the citation views.
        Possible actions are:
        add_source: Add a new source (this is also available from the
                      source view)
        add:        Add a new citation and a new source (this can also be done
                      by source view add a source, then citation view add a new
                      citation to an existing source)
        share:      Add a new citation to an existing source (when a source is
                      selected)
        edit:       Edit a source or a citation.
        merge:      Merge the selected sources or citations.
        remove:     Delete the selected sources or citations.


        """
        ListView.define_actions(self)

        self.action_list.extend([
            ('AddSource', self.add_source),
            ('AddCitation', self.share),
            ('OpenAllNodes', self.open_all_nodes),
            ('CloseAllNodes', self.close_all_nodes), ])
Пример #52
0
    def define_actions(self):
        """
        This defines the possible actions for the citation views.
        Possible actions are:
        add:        Add a new citation and a new source (this can also be done
                      by source view add a source, then citation view add a new
                      citation to an existing source)
        edit:       Edit a citation.
        merge:      Merge the selected citations.
        remove:     Delete the selected citations.


        """
        ListView.define_actions(self)

        self.all_action = Gtk.ActionGroup(name=self.title + "/CitationAll")
        self.edit_action = Gtk.ActionGroup(name=self.title + "/CitationEdit")

        self._add_action('FilterEdit', None, _('Citation Filter Editor'),
                         callback=self.filter_editor,)
        self._add_action('QuickReport', None, _("Quick View"), None, None, None)

        self._add_action_group(self.edit_action)
        self._add_action_group(self.all_action)
Пример #53
0
 def define_actions(self):
     ListView.define_actions(self)
     self._add_action('GotoMap', self.gotomap)
Пример #54
0
 def define_actions(self):
     ListView.define_actions(self)
     self._add_action('FilterEdit', None, _('Source Filter Editor'),
                      callback=self.filter_editor,)
     self._add_action('QuickReport', None, _("Quick View"), None, None, None)