* src/DataViews/_MediaView.py: cleanup and documentation
* src/DataViews/_RepositoryView.py: cleanup and documentation * src/DataViews/_SourceView.py: cleanup and documentation * src/DataViews/_EventView.py: cleanup and documentation * src/DataViews/_FamilyList.py: cleanup and documentation * src/DataViews/_PedigreeView.py: cleanup and documentation * src/DataViews/_PlaceView.py: cleanup and documentation * src/DataViews/_NoteView.py: cleanup and documentation * src/DataViews/_PersonView.py: cleanup and documentation * src/DataViews/_MapView.py: cleanup and documentation * src/DataViews/_RelationView.py: cleanup and documentation * src/PageView.py: cleanup and documentation 2007-09-12 Don Allingham <don@gramps-project.org> svn: r8969
This commit is contained in:
@@ -167,7 +167,7 @@ class EventView(PageView.ListView):
|
||||
|
||||
def define_actions(self):
|
||||
PageView.ListView.define_actions(self)
|
||||
self.add_action('FilterEdit', None, _('Event Filter Editor'),
|
||||
self._add_action('FilterEdit', None, _('Event Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
|
||||
def get_handle_from_gramps_id(self, gid):
|
||||
@@ -177,7 +177,7 @@ class EventView(PageView.ListView):
|
||||
else:
|
||||
return None
|
||||
|
||||
def column_editor(self, obj):
|
||||
def _column_editor(self, obj):
|
||||
"""
|
||||
returns a tuple indicating the column order
|
||||
"""
|
||||
|
||||
@@ -96,7 +96,7 @@ class FamilyListView(PageView.ListView):
|
||||
def column_order(self):
|
||||
return self.dbstate.db.get_family_list_column_order()
|
||||
|
||||
def column_editor(self, obj):
|
||||
def _column_editor(self, obj):
|
||||
import ColumnOrder
|
||||
|
||||
ColumnOrder.ColumnOrder(
|
||||
@@ -161,10 +161,10 @@ class FamilyListView(PageView.ListView):
|
||||
"""
|
||||
|
||||
PageView.ListView.define_actions(self)
|
||||
self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self.column_editor)
|
||||
self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self._column_editor)
|
||||
|
||||
self.add_action('FilterEdit', None, _('Family Filter Editor'),
|
||||
self._add_action('FilterEdit', None, _('Family Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
|
||||
self.all_action = gtk.ActionGroup(self.title + "/FamilyAll")
|
||||
@@ -172,7 +172,7 @@ class FamilyListView(PageView.ListView):
|
||||
('QuickReport', None, _("Quick Report"), None, None, None),
|
||||
('Dummy', None, ' ', None, None, self.dummy_report),
|
||||
])
|
||||
self.add_action_group(self.all_action)
|
||||
self._add_action_group(self.all_action)
|
||||
|
||||
def get_bookmarks(self):
|
||||
return self.dbstate.db.get_family_bookmarks()
|
||||
|
||||
+12
-12
@@ -627,18 +627,18 @@ class MapView(PageView.PageView):
|
||||
return PageView.NAVIGATION_NONE
|
||||
|
||||
def define_actions(self):
|
||||
self.add_action('ZoomIn',gtk.STOCK_ZOOM_IN,
|
||||
_("Zoom _In"),tip=_("Zoom in by a factor of 2"),
|
||||
callback=self.zoom_in_cb)
|
||||
self.add_action('ZoomOut',gtk.STOCK_ZOOM_OUT,
|
||||
_("Zoom _Out"),tip=_("Zoom out by a factor of 2"),
|
||||
callback=self.zoom_out_cb)
|
||||
self.add_action('ZoomNormal',gtk.STOCK_ZOOM_100,
|
||||
_("_Normal Size"), tip=_("Return to normal size"),
|
||||
callback=self.zoom_100_cb)
|
||||
self.add_action('ZoomFit',gtk.STOCK_ZOOM_FIT,
|
||||
_("Best _Fit"),
|
||||
tip=_("Produce the best fit of the map in the window"),
|
||||
self._add_action('ZoomIn',gtk.STOCK_ZOOM_IN,
|
||||
_("Zoom _In"),tip=_("Zoom in by a factor of 2"),
|
||||
callback=self.zoom_in_cb)
|
||||
self._add_action('ZoomOut',gtk.STOCK_ZOOM_OUT,
|
||||
_("Zoom _Out"),tip=_("Zoom out by a factor of 2"),
|
||||
callback=self.zoom_out_cb)
|
||||
self._add_action('ZoomNormal',gtk.STOCK_ZOOM_100,
|
||||
_("_Normal Size"), tip=_("Return to normal size"),
|
||||
callback=self.zoom_100_cb)
|
||||
self._add_action('ZoomFit',gtk.STOCK_ZOOM_FIT,
|
||||
_("Best _Fit"),
|
||||
tip=_("Produce the best fit of the map in the window"),
|
||||
callback=self.zoom_fit_cb)
|
||||
|
||||
def get_stock(self):
|
||||
|
||||
@@ -211,13 +211,13 @@ class MediaView(PageView.ListView):
|
||||
"""
|
||||
PageView.ListView.define_actions(self)
|
||||
|
||||
self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self.column_editor)
|
||||
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('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self._column_editor)
|
||||
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)
|
||||
|
||||
def view_media(self, obj):
|
||||
"""
|
||||
@@ -237,7 +237,7 @@ class MediaView(PageView.ListView):
|
||||
_("GRAMPS cannot find an application that can view "
|
||||
"a file type of %s.") % mime_type)
|
||||
|
||||
def column_editor(self, obj):
|
||||
def _column_editor(self, obj):
|
||||
"""
|
||||
Start the column editor dialog
|
||||
"""
|
||||
|
||||
@@ -164,10 +164,10 @@ class NoteView(PageView.ListView):
|
||||
|
||||
def define_actions(self):
|
||||
PageView.ListView.define_actions(self)
|
||||
self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self.column_editor)
|
||||
self.add_action('FilterEdit', None, _('Note Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self._column_editor)
|
||||
self._add_action('FilterEdit', None, _('Note Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
|
||||
def get_handle_from_gramps_id(self, gid):
|
||||
obj = self.dbstate.db.get_note_from_gramps_id(gid)
|
||||
@@ -176,7 +176,7 @@ class NoteView(PageView.ListView):
|
||||
else:
|
||||
return None
|
||||
|
||||
def column_editor(self, obj):
|
||||
def _column_editor(self, obj):
|
||||
"""
|
||||
returns a tuple indicating the column order
|
||||
"""
|
||||
|
||||
@@ -593,7 +593,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
"""
|
||||
|
||||
PageView.PersonNavView.define_actions(self)
|
||||
# self.add_action('HomePerson',gtk.STOCK_HOME,_("_Home"),
|
||||
# self._add_action('HomePerson',gtk.STOCK_HOME,_("_Home"),
|
||||
# tip=_("Go to the default person"), callback=self.home)
|
||||
|
||||
def build_tree(self):
|
||||
|
||||
@@ -163,7 +163,7 @@ class PersonView(PageView.PersonNavView):
|
||||
('Remove', gtk.STOCK_REMOVE, _("_Remove"), "<control>Delete",
|
||||
_("Remove the selected person"), self.remove),
|
||||
('ColumnEdit', gtk.STOCK_PROPERTIES, _('_Column Editor'), None,
|
||||
None, self.column_editor),
|
||||
None, self._column_editor),
|
||||
('CmpMerge', None, _('_Compare and merge'), None, None,
|
||||
self.cmp_merge),
|
||||
('FastMerge', None, _('_Fast merge'), None, None,
|
||||
@@ -171,8 +171,8 @@ class PersonView(PageView.PersonNavView):
|
||||
('ExportTab', None, _('Export view'), None, None, self.export),
|
||||
])
|
||||
|
||||
self.add_action_group(self.edit_action)
|
||||
self.add_action_group(self.all_action)
|
||||
self._add_action_group(self.edit_action)
|
||||
self._add_action_group(self.all_action)
|
||||
|
||||
def enable_action_group(self, obj):
|
||||
PageView.PersonNavView.enable_action_group(self, obj)
|
||||
@@ -234,7 +234,7 @@ class PersonView(PageView.PersonNavView):
|
||||
"A second person can be selected by holding down the "
|
||||
"control key while clicking on the desired person."))
|
||||
|
||||
def column_editor(self, obj):
|
||||
def _column_editor(self, obj):
|
||||
import ColumnOrder
|
||||
|
||||
ColumnOrder.ColumnOrder(
|
||||
@@ -282,7 +282,7 @@ class PersonView(PageView.PersonNavView):
|
||||
self.tree.set_rules_hint(True)
|
||||
self.tree.set_headers_visible(True)
|
||||
self.tree.set_fixed_height_mode(True)
|
||||
self.tree.connect('key-press-event', self.key_press)
|
||||
self.tree.connect('key-press-event', self._key_press)
|
||||
self.tree.connect('start-interactive-search',self.open_all_nodes)
|
||||
|
||||
scrollwindow = gtk.ScrolledWindow()
|
||||
@@ -302,7 +302,7 @@ class PersonView(PageView.PersonNavView):
|
||||
|
||||
self.setup_filter()
|
||||
self.build_columns()
|
||||
self.tree.connect('button-press-event', self.button_press)
|
||||
self.tree.connect('button-press-event', self._button_press)
|
||||
self.tree.connect('drag_data_get', self.drag_data_get)
|
||||
self.tree.connect('drag_begin', self.drag_begin)
|
||||
|
||||
@@ -819,7 +819,7 @@ class PersonView(PageView.PersonNavView):
|
||||
elif row == 0 and self.model.on_get_iter(path):
|
||||
self.selection.select_path(path)
|
||||
|
||||
def button_press(self, obj, event):
|
||||
def _button_press(self, obj, event):
|
||||
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
||||
handle = self.first_selected()
|
||||
person = self.dbstate.db.get_person_from_handle(handle)
|
||||
@@ -860,7 +860,7 @@ class PersonView(PageView.PersonNavView):
|
||||
return True
|
||||
return False
|
||||
|
||||
def key_press(self,obj,event):
|
||||
def _key_press(self,obj,event):
|
||||
if not event.state or event.state in (gtk.gdk.MOD2_MASK,):
|
||||
if event.keyval in (gtk.keysyms.Return, gtk.keysyms.KP_Enter):
|
||||
if self.dbstate.active:
|
||||
|
||||
+10
-10
@@ -114,15 +114,15 @@ class PlaceView(PageView.ListView):
|
||||
|
||||
def define_actions(self):
|
||||
PageView.ListView.define_actions(self)
|
||||
self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self.column_editor)
|
||||
self.add_action('FastMerge', None, _('_Merge'),
|
||||
callback=self.fast_merge)
|
||||
self.add_action('GoogleMaps', gtk.STOCK_JUMP_TO, _('_Google Maps'),
|
||||
callback=self.google,
|
||||
tip=_("Attempt to map location on Google Maps"))
|
||||
self.add_action('FilterEdit', None, _('Place Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self._column_editor)
|
||||
self._add_action('FastMerge', None, _('_Merge'),
|
||||
callback=self.fast_merge)
|
||||
self._add_action('GoogleMaps', gtk.STOCK_JUMP_TO, _('_Google Maps'),
|
||||
callback=self.google,
|
||||
tip=_("Attempt to map location on Google Maps"))
|
||||
self._add_action('FilterEdit', None, _('Place Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
|
||||
def drag_info(self):
|
||||
return DdTargets.PLACE_LINK
|
||||
@@ -151,7 +151,7 @@ class PlaceView(PageView.ListView):
|
||||
path = "http://maps.google.com/maps?q=%s" % '+'.join(descr.split())
|
||||
GrampsDisplay.url(path)
|
||||
|
||||
def column_editor(self, obj):
|
||||
def _column_editor(self, obj):
|
||||
import ColumnOrder
|
||||
|
||||
ColumnOrder.ColumnOrder(
|
||||
|
||||
@@ -328,15 +328,15 @@ class RelationshipView(PageView.PersonNavView):
|
||||
_("Adds an existing set of parents"), self.select_parents),
|
||||
])
|
||||
|
||||
self.add_action_group(self.order_action)
|
||||
self.add_action_group(self.family_action)
|
||||
self._add_action_group(self.order_action)
|
||||
self._add_action_group(self.family_action)
|
||||
|
||||
self.add_toggle_action('Details', None, _('Show details'),
|
||||
None, None, self.details_toggle,
|
||||
self.show_details)
|
||||
self.add_toggle_action('Siblings', None, _('Show siblings'),
|
||||
None, None, self.siblings_toggle,
|
||||
self.show_siblings)
|
||||
self._add_toggle_action('Details', None, _('Show details'),
|
||||
None, None, self.details_toggle,
|
||||
self.show_details)
|
||||
self._add_toggle_action('Siblings', None, _('Show siblings'),
|
||||
None, None, self.siblings_toggle,
|
||||
self.show_siblings)
|
||||
|
||||
self.order_action.set_sensitive(self.reorder_sensitive)
|
||||
self.family_action.set_sensitive(False)
|
||||
@@ -801,8 +801,8 @@ class RelationshipView(PageView.PersonNavView):
|
||||
initial_name = False
|
||||
if handle:
|
||||
name = self.get_name(handle, True)
|
||||
link_label = GrampsWidgets.LinkLabel(name,
|
||||
self.button_press, handle)
|
||||
link_label = GrampsWidgets.LinkLabel(
|
||||
name, self._button_press, handle)
|
||||
if self.use_shade:
|
||||
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||
if Config.get(Config.RELEDITBTN):
|
||||
@@ -841,8 +841,8 @@ class RelationshipView(PageView.PersonNavView):
|
||||
|
||||
if handle:
|
||||
name = self.get_name(handle, True)
|
||||
link_label = GrampsWidgets.LinkLabel(name,
|
||||
self.button_press, handle)
|
||||
link_label = GrampsWidgets.LinkLabel(
|
||||
name, self._button_press, handle)
|
||||
if self.use_shade:
|
||||
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||
if Config.get(Config.RELEDITBTN):
|
||||
@@ -891,7 +891,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
else:
|
||||
format = 'underline="single"'
|
||||
link_label = GrampsWidgets.LinkLabel(self.get_name(handle, True),
|
||||
self.button_press, handle, format)
|
||||
self._button_press, handle, format)
|
||||
if self.use_shade:
|
||||
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||
link_label.set_padding(3, 0)
|
||||
@@ -974,7 +974,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
self.collapsed_items[person.handle] = [handle]
|
||||
self.redraw()
|
||||
|
||||
def button_press(self, obj, event, handle):
|
||||
def _button_press(self, obj, event, handle):
|
||||
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1:
|
||||
self.dbstate.change_active_handle(handle)
|
||||
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
||||
|
||||
@@ -117,12 +117,12 @@ class RepositoryView(PageView.ListView):
|
||||
|
||||
def define_actions(self):
|
||||
PageView.ListView.define_actions(self)
|
||||
self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self.column_editor)
|
||||
self.add_action('FilterEdit', None, _('Repository Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self._column_editor)
|
||||
self._add_action('FilterEdit', None, _('Repository Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
|
||||
def column_editor(self, obj):
|
||||
def _column_editor(self, obj):
|
||||
import ColumnOrder
|
||||
|
||||
ColumnOrder.ColumnOrder(
|
||||
|
||||
@@ -110,14 +110,14 @@ class SourceView(PageView.ListView):
|
||||
|
||||
def define_actions(self):
|
||||
PageView.ListView.define_actions(self)
|
||||
self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self.column_editor)
|
||||
self.add_action('FastMerge', None, _('_Merge'),
|
||||
callback=self.fast_merge)
|
||||
self.add_action('FilterEdit', None, _('Source Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
|
||||
_('_Column Editor'), callback=self._column_editor)
|
||||
self._add_action('FastMerge', None, _('_Merge'),
|
||||
callback=self.fast_merge)
|
||||
self._add_action('FilterEdit', None, _('Source Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
|
||||
def column_editor(self, obj):
|
||||
def _column_editor(self, obj):
|
||||
import ColumnOrder
|
||||
|
||||
ColumnOrder.ColumnOrder(
|
||||
|
||||
Reference in New Issue
Block a user