Merge branch 'master' into geps/gep-032-database-backend
This commit is contained in:
commit
00d958aaed
@ -40,6 +40,7 @@ from ._hasplace import HasPlace
|
|||||||
from ._hasdata import HasData
|
from ._hasdata import HasData
|
||||||
from ._hasnolatorlon import HasNoLatOrLon
|
from ._hasnolatorlon import HasNoLatOrLon
|
||||||
from ._inlatlonneighborhood import InLatLonNeighborhood
|
from ._inlatlonneighborhood import InLatLonNeighborhood
|
||||||
|
from ._isenclosedby import IsEnclosedBy
|
||||||
from ._matcheseventfilter import MatchesEventFilter
|
from ._matcheseventfilter import MatchesEventFilter
|
||||||
from ._matchessourceconfidence import MatchesSourceConfidence
|
from ._matchessourceconfidence import MatchesSourceConfidence
|
||||||
from ._changedsince import ChangedSince
|
from ._changedsince import ChangedSince
|
||||||
@ -66,5 +67,6 @@ editor_rule_list = [
|
|||||||
MatchesEventFilter,
|
MatchesEventFilter,
|
||||||
ChangedSince,
|
ChangedSince,
|
||||||
HasTag,
|
HasTag,
|
||||||
HasTitle
|
HasTitle,
|
||||||
|
IsEnclosedBy
|
||||||
]
|
]
|
||||||
|
59
gramps/gen/filters/rules/place/_isenclosedby.py
Normal file
59
gramps/gen/filters/rules/place/_isenclosedby.py
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
#
|
||||||
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
|
#
|
||||||
|
# Copyright (C) 2002-2006 Donald N. Allingham
|
||||||
|
# Copyright (C) 2015 Nick Hall
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
#
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Standard Python modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from ....const import GRAMPS_LOCALE as glocale
|
||||||
|
_ = glocale.translation.sgettext
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Gramps modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
from .. import Rule
|
||||||
|
from ....utils.location import located_in
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# IsEnclosedBy
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
class IsEnclosedBy(Rule):
|
||||||
|
"""
|
||||||
|
Rule that checks for a place enclosed by another place
|
||||||
|
"""
|
||||||
|
|
||||||
|
labels = [_('ID:')]
|
||||||
|
name = _('Places enclosed by another place')
|
||||||
|
description = _('Matches a place enclosed by a particular place')
|
||||||
|
category = _('General filters')
|
||||||
|
|
||||||
|
def prepare(self, db):
|
||||||
|
self.handle = db.get_place_from_gramps_id(self.list[0]).handle
|
||||||
|
|
||||||
|
def apply(self, db, place):
|
||||||
|
if located_in(db, place.handle, self.handle):
|
||||||
|
return True
|
||||||
|
return False
|
@ -823,7 +823,6 @@ class GrampsPreferences(ConfigureDialog):
|
|||||||
format_tree.append_column(example_column)
|
format_tree.append_column(example_column)
|
||||||
format_tree.get_selection().connect('changed',
|
format_tree.get_selection().connect('changed',
|
||||||
self.cb_format_tree_select)
|
self.cb_format_tree_select)
|
||||||
format_tree.set_rules_hint(True)
|
|
||||||
|
|
||||||
# ... and put it into a scrolled win
|
# ... and put it into a scrolled win
|
||||||
format_sw = Gtk.ScrolledWindow()
|
format_sw = Gtk.ScrolledWindow()
|
||||||
|
@ -158,7 +158,6 @@ class DbManager(CLIDbManager):
|
|||||||
self.data_to_delete = None
|
self.data_to_delete = None
|
||||||
|
|
||||||
self.selection = self.dblist.get_selection()
|
self.selection = self.dblist.get_selection()
|
||||||
self.dblist.set_rules_hint(True)
|
|
||||||
|
|
||||||
self.__connect_signals()
|
self.__connect_signals()
|
||||||
self.__build_interface()
|
self.__build_interface()
|
||||||
@ -317,9 +316,6 @@ class DbManager(CLIDbManager):
|
|||||||
column.set_sort_column_id(DSORT_COL)
|
column.set_sort_column_id(DSORT_COL)
|
||||||
self.dblist.append_column(column)
|
self.dblist.append_column(column)
|
||||||
|
|
||||||
# set the rules hit
|
|
||||||
self.dblist.set_rules_hint(True)
|
|
||||||
|
|
||||||
def __populate(self):
|
def __populate(self):
|
||||||
"""
|
"""
|
||||||
Builds the data and the display model.
|
Builds the data and the display model.
|
||||||
|
@ -404,7 +404,6 @@ class EmbeddedList(ButtonTab):
|
|||||||
|
|
||||||
self.tree = Gtk.TreeView()
|
self.tree = Gtk.TreeView()
|
||||||
self.tree.set_reorderable(True)
|
self.tree.set_reorderable(True)
|
||||||
self.tree.set_rules_hint(True)
|
|
||||||
self.tree.connect('button_press_event', self.double_click)
|
self.tree.connect('button_press_event', self.double_click)
|
||||||
self.tree.connect('key_press_event', self.key_pressed)
|
self.tree.connect('key_press_event', self.key_pressed)
|
||||||
self.track_ref_for_deletion("tree")
|
self.track_ref_for_deletion("tree")
|
||||||
|
@ -86,7 +86,6 @@
|
|||||||
<object class="GtkTreeView" id="plist">
|
<object class="GtkTreeView" id="plist">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="rules_hint">True</property>
|
|
||||||
<property name="fixed_height_mode">True</property>
|
<property name="fixed_height_mode">True</property>
|
||||||
<child internal-child="selection">
|
<child internal-child="selection">
|
||||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
||||||
|
@ -113,7 +113,6 @@ class ListModel(object):
|
|||||||
self.mylist.append(object)
|
self.mylist.append(object)
|
||||||
|
|
||||||
self.function = {}
|
self.function = {}
|
||||||
self.tree.set_rules_hint(True)
|
|
||||||
self.model = None
|
self.model = None
|
||||||
self.selection = None
|
self.selection = None
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
|
@ -116,7 +116,6 @@ class PluginStatus(ManagedWindow):
|
|||||||
GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING)
|
GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING)
|
||||||
self.selection_reg = self.list_reg.get_selection()
|
self.selection_reg = self.list_reg.get_selection()
|
||||||
self.list_reg.set_model(self.model_reg)
|
self.list_reg.set_model(self.model_reg)
|
||||||
self.list_reg.set_rules_hint(True)
|
|
||||||
self.list_reg.connect('button-press-event', self.button_press_reg)
|
self.list_reg.connect('button-press-event', self.button_press_reg)
|
||||||
col0_reg = Gtk.TreeViewColumn(_('Type'), Gtk.CellRendererText(), text=0)
|
col0_reg = Gtk.TreeViewColumn(_('Type'), Gtk.CellRendererText(), text=0)
|
||||||
col0_reg.set_sort_column_id(0)
|
col0_reg.set_sort_column_id(0)
|
||||||
@ -167,7 +166,6 @@ class PluginStatus(ManagedWindow):
|
|||||||
GObject.TYPE_STRING, GObject.TYPE_STRING)
|
GObject.TYPE_STRING, GObject.TYPE_STRING)
|
||||||
self.selection = self.list.get_selection()
|
self.selection = self.list.get_selection()
|
||||||
self.list.set_model(self.model)
|
self.list.set_model(self.model)
|
||||||
self.list.set_rules_hint(True)
|
|
||||||
self.list.connect('button-press-event', self.button_press)
|
self.list.connect('button-press-event', self.button_press)
|
||||||
self.list.connect('cursor-changed', self.cursor_changed)
|
self.list.connect('cursor-changed', self.cursor_changed)
|
||||||
col = Gtk.TreeViewColumn(_('Loaded'), Gtk.CellRendererText(),
|
col = Gtk.TreeViewColumn(_('Loaded'), Gtk.CellRendererText(),
|
||||||
@ -230,7 +228,6 @@ class PluginStatus(ManagedWindow):
|
|||||||
GObject.TYPE_STRING,
|
GObject.TYPE_STRING,
|
||||||
GObject.TYPE_STRING)
|
GObject.TYPE_STRING)
|
||||||
self.addon_list.set_model(self.addon_model)
|
self.addon_list.set_model(self.addon_model)
|
||||||
self.addon_list.set_rules_hint(True)
|
|
||||||
#self.addon_list.connect('button-press-event', self.button_press)
|
#self.addon_list.connect('button-press-event', self.button_press)
|
||||||
col = Gtk.TreeViewColumn(_('Addon Name'), Gtk.CellRendererText(),
|
col = Gtk.TreeViewColumn(_('Addon Name'), Gtk.CellRendererText(),
|
||||||
text=1)
|
text=1)
|
||||||
|
@ -92,7 +92,6 @@ class UndoHistory(ManagedWindow):
|
|||||||
|
|
||||||
self.renderer = Gtk.CellRendererText()
|
self.renderer = Gtk.CellRendererText()
|
||||||
self.tree.set_model(self.model)
|
self.tree.set_model(self.model)
|
||||||
self.tree.set_rules_hint(True)
|
|
||||||
#self.tree.append_column(
|
#self.tree.append_column(
|
||||||
#Gtk.TreeViewColumn(_('Original time'), self.renderer,
|
#Gtk.TreeViewColumn(_('Original time'), self.renderer,
|
||||||
#text=0, foreground=2, background=3))
|
#text=0, foreground=2, background=3))
|
||||||
|
@ -148,7 +148,6 @@ class ListView(NavigationView):
|
|||||||
filter_box = self.search_bar.build()
|
filter_box = self.search_bar.build()
|
||||||
|
|
||||||
self.list = Gtk.TreeView()
|
self.list = Gtk.TreeView()
|
||||||
self.list.set_rules_hint(True)
|
|
||||||
self.list.set_headers_visible(True)
|
self.list.set_headers_visible(True)
|
||||||
self.list.set_headers_clickable(True)
|
self.list.set_headers_clickable(True)
|
||||||
self.list.set_fixed_height_mode(True)
|
self.list.set_fixed_height_mode(True)
|
||||||
|
@ -105,7 +105,6 @@
|
|||||||
<object class="GtkTreeView" id="treeview">
|
<object class="GtkTreeView" id="treeview">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="rules_hint">True</property>
|
|
||||||
<child internal-child="selection">
|
<child internal-child="selection">
|
||||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
||||||
</child>
|
</child>
|
||||||
|
@ -307,7 +307,6 @@
|
|||||||
<object class="GtkTreeView" id="mlist">
|
<object class="GtkTreeView" id="mlist">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="rules_hint">True</property>
|
|
||||||
<child internal-child="selection">
|
<child internal-child="selection">
|
||||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
||||||
</child>
|
</child>
|
||||||
|
@ -75,7 +75,6 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="tooltip_text" translatable="yes">Select a person to determine the relationship</property>
|
<property name="tooltip_text" translatable="yes">Select a person to determine the relationship</property>
|
||||||
<property name="rules_hint">True</property>
|
|
||||||
<child internal-child="selection">
|
<child internal-child="selection">
|
||||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
||||||
</child>
|
</child>
|
||||||
|
@ -244,7 +244,6 @@
|
|||||||
<object class="GtkTreeView" id="warn_tree">
|
<object class="GtkTreeView" id="warn_tree">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="rules_hint">True</property>
|
|
||||||
<child internal-child="selection">
|
<child internal-child="selection">
|
||||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
||||||
</child>
|
</child>
|
||||||
|
@ -842,7 +842,6 @@
|
|||||||
<object class="GtkTreeView" id="warn_tree">
|
<object class="GtkTreeView" id="warn_tree">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="rules_hint">True</property>
|
|
||||||
<child internal-child="selection">
|
<child internal-child="selection">
|
||||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
||||||
</child>
|
</child>
|
||||||
|
Loading…
Reference in New Issue
Block a user