diff --git a/src/ManagedWindow.py b/src/ManagedWindow.py
index 7bb5e0dd9..daad24a4f 100644
--- a/src/ManagedWindow.py
+++ b/src/ManagedWindow.py
@@ -39,7 +39,6 @@ from cStringIO import StringIO
#
#-------------------------------------------------------------------------
import gtk
-from gtk import glade
#-------------------------------------------------------------------------
#
@@ -60,6 +59,22 @@ _win_top = ''
DISABLED = -1
+#-----------------------------------------------------------------------
+#
+# Helper function
+#
+#-----------------------------------------------------------------------
+
+def get_object(self,value):
+ if self.get_name() == value:
+ return self
+ elif hasattr(self,'get_children'):
+ for child in self.get_children():
+ object = get_object(child, value)
+ if object is not None:
+ return object
+ return None
+
class GrampsWindowManager:
"""
Manage hierarchy of open GRAMPS windows.
@@ -257,7 +272,8 @@ class GrampsWindowManager:
idval = self.generate_id(i)
data.write(''
% self.generate_id(i))
- action_data.append((idval, None, i.menu_label, None, None,
+ action_data.append((idval, None, i.menu_label,
+ None, None,
self.call_back_factory(i)))
if isinstance(mlist, (list, tuple)):
data.write('')
@@ -404,16 +420,26 @@ class ManagedWindow:
def build_window_key(self, obj):
return id(obj)
-
+
def define_glade(self, top_module, glade_file=None):
if glade_file is None:
glade_file = const.GLADE_FILE
- self._gladeobj = glade.XML(glade_file, top_module, "gramps")
+ builder = gtk.Builder()
+ builder.add_from_file(glade_file)
+ self._gladeobj = builder.get_object(top_module)
+ self._gladeobj.get_object = get_object
return self._gladeobj
def get_widget(self, name):
assert(self._gladeobj)
- return self._gladeobj.get_widget(name)
+ object = get_object(self._gladeobj,name)
+ if object is not None:
+ return object
+ raise ValueError, (
+ 'ManagedWindow.get_widget: "%s" widget not found in "%s"' %
+ (name, self._gladeobj.get_name())
+ )
+ return object
def connect_button(self, button_name, function):
assert(self._gladeobj)
diff --git a/src/glade/rule.glade b/src/glade/rule.glade
index bcc6faa1c..4646b9537 100644
--- a/src/glade/rule.glade
+++ b/src/glade/rule.glade
@@ -1,1263 +1,935 @@
-
-
-
-
-
-
- True
-
- GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_NONE
- False
- 500
- True
- False
- True
- False
- False
- GDK_WINDOW_TYPE_HINT_DIALOG
- GDK_GRAVITY_CENTER
- True
- False
- False
-
-
-
-
- True
- False
- 8
-
-
-
- True
- GTK_BUTTONBOX_END
-
-
-
- True
- True
- True
- gtk-cancel
- True
- GTK_RELIEF_NORMAL
- True
- 0
-
-
-
-
-
-
- True
- False
- True
- True
- gtk-ok
- True
- GTK_RELIEF_NORMAL
- True
- 0
-
-
-
-
-
-
- True
- True
- True
- gtk-help
- True
- GTK_RELIEF_NORMAL
- True
- -11
-
-
-
-
-
- 0
- False
- True
- GTK_PACK_END
-
-
-
-
-
- True
- False
- 0
-
-
-
- True
-
- False
- False
- GTK_JUSTIFY_CENTER
- False
- False
- 0.5
- 0.5
- 0
- 6
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
-
-
-
- 12
- True
- 8
- 4
- False
- 6
- 12
-
-
-
- True
- False
- 6
-
-
-
- True
- Add another rule to the filter
- True
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
-
- True
- gtk-add
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 0
- False
- False
-
-
-
-
-
- True
- False
- Edit the selected rule
- True
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
-
- True
- gtk-edit
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 0
- False
- False
-
-
-
-
-
- True
- False
- Delete the selected rule
- True
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
-
- True
- gtk-remove
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 0
- False
- False
-
-
-
-
-
-
-
-
- 3
- 4
- 4
- 5
- shrink
- fill
-
-
-
-
-
- True
- <b>Options</b>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- 4
- 5
- 6
- fill
-
-
-
-
-
-
- True
- <b>Rule list</b>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- 4
- 3
- 4
- fill
-
-
-
-
-
-
- True
- <b>Definition</b>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- 4
- 0
- 1
- fill
-
-
-
-
-
-
- True
- Co_mment:
- True
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- comment
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 1
- 2
- 2
- 3
- fill
-
-
-
-
-
-
- True
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
- GTK_SHADOW_IN
- GTK_CORNER_TOP_LEFT
-
-
-
- True
- True
- True
- False
- False
- True
- False
- False
- False
-
-
-
-
- 1
- 3
- 4
- 5
-
-
-
-
-
- True
- _Name:
- True
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- filter_name
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 1
- 2
- 1
- 2
- fill
-
-
-
-
-
-
- True
- True
- Return values that do no_t match the filter rules
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
-
-
- 1
- 4
- 7
- 8
- fill
-
-
-
-
-
-
- True
- All rules must apply
-At least one rule must apply
-Exactly one rule must apply
- False
- True
-
-
- 1
- 3
- 6
- 7
- fill
-
-
-
-
-
-
- True
- True
- True
- True
- 0
-
- True
- *
- False
-
-
-
- 2
- 3
- 1
- 2
- expand|shrink|fill
-
-
-
-
-
-
-
- 2
- 3
- 2
- 3
-
-
-
-
-
- 0
- True
- True
-
-
-
-
- 0
- True
- True
-
-
-
-
-
-
-
-
- GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_NONE
- False
- 400
- 350
- True
- False
- True
- False
- False
- GDK_WINDOW_TYPE_HINT_DIALOG
- GDK_GRAVITY_CENTER
- True
- False
- False
-
-
-
-
- True
- False
- 8
-
-
-
- True
- GTK_BUTTONBOX_END
-
-
-
- True
- True
- True
- gtk-close
- True
- GTK_RELIEF_NORMAL
- True
- -7
-
-
-
-
-
-
- True
- True
- True
- gtk-help
- True
- GTK_RELIEF_NORMAL
- True
- -11
-
-
-
-
-
- 0
- False
- True
- GTK_PACK_END
-
-
-
-
-
- True
- False
- 0
-
-
-
- True
-
- False
- False
- GTK_JUSTIFY_CENTER
- False
- False
- 0.5
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 5
- False
- False
-
-
-
-
-
- 6
- True
- False
- 6
-
-
-
- True
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
- GTK_SHADOW_IN
- GTK_CORNER_TOP_LEFT
-
-
-
- True
- True
- True
- False
- False
- True
- False
- False
- False
-
-
-
-
- 0
- True
- True
-
-
-
-
-
- True
- False
- 6
-
-
-
- True
- Add a new filter
- True
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
-
- True
- gtk-add
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 0
- False
- False
-
-
-
-
-
- True
- False
- Edit the selected filter
- True
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
-
- True
- gtk-edit
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 0
- False
- False
-
-
-
-
-
- True
- False
- Clone the selected filter
- True
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
-
- True
- gtk-copy
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 0
- False
- False
-
-
-
-
-
- True
- Test the selected filter
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
-
- True
- gtk-execute
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 0
- False
- False
-
-
-
-
-
- True
- False
- Delete the selected filter
- True
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
-
- True
- gtk-remove
- 4
- 0.5
- 0.5
- 0
- 0
-
-
-
-
- 0
- False
- False
-
-
-
-
-
-
-
-
- 0
- False
- True
-
-
-
-
- 5
- True
- True
-
-
-
-
-
- True
- <i>Note: changes take effect only after this window is closed</i>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0.5
- 0.5
- 6
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
-
-
- 0
- True
- True
-
-
-
-
-
-
-
- True
-
- GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_NONE
- False
- 450
- 400
- True
- False
- True
- False
- False
- GDK_WINDOW_TYPE_HINT_DIALOG
- GDK_GRAVITY_CENTER
- True
- False
- False
-
-
-
-
- True
- False
- 8
-
-
-
- True
- GTK_BUTTONBOX_END
-
-
-
- True
- True
- True
- gtk-close
- True
- GTK_RELIEF_NORMAL
- True
- 0
-
-
-
-
-
- 0
- False
- True
- GTK_PACK_END
-
-
-
-
-
- True
-
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0.5
- 0.5
- 0
- 6
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
-
-
-
- True
- True
- GTK_POLICY_NEVER
- GTK_POLICY_AUTOMATIC
- GTK_SHADOW_IN
- GTK_CORNER_TOP_LEFT
-
-
-
- True
- True
- True
- False
- False
- True
- False
- False
- False
-
-
-
-
- 0
- True
- True
-
-
-
-
-
-
-
- True
-
- GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_CENTER_ON_PARENT
- False
- True
- False
- True
- False
- False
- GDK_WINDOW_TYPE_HINT_DIALOG
- GDK_GRAVITY_CENTER
- True
- False
- False
-
-
-
-
- True
- False
- 0
-
-
-
- True
- GTK_BUTTONBOX_END
-
-
-
- True
- True
- True
- gtk-cancel
- True
- GTK_RELIEF_NORMAL
- True
- -6
-
-
-
-
-
-
- True
- True
- True
- gtk-ok
- True
- GTK_RELIEF_NORMAL
- True
- -5
-
-
-
-
-
-
- True
- True
- True
- gtk-help
- True
- GTK_RELIEF_NORMAL
- True
- -11
-
-
-
-
-
- 0
- False
- True
- GTK_PACK_END
-
-
-
-
-
- 6
- True
- False
- 0
-
-
-
- True
-
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0.5
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 6
- False
- False
-
-
-
-
-
- 6
- True
- True
- 0
-
-
-
- True
- True
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
- GTK_SHADOW_IN
- GTK_CORNER_TOP_LEFT
-
-
-
- 250
- True
- True
- True
- False
- False
- False
- False
- False
- False
-
-
-
-
- False
- False
-
-
-
-
-
- True
- False
- 6
-
-
-
- True
- <b>Selected Rule</b>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
-
-
-
- True
- No rule selected
- False
- False
- GTK_JUSTIFY_LEFT
- True
- False
- 0
- 0.5
- 12
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 6
- False
- False
-
-
-
-
-
- True
- <b>Description</b>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
-
-
-
- True
- No description
- False
- False
- GTK_JUSTIFY_LEFT
- True
- False
- 0
- 0
- 12
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 6
- False
- False
-
-
-
-
-
- True
- <b>Values</b>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
-
-
- True
- True
-
-
-
-
- 0
- True
- True
-
-
-
-
- 0
- True
- True
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ 400
+ 350
+ dialog
+ center
+ False
+
+
+
+ True
+ 8
+
+
+ True
+
+
+ True
+ center
+
+
+ False
+ False
+ 5
+ 0
+
+
+
+
+ True
+ 6
+ 6
+
+
+ True
+ False
+ automatic
+ automatic
+ in
+
+
+ True
+ True
+
+
+
+
+ 0
+
+
+
+
+ True
+ 6
+
+
+ True
+ True
+ True
+ False
+ Add a new filter
+
+
+
+ True
+ gtk-add
+ 4
+
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ False
+ True
+ True
+ False
+ Edit the selected filter
+
+
+
+ True
+ gtk-edit
+ 4
+
+
+
+
+ False
+ False
+ 1
+
+
+
+
+ True
+ False
+ True
+ True
+ False
+ Clone the selected filter
+
+
+
+ True
+ gtk-copy
+ 4
+
+
+
+
+ False
+ False
+ 2
+
+
+
+
+ True
+ True
+ False
+ Test the selected filter
+
+
+
+ True
+ gtk-execute
+ 4
+
+
+
+
+ False
+ False
+ 3
+
+
+
+
+ True
+ False
+ True
+ True
+ False
+ Delete the selected filter
+
+
+
+ True
+ gtk-remove
+ 4
+
+
+
+
+ False
+ False
+ 4
+
+
+
+
+
+
+
+ False
+ 1
+
+
+
+
+ 5
+ 1
+
+
+
+
+ True
+ 6
+ <i>Note: changes take effect only after this window is closed</i>
+ True
+
+
+ False
+ False
+ 2
+
+
+
+
+ 1
+
+
+
+
+ True
+ end
+
+
+ gtk-close
+ True
+ True
+ True
+ False
+ True
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ gtk-help
+ True
+ True
+ True
+ False
+ True
+
+
+
+ False
+ False
+ 1
+
+
+
+
+ False
+ end
+ 0
+
+
+
+
+
+ close
+ help
+
+
+
+ 450
+ 400
+ dialog
+ center
+ False
+
+
+
+ True
+ 8
+
+
+ True
+ 6
+
+
+ False
+ False
+ 1
+
+
+
+
+ True
+ True
+ never
+ automatic
+ in
+
+
+ True
+ True
+
+
+
+
+ 2
+
+
+
+
+ True
+ end
+
+
+ gtk-close
+ True
+ True
+ True
+ False
+ True
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ False
+ end
+ 0
+
+
+
+
+
+ close
+
+
+
+ center-on-parent
+ dialog
+ center
+ False
+
+
+
+ True
+
+
+ True
+ 6
+
+
+ True
+ True
+
+
+ False
+ False
+ 6
+ 0
+
+
+
+
+ True
+ True
+ 6
+
+
+ True
+ True
+ automatic
+ automatic
+ in
+
+
+ 250
+ True
+ True
+ False
+
+
+
+
+ False
+ False
+
+
+
+
+ True
+ 6
+
+
+ True
+ 0
+ <b>Selected Rule</b>
+ True
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ 0
+ 12
+ No rule selected
+ True
+
+
+ False
+ False
+ 6
+ 1
+
+
+
+
+ True
+ 0
+ <b>Description</b>
+ True
+
+
+ False
+ False
+ 2
+
+
+
+
+ True
+ 0
+ 0
+ 12
+ No description
+ True
+
+
+ False
+ False
+ 6
+ 3
+
+
+
+
+ True
+ 0
+ <b>Values</b>
+ True
+
+
+ False
+ False
+ 4
+
+
+
+
+ True
+ True
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+ True
+ end
+
+
+ gtk-cancel
+ True
+ True
+ True
+ False
+ True
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ gtk-ok
+ True
+ True
+ True
+ False
+ True
+
+
+
+ False
+ False
+ 1
+
+
+
+
+ gtk-help
+ True
+ True
+ True
+ False
+ True
+
+
+
+ False
+ False
+ 2
+
+
+
+
+ False
+ end
+ 0
+
+
+
+
+
+ cancel
+ ok
+ help
+
+
+