Beispiel #1
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)
        self._add_action('Dummy', None, '  ', None, None, self.dummy_report)
Beispiel #2
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,
            'tag-update': self.tag_updated
        }

        ListView.__init__(self,
                          _('Media'),
                          pdata,
                          dbstate,
                          uistate,
                          MediaView.COLUMN_NAMES,
                          len(MediaView.COLUMN_NAMES),
                          MediaModel,
                          signal_map,
                          dbstate.db.get_media_bookmarks(),
                          Bookmarks.MediaBookmarks,
                          nav_group,
                          filter_class=MediaSidebarFilter,
                          multiple=True)

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

        self.additional_uis.append(self.additional_ui())
Beispiel #3
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,
            'tag-update'     : self.tag_updated
            }

        ListView.__init__(
            self, _('Families'), pdata, dbstate, uistate,
            FamilyView.COLUMN_NAMES, len(FamilyView.COLUMN_NAMES), 
            FamilyModel,
            signal_map, dbstate.db.get_family_bookmarks(),
            Bookmarks.FamilyBookmarks, nav_group,
            multiple=True,
            filter_class=FamilySidebarFilter,
            markup=FamilyView.MARKUP_COLS)

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

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

        self.additional_uis.append(self.additional_ui())
Beispiel #4
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,
                          RepositoryView.COLUMN_NAMES,
                          len(RepositoryView.COLUMN_NAMES),
                          RepositoryModel,
                          signal_map,
                          dbstate.db.get_repo_bookmarks(),
                          Bookmarks.RepoBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=RepoSidebarFilter)

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

        self.additional_uis.append(self.additional_ui())
    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,
            'tag-update' : self.tag_updated
            }
 
        ListView.__init__(
            self, title, pdata, dbstate, uistate,
            BasePersonView.COLUMN_NAMES, len(BasePersonView.COLUMN_NAMES), 
            model, signal_map, dbstate.db.get_bookmarks(),
            Bookmarks.PersonBookmarks, nav_group,
            multiple=True,
            filter_class=PersonSidebarFilter,
            markup=BasePersonView.MARKUP_COLS)
            
        self.func_list.update({
            '<CONTROL>J' : self.jump,
            '<CONTROL>BackSpace' : self.key_delete,
            })

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

        self.additional_uis.append(self.additional_ui())
Beispiel #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,
        }

        ListView.__init__(self,
                          _('Events'),
                          pdata,
                          dbstate,
                          uistate,
                          EventView.COLUMN_NAMES,
                          len(EventView.COLUMN_NAMES),
                          EventModel,
                          signal_map,
                          dbstate.db.get_event_bookmarks(),
                          Bookmarks.EventBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=EventSidebarFilter,
                          markup=EventView.MARKUP_COLS)

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

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

        self.additional_uis.append(self.additional_ui())
Beispiel #7
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,
                          SourceView.COLUMN_NAMES,
                          len(SourceView.COLUMN_NAMES),
                          SourceModel,
                          signal_map,
                          dbstate.db.get_source_bookmarks(),
                          Bookmarks.SourceBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=SourceSidebarFilter)

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

        self.additional_uis.append(self.additional_ui())
Beispiel #8
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(self.title + "/CitationAll")
        self.edit_action = gtk.ActionGroup(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('Dummy', None, '  ', None, None, self.dummy_report)

        self._add_action_group(self.edit_action)
        self._add_action_group(self.all_action)
Beispiel #9
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, 
            self.COLUMN_NAMES, len(self.COLUMN_NAMES), 
            CitationTreeModel, signal_map,
            dbstate.db.get_citation_bookmarks(),
            Bookmarks.CitationBookmarks, nav_group,
            multiple=True,
            filter_class=SourceSidebarFilter,
            markup = CitationTreeView.MARKUP_COLS)

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

        self.additional_uis.append(self.additional_ui())
Beispiel #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,
            'tag-update': self.tag_updated
        }

        ListView.__init__(self,
                          _('Notes'),
                          pdata,
                          dbstate,
                          uistate,
                          NoteView.COLUMN_NAMES,
                          len(NoteView.COLUMN_NAMES),
                          NoteModel,
                          signal_map,
                          dbstate.db.get_note_bookmarks(),
                          Bookmarks.NoteBookmarks,
                          nav_group,
                          filter_class=NoteSidebarFilter,
                          multiple=True)

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

        self.additional_uis.append(self.additional_ui())
    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)
 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)
Beispiel #13
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)
     self._add_action('Dummy', None, '  ', None, None, self.dummy_report)
Beispiel #14
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(self.title + "/CitationAll")
        self.edit_action = gtk.ActionGroup(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('Dummy', None, '  ', None, None, self.dummy_report)

        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), 
                ])
Beispiel #15
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(self.title + "/FamilyAll")
        self.all_action.add_actions([
                ('MakeFatherActive', gtk.STOCK_APPLY, _("Make Father Active Person"), 
                 None, None, self._make_father_active),
                ('MakeMotherActive', gtk.STOCK_APPLY, _("Make Mother Active Person"), 
                 None, None, self._make_mother_active),
                ('QuickReport', None, _("Quick View"), None, None, None),
                ('Dummy', None, '  ', None, None, self.dummy_report),
                ])
        self._add_action_group(self.all_action)
    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 = gtk.ActionGroup(self.title + "/PersonAll")
        self.edit_action = gtk.ActionGroup(self.title + "/PersonEdit")

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


        self.edit_action.add_actions(
            [
                ('Add', gtk.STOCK_ADD, _("_Add..."), "<control>Insert", 
                 self.ADD_MSG, self.add), 
                ('Remove', gtk.STOCK_REMOVE, _("_Remove"), "<control>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)
Beispiel #17
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',
                      gtk.STOCK_JUMP_TO,
                      _('_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)
     self._add_action('Dummy', None, '  ', None, None, self.dummy_report)
Beispiel #18
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 actions are stored in PageView class,
        # obtain the widgets where we need to add to menu
        actionservices = self.action_toolmenu['MapsList']
        widgets = actionservices.get_proxies()
        mmenu = self.__create_maps_menu_actions()

        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(self.mapservicedata.keys()[0])

        #store all gtk labels to be able to update label on selection change
        for widget in widgets:
            if isinstance(widget, gtk.MenuToolButton):
                widget.set_menu(mmenu)
                if gtk.pygtk_version >= (2, 12, 0):
                    widget.set_arrow_tooltip_text(actionservices.arrowtooltip)
                lbl = gtk.Label(self.mapservice_label())
                lbl.show()
                self.mapslistlabel.append(lbl)
                widget.set_label_widget(self.mapslistlabel[-1])
                widget.set_stock_id(gtk.STOCK_JUMP_TO)
        if self.drag_info():
            self.list.enable_model_drag_source(gtk.gdk.BUTTON1_MASK,
                                               [('text/plain', 0, 0),
                                                self.drag_info().target()],
                                               gtk.gdk.ACTION_COPY)
Beispiel #19
0
    def __init__(self,
                 pdata,
                 dbstate,
                 uistate,
                 title,
                 model,
                 nav_group,
                 markup=None):

        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,
                          self.COLUMN_NAMES,
                          14,
                          model,
                          signal_map,
                          dbstate.db.get_place_bookmarks(),
                          Bookmarks.PlaceBookmarks,
                          nav_group,
                          multiple=True,
                          filter_class=PlaceSidebarFilter,
                          markup=markup)

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

        self.additional_uis.append(self.additional_ui())
 def set_inactive(self):
     """
     Called when the page is no longer displayed.
     """
     ListView.set_inactive(self)
     self.uistate.viewmanager.tags.tag_disable()
 def set_active(self):
     """
     Called when the page is displayed.
     """
     ListView.set_active(self)
     self.uistate.viewmanager.tags.tag_enable()