本文整理汇总了Python中gramps.gen.lib.Citation.get_media_list方法的典型用法代码示例。如果您正苦于以下问题:Python Citation.get_media_list方法的具体用法?Python Citation.get_media_list怎么用?Python Citation.get_media_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gramps.gen.lib.Citation
的用法示例。
在下文中一共展示了Citation.get_media_list方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CensusEditor
# 需要导入模块: from gramps.gen.lib import Citation [as 别名]
# 或者: from gramps.gen.lib.Citation import get_media_list [as 别名]
#.........这里部分代码省略.........
help_btn = Gtk.Button(stock=Gtk.STOCK_HELP)
help_btn.connect('clicked', self.help_clicked)
button_box.add(help_btn)
button_box.set_child_secondary(help_btn, True)
cancel_btn = Gtk.Button(stock=Gtk.STOCK_CANCEL)
cancel_btn.connect('clicked', self.close)
button_box.add(cancel_btn)
ok_btn = Gtk.Button(stock=Gtk.STOCK_OK)
ok_btn.connect('clicked', self.save)
button_box.add(ok_btn)
notebook = Gtk.Notebook()
self.details = DetailsTab(self.dbstate,
self.uistate,
self.track,
self.event,
census_combo)
self._add_tab(notebook, self.details)
self.headings = HeadingsTab(self.dbstate,
self.uistate,
self.track,
self.event,
census_combo)
self._add_tab(notebook, self.headings)
self.gallery_list = GalleryTab(self.dbstate,
self.uistate,
self.track,
self.citation.get_media_list())
self._add_tab(notebook, self.gallery_list)
vbox.pack_start(tab, expand=False, fill=True, padding=10)
vbox.pack_start(notebook, expand=True, fill=True, padding=0)
vbox.pack_end(button_box, expand=False, fill=True, padding=10)
root.add(vbox)
root.show_all()
notebook.set_current_page(0)
return root
def __populate_gui(self, event):
"""
Populate the GUI for a given census event.
"""
census_combo = self.widgets['census_combo']
for pos, row in enumerate(census_combo.get_model()):
if row[0] == self.citation.get_reference_handle():
census_combo.set_active(pos)
date_text = self.widgets['date_text']
date_text.set_text(get_date(event))
def __census_changed(self, combo):
"""
Called when the user selects a new census from the combo box.
"""
model = combo.get_model()
index = combo.get_active()
census_id = model[index][2]