本文整理汇总了Python中gramps.gui.views.listview.ListView类的典型用法代码示例。如果您正苦于以下问题:Python ListView类的具体用法?Python ListView怎么用?Python ListView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ListView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
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: __init__
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())
示例3: __init__
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())
示例4: __init__
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())
示例5: __init__
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)
示例6: set_inactive
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)
示例7: __init__
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())
示例8: enable_action_group
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)
示例9: disable_action_group
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)
示例10: define_actions
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)
示例11: change_page
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)
示例12: row_update
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
示例13: change_page
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)
示例14: define_actions
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)
示例15: define_actions
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)