Reorganize custom widgets into a new 'widgets' package.
1. moving existing widget modules under src/widgets/ svn: r10694
This commit is contained in:
parent
9fb61bec46
commit
05b39c5c15
@ -50,7 +50,7 @@ from Utils import media_path_full
|
|||||||
import DateHandler
|
import DateHandler
|
||||||
import ThumbNails
|
import ThumbNails
|
||||||
import Config
|
import Config
|
||||||
import GrampsWidgets
|
import widgets
|
||||||
import Errors
|
import Errors
|
||||||
import gen.utils
|
import gen.utils
|
||||||
|
|
||||||
@ -521,15 +521,15 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
name = name_displayer.display(person)
|
name = name_displayer.display(person)
|
||||||
fmt = '<span size="larger" weight="bold">%s</span>'
|
fmt = '<span size="larger" weight="bold">%s</span>'
|
||||||
text = fmt % cgi.escape(name)
|
text = fmt % cgi.escape(name)
|
||||||
label = GrampsWidgets.DualMarkupLabel(text, _GenderCode[person.gender],
|
label = widgets.DualMarkupLabel(text, _GenderCode[person.gender],
|
||||||
x_align=1, y_align=0)
|
x_align=1, y_align=0)
|
||||||
if Config.get(Config.RELEDITBTN):
|
if Config.get(Config.RELEDITBTN):
|
||||||
button = GrampsWidgets.IconButton(self.edit_button_press,
|
button = widgets.IconButton(self.edit_button_press,
|
||||||
person.handle)
|
person.handle)
|
||||||
self.tooltips.set_tip(button, _('Edit %s') % name)
|
self.tooltips.set_tip(button, _('Edit %s') % name)
|
||||||
else:
|
else:
|
||||||
button = None
|
button = None
|
||||||
hbox = GrampsWidgets.LinkBox(label, button)
|
hbox = widgets.LinkBox(label, button)
|
||||||
|
|
||||||
table.attach(hbox, 0, 2, 0, 1)
|
table.attach(hbox, 0, 2, 0, 1)
|
||||||
|
|
||||||
@ -544,9 +544,9 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
|
|
||||||
# GRAMPS ID
|
# GRAMPS ID
|
||||||
|
|
||||||
subtbl.attach(GrampsWidgets.BasicLabel("%s:" % _('ID')),
|
subtbl.attach(widgets.BasicLabel("%s:" % _('ID')),
|
||||||
1, 2, 0, 1, xoptions=gtk.FILL, yoptions=0)
|
1, 2, 0, 1, xoptions=gtk.FILL, yoptions=0)
|
||||||
subtbl.attach(GrampsWidgets.BasicLabel(person.gramps_id),
|
subtbl.attach(widgets.BasicLabel(person.gramps_id),
|
||||||
2, 3, 0, 1, yoptions=0)
|
2, 3, 0, 1, yoptions=0)
|
||||||
|
|
||||||
# Birth event.
|
# Birth event.
|
||||||
@ -556,9 +556,9 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
else:
|
else:
|
||||||
birth_title = _("Birth")
|
birth_title = _("Birth")
|
||||||
|
|
||||||
subtbl.attach(GrampsWidgets.BasicLabel("%s:" % birth_title),
|
subtbl.attach(widgets.BasicLabel("%s:" % birth_title),
|
||||||
1, 2, 1, 2, xoptions=gtk.FILL, yoptions=0)
|
1, 2, 1, 2, xoptions=gtk.FILL, yoptions=0)
|
||||||
subtbl.attach(GrampsWidgets.BasicLabel(self.format_event(birth)),
|
subtbl.attach(widgets.BasicLabel(self.format_event(birth)),
|
||||||
2, 3, 1, 2, yoptions=0)
|
2, 3, 1, 2, yoptions=0)
|
||||||
|
|
||||||
death = ReportUtils.get_death_or_fallback(self.dbstate.db, person)
|
death = ReportUtils.get_death_or_fallback(self.dbstate.db, person)
|
||||||
@ -567,9 +567,9 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
else:
|
else:
|
||||||
death_title = _("Death")
|
death_title = _("Death")
|
||||||
|
|
||||||
subtbl.attach(GrampsWidgets.BasicLabel("%s:" % death_title),
|
subtbl.attach(widgets.BasicLabel("%s:" % death_title),
|
||||||
1, 2, 2, 3, xoptions=gtk.FILL, yoptions=0)
|
1, 2, 2, 3, xoptions=gtk.FILL, yoptions=0)
|
||||||
subtbl.attach(GrampsWidgets.BasicLabel(self.format_event(death)),
|
subtbl.attach(widgets.BasicLabel(self.format_event(death)),
|
||||||
2, 3, 2, 3, yoptions=0)
|
2, 3, 2, 3, yoptions=0)
|
||||||
|
|
||||||
|
|
||||||
@ -649,10 +649,10 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
return ''
|
return ''
|
||||||
|
|
||||||
def write_person_data(self, title, data):
|
def write_person_data(self, title, data):
|
||||||
self.attach.attach(GrampsWidgets.BasicLabel(title), _ALABEL_START,
|
self.attach.attach(widgets.BasicLabel(title), _ALABEL_START,
|
||||||
_ALABEL_STOP, self.row, self.row+1,
|
_ALABEL_STOP, self.row, self.row+1,
|
||||||
xoptions=gtk.FILL|gtk.SHRINK)
|
xoptions=gtk.FILL|gtk.SHRINK)
|
||||||
self.attach.attach(GrampsWidgets.BasicLabel(data),
|
self.attach.attach(widgets.BasicLabel(data),
|
||||||
_ADATA_START, _ADATA_STOP,
|
_ADATA_START, _ADATA_STOP,
|
||||||
self.row, self.row+1)
|
self.row, self.row+1)
|
||||||
self.row += 1
|
self.row += 1
|
||||||
@ -660,17 +660,17 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
def write_label(self, title, family, is_parent, person = None):
|
def write_label(self, title, family, is_parent, person = None):
|
||||||
msg = '<span style="italic" weight="heavy">%s</span>' % cgi.escape(title)
|
msg = '<span style="italic" weight="heavy">%s</span>' % cgi.escape(title)
|
||||||
hbox = gtk.HBox()
|
hbox = gtk.HBox()
|
||||||
label = GrampsWidgets.MarkupLabel(msg, x_align=1)
|
label = widgets.MarkupLabel(msg, x_align=1)
|
||||||
# Draw the collapse/expand button:
|
# Draw the collapse/expand button:
|
||||||
if family != None:
|
if family != None:
|
||||||
if self.check_collapsed(person.handle, family.handle):
|
if self.check_collapsed(person.handle, family.handle):
|
||||||
arrow = GrampsWidgets.ExpandCollapseArrow(True,
|
arrow = widgets.ExpandCollapseArrow(True,
|
||||||
self.expand_collapse_press,
|
self.expand_collapse_press,
|
||||||
(person, family.handle))
|
(person, family.handle))
|
||||||
else:
|
else:
|
||||||
arrow = GrampsWidgets.ExpandCollapseArrow(False,
|
arrow = widgets.ExpandCollapseArrow(False,
|
||||||
self.expand_collapse_press,
|
self.expand_collapse_press,
|
||||||
(person, family.handle))
|
(person, family.handle))
|
||||||
else :
|
else :
|
||||||
arrow = gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_OUT)
|
arrow = gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_OUT)
|
||||||
hbox.pack_start(arrow, False)
|
hbox.pack_start(arrow, False)
|
||||||
@ -683,7 +683,7 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
value = family.gramps_id
|
value = family.gramps_id
|
||||||
else:
|
else:
|
||||||
value = ""
|
value = ""
|
||||||
self.attach.attach(GrampsWidgets.BasicLabel(value),
|
self.attach.attach(widgets.BasicLabel(value),
|
||||||
_DATA_START, _DATA_STOP,
|
_DATA_START, _DATA_STOP,
|
||||||
self.row, self.row+1, gtk.SHRINK|gtk.FILL)
|
self.row, self.row+1, gtk.SHRINK|gtk.FILL)
|
||||||
|
|
||||||
@ -713,28 +713,29 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
if not self.toolbar_visible and not self.dbstate.db.readonly:
|
if not self.toolbar_visible and not self.dbstate.db.readonly:
|
||||||
# Show edit-Buttons if toolbar is not visible
|
# Show edit-Buttons if toolbar is not visible
|
||||||
if self.reorder_sensitive:
|
if self.reorder_sensitive:
|
||||||
add = GrampsWidgets.IconButton(self.reorder, None,
|
add = widgets.IconButton(self.reorder, None,
|
||||||
gtk.STOCK_SORT_ASCENDING)
|
gtk.STOCK_SORT_ASCENDING)
|
||||||
self.tooltips.set_tip(add, ord_msg)
|
self.tooltips.set_tip(add, ord_msg)
|
||||||
hbox.pack_start(add, False)
|
hbox.pack_start(add, False)
|
||||||
|
|
||||||
add = GrampsWidgets.IconButton(call_fcn, None, gtk.STOCK_ADD)
|
add = widgets.IconButton(call_fcn, None, gtk.STOCK_ADD)
|
||||||
self.tooltips.set_tip(add, add_msg)
|
self.tooltips.set_tip(add, add_msg)
|
||||||
hbox.pack_start(add, False)
|
hbox.pack_start(add, False)
|
||||||
|
|
||||||
if is_parent:
|
if is_parent:
|
||||||
add = GrampsWidgets.IconButton(self.select_family, None, gtk.STOCK_INDEX)
|
add = widgets.IconButton(self.select_family, None,
|
||||||
|
gtk.STOCK_INDEX)
|
||||||
self.tooltips.set_tip(add, sel_msg)
|
self.tooltips.set_tip(add, sel_msg)
|
||||||
hbox.pack_start(add, False)
|
hbox.pack_start(add, False)
|
||||||
|
|
||||||
if family:
|
if family:
|
||||||
edit = GrampsWidgets.IconButton(self.edit_family, family.handle,
|
edit = widgets.IconButton(self.edit_family, family.handle,
|
||||||
gtk.STOCK_EDIT)
|
gtk.STOCK_EDIT)
|
||||||
self.tooltips.set_tip(edit, edit_msg)
|
self.tooltips.set_tip(edit, edit_msg)
|
||||||
hbox.pack_start(edit, False)
|
hbox.pack_start(edit, False)
|
||||||
if not self.dbstate.db.readonly:
|
if not self.dbstate.db.readonly:
|
||||||
delete = GrampsWidgets.IconButton(del_fcn, family.handle,
|
delete = widgets.IconButton(del_fcn, family.handle,
|
||||||
gtk.STOCK_REMOVE)
|
gtk.STOCK_REMOVE)
|
||||||
self.tooltips.set_tip(delete, del_msg)
|
self.tooltips.set_tip(delete, del_msg)
|
||||||
hbox.pack_start(delete, False)
|
hbox.pack_start(delete, False)
|
||||||
self.attach.attach(hbox, _BTN_START, _BTN_STOP, self.row, self.row+1)
|
self.attach.attach(hbox, _BTN_START, _BTN_STOP, self.row, self.row+1)
|
||||||
@ -790,13 +791,13 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
active = self.dbstate.active.handle
|
active = self.dbstate.active.handle
|
||||||
hbox = gtk.HBox()
|
hbox = gtk.HBox()
|
||||||
if self.check_collapsed(person.handle, "SIBLINGS"):
|
if self.check_collapsed(person.handle, "SIBLINGS"):
|
||||||
arrow = GrampsWidgets.ExpandCollapseArrow(True,
|
arrow = widgets.ExpandCollapseArrow(True,
|
||||||
self.expand_collapse_press,
|
self.expand_collapse_press,
|
||||||
(person, "SIBLINGS"))
|
(person, "SIBLINGS"))
|
||||||
else:
|
else:
|
||||||
arrow = GrampsWidgets.ExpandCollapseArrow(False,
|
arrow = widgets.ExpandCollapseArrow(False,
|
||||||
self.expand_collapse_press,
|
self.expand_collapse_press,
|
||||||
(person, "SIBLINGS"))
|
(person, "SIBLINGS"))
|
||||||
hbox.pack_start(arrow, False)
|
hbox.pack_start(arrow, False)
|
||||||
label_cell = self.build_label_cell(_('Siblings'))
|
label_cell = self.build_label_cell(_('Siblings'))
|
||||||
hbox.pack_start(label_cell, True)
|
hbox.pack_start(label_cell, True)
|
||||||
@ -837,16 +838,14 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
self.row += 1 # now advance it
|
self.row += 1 # now advance it
|
||||||
else:
|
else:
|
||||||
hbox = gtk.HBox()
|
hbox = gtk.HBox()
|
||||||
addchild = GrampsWidgets.IconButton(
|
addchild = widgets.IconButton(self.add_child_to_fam,
|
||||||
self.add_child_to_fam,
|
family.handle,
|
||||||
family.handle,
|
gtk.STOCK_ADD)
|
||||||
gtk.STOCK_ADD)
|
|
||||||
self.tooltips.set_tip(addchild,
|
self.tooltips.set_tip(addchild,
|
||||||
_('Add new child to family'))
|
_('Add new child to family'))
|
||||||
selchild = GrampsWidgets.IconButton(
|
selchild = widgets.IconButton(self.sel_child_to_fam,
|
||||||
self.sel_child_to_fam,
|
family.handle,
|
||||||
family.handle,
|
gtk.STOCK_INDEX)
|
||||||
gtk.STOCK_INDEX)
|
|
||||||
self.tooltips.set_tip(selchild,
|
self.tooltips.set_tip(selchild,
|
||||||
_('Add existing child to family'))
|
_('Add existing child to family'))
|
||||||
hbox.pack_start(addchild, False)
|
hbox.pack_start(addchild, False)
|
||||||
@ -886,17 +885,16 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
initial_name = False
|
initial_name = False
|
||||||
if handle:
|
if handle:
|
||||||
name = self.get_name(handle, True)
|
name = self.get_name(handle, True)
|
||||||
link_label = GrampsWidgets.LinkLabel(
|
link_label = widgets.LinkLabel(name, self._button_press, handle)
|
||||||
name, self._button_press, handle)
|
|
||||||
if self.use_shade:
|
if self.use_shade:
|
||||||
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||||
if Config.get(Config.RELEDITBTN):
|
if Config.get(Config.RELEDITBTN):
|
||||||
button = GrampsWidgets.IconButton(self.edit_button_press,
|
button = widgets.IconButton(self.edit_button_press,
|
||||||
handle)
|
handle)
|
||||||
self.tooltips.set_tip(button, _('Edit %s') % name[0])
|
self.tooltips.set_tip(button, _('Edit %s') % name[0])
|
||||||
else:
|
else:
|
||||||
button = None
|
button = None
|
||||||
vbox.pack_start(GrampsWidgets.LinkBox(link_label, button),
|
vbox.pack_start(widgets.LinkBox(link_label, button),
|
||||||
expand=False)
|
expand=False)
|
||||||
else:
|
else:
|
||||||
link_label = gtk.Label(_('Unknown'))
|
link_label = gtk.Label(_('Unknown'))
|
||||||
@ -914,8 +912,8 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
else:
|
else:
|
||||||
format = "%s"
|
format = "%s"
|
||||||
|
|
||||||
label = GrampsWidgets.MarkupLabel(format % cgi.escape(title),
|
label = widgets.MarkupLabel(format % cgi.escape(title),
|
||||||
x_align=1, y_align=0)
|
x_align=1, y_align=0)
|
||||||
if Config.get(Config.RELEDITBTN):
|
if Config.get(Config.RELEDITBTN):
|
||||||
label.set_padding(0, 5)
|
label.set_padding(0, 5)
|
||||||
self.attach.attach(label, _PLABEL_START, _PLABEL_STOP, self.row,
|
self.attach.attach(label, _PLABEL_START, _PLABEL_STOP, self.row,
|
||||||
@ -926,16 +924,15 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
|
|
||||||
if handle:
|
if handle:
|
||||||
name = self.get_name(handle, True)
|
name = self.get_name(handle, True)
|
||||||
link_label = GrampsWidgets.LinkLabel(
|
link_label = widgets.LinkLabel(name, self._button_press, handle)
|
||||||
name, self._button_press, handle)
|
|
||||||
if self.use_shade:
|
if self.use_shade:
|
||||||
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||||
if Config.get(Config.RELEDITBTN):
|
if Config.get(Config.RELEDITBTN):
|
||||||
button = GrampsWidgets.IconButton(self.edit_button_press, handle)
|
button = widgets.IconButton(self.edit_button_press, handle)
|
||||||
self.tooltips.set_tip(button, _('Edit %s') % name[0])
|
self.tooltips.set_tip(button, _('Edit %s') % name[0])
|
||||||
else:
|
else:
|
||||||
button = None
|
button = None
|
||||||
vbox.pack_start(GrampsWidgets.LinkBox(link_label, button))
|
vbox.pack_start(widgets.LinkBox(link_label, button))
|
||||||
else:
|
else:
|
||||||
link_label = gtk.Label(_('Unknown'))
|
link_label = gtk.Label(_('Unknown'))
|
||||||
link_label.set_alignment(0, 1)
|
link_label.set_alignment(0, 1)
|
||||||
@ -945,7 +942,7 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
if self.show_details:
|
if self.show_details:
|
||||||
value = self.info_string(handle)
|
value = self.info_string(handle)
|
||||||
if value:
|
if value:
|
||||||
vbox.pack_start(GrampsWidgets.MarkupLabel(value))
|
vbox.pack_start(widgets.MarkupLabel(value))
|
||||||
|
|
||||||
eventbox = gtk.EventBox()
|
eventbox = gtk.EventBox()
|
||||||
if self.use_shade:
|
if self.use_shade:
|
||||||
@ -963,8 +960,8 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
else:
|
else:
|
||||||
format = "%s"
|
format = "%s"
|
||||||
|
|
||||||
lbl = GrampsWidgets.MarkupLabel(format % cgi.escape(title),
|
lbl = widgets.MarkupLabel(format % cgi.escape(title),
|
||||||
x_align=1, y_align=.5)
|
x_align=1, y_align=.5)
|
||||||
if Config.get(Config.RELEDITBTN):
|
if Config.get(Config.RELEDITBTN):
|
||||||
lbl.set_padding(0, 5)
|
lbl.set_padding(0, 5)
|
||||||
return lbl
|
return lbl
|
||||||
@ -1006,23 +1003,23 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
link_func = None
|
link_func = None
|
||||||
|
|
||||||
name = self.get_name(handle, True)
|
name = self.get_name(handle, True)
|
||||||
link_label = GrampsWidgets.LinkLabel(name, link_func, handle, format)
|
link_label = widgets.LinkLabel(name, link_func, handle, format)
|
||||||
|
|
||||||
if self.use_shade:
|
if self.use_shade:
|
||||||
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||||
link_label.set_padding(3, 0)
|
link_label.set_padding(3, 0)
|
||||||
if child_should_be_linked and Config.get(Config.RELEDITBTN):
|
if child_should_be_linked and Config.get(Config.RELEDITBTN):
|
||||||
button = GrampsWidgets.IconButton(self.edit_button_press, handle)
|
button = widgets.IconButton(self.edit_button_press, handle)
|
||||||
self.tooltips.set_tip(button, _('Edit %s') % name[0])
|
self.tooltips.set_tip(button, _('Edit %s') % name[0])
|
||||||
else:
|
else:
|
||||||
button = None
|
button = None
|
||||||
|
|
||||||
hbox = gtk.HBox()
|
hbox = gtk.HBox()
|
||||||
l = GrampsWidgets.BasicLabel("%d." % index)
|
l = widgets.BasicLabel("%d." % index)
|
||||||
l.set_width_chars(3)
|
l.set_width_chars(3)
|
||||||
l.set_alignment(1.0, 0.5)
|
l.set_alignment(1.0, 0.5)
|
||||||
hbox.pack_start(l, False, False, 0)
|
hbox.pack_start(l, False, False, 0)
|
||||||
hbox.pack_start(GrampsWidgets.LinkBox(link_label, button),
|
hbox.pack_start(widgets.LinkBox(link_label, button),
|
||||||
False, False, 4)
|
False, False, 4)
|
||||||
hbox.show()
|
hbox.show()
|
||||||
vbox.pack_start(hbox)
|
vbox.pack_start(hbox)
|
||||||
@ -1030,13 +1027,13 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
if self.show_details:
|
if self.show_details:
|
||||||
value = self.info_string(handle)
|
value = self.info_string(handle)
|
||||||
if value:
|
if value:
|
||||||
l = GrampsWidgets.MarkupLabel(value)
|
l = widgets.MarkupLabel(value)
|
||||||
l.set_padding(48, 0)
|
l.set_padding(48, 0)
|
||||||
vbox.add(l)
|
vbox.add(l)
|
||||||
|
|
||||||
def write_data(self, box, title, start_col=_SDATA_START,
|
def write_data(self, box, title, start_col=_SDATA_START,
|
||||||
stop_col=_SDATA_STOP):
|
stop_col=_SDATA_STOP):
|
||||||
box.add(GrampsWidgets.BasicLabel(title))
|
box.add(widgets.BasicLabel(title))
|
||||||
|
|
||||||
def info_string(self, handle):
|
def info_string(self, handle):
|
||||||
person = self.dbstate.db.get_person_from_handle(handle)
|
person = self.dbstate.db.get_person_from_handle(handle)
|
||||||
@ -1137,7 +1134,7 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
|
|
||||||
def write_relationship(self, box, family):
|
def write_relationship(self, box, family):
|
||||||
msg = _('Relationship type: %s') % cgi.escape(str(family.get_relationship()))
|
msg = _('Relationship type: %s') % cgi.escape(str(family.get_relationship()))
|
||||||
box.add(GrampsWidgets.MarkupLabel(msg))
|
box.add(widgets.MarkupLabel(msg))
|
||||||
|
|
||||||
def place_name(self, handle):
|
def place_name(self, handle):
|
||||||
p = self.dbstate.db.get_place_from_handle(handle)
|
p = self.dbstate.db.get_place_from_handle(handle)
|
||||||
@ -1242,13 +1239,13 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
|
|
||||||
hbox = gtk.HBox()
|
hbox = gtk.HBox()
|
||||||
if self.check_collapsed(person.handle, "CHILDREN"):
|
if self.check_collapsed(person.handle, "CHILDREN"):
|
||||||
arrow = GrampsWidgets.ExpandCollapseArrow(True,
|
arrow = widgets.ExpandCollapseArrow(True,
|
||||||
self.expand_collapse_press,
|
self.expand_collapse_press,
|
||||||
(person, "CHILDREN"))
|
(person, "CHILDREN"))
|
||||||
else:
|
else:
|
||||||
arrow = GrampsWidgets.ExpandCollapseArrow(False,
|
arrow = widgets.ExpandCollapseArrow(False,
|
||||||
self.expand_collapse_press,
|
self.expand_collapse_press,
|
||||||
(person, "CHILDREN"))
|
(person, "CHILDREN"))
|
||||||
hbox.pack_start(arrow, False)
|
hbox.pack_start(arrow, False)
|
||||||
label_cell = self.build_label_cell(_('Children'))
|
label_cell = self.build_label_cell(_('Children'))
|
||||||
hbox.pack_start(label_cell, True)
|
hbox.pack_start(label_cell, True)
|
||||||
@ -1281,16 +1278,14 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
self.row += 1 # now advance it
|
self.row += 1 # now advance it
|
||||||
else:
|
else:
|
||||||
hbox = gtk.HBox()
|
hbox = gtk.HBox()
|
||||||
addchild = GrampsWidgets.IconButton(
|
addchild = widgets.IconButton(self.add_child_to_fam,
|
||||||
self.add_child_to_fam,
|
family.handle,
|
||||||
family.handle,
|
gtk.STOCK_ADD)
|
||||||
gtk.STOCK_ADD)
|
|
||||||
self.tooltips.set_tip(addchild,
|
self.tooltips.set_tip(addchild,
|
||||||
_('Add new child to family'))
|
_('Add new child to family'))
|
||||||
selchild = GrampsWidgets.IconButton(
|
selchild = widgets.IconButton(self.sel_child_to_fam,
|
||||||
self.sel_child_to_fam,
|
family.handle,
|
||||||
family.handle,
|
gtk.STOCK_INDEX)
|
||||||
gtk.STOCK_INDEX)
|
|
||||||
self.tooltips.set_tip(selchild,
|
self.tooltips.set_tip(selchild,
|
||||||
_('Add existing child to family'))
|
_('Add existing child to family'))
|
||||||
hbox.pack_start(addchild, False)
|
hbox.pack_start(addchild, False)
|
||||||
|
@ -40,7 +40,7 @@ import gtk
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import Errors
|
import Errors
|
||||||
from GrampsWidgets import SimpleButton
|
from widgets import SimpleButton
|
||||||
from _EmbeddedList import EmbeddedList
|
from _EmbeddedList import EmbeddedList
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -39,7 +39,7 @@ import gtk
|
|||||||
# GRAMPS classes
|
# GRAMPS classes
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from GrampsWidgets import SimpleButton
|
from widgets import SimpleButton
|
||||||
from _GrampsTab import GrampsTab
|
from _GrampsTab import GrampsTab
|
||||||
import Errors
|
import Errors
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ from _EditSecondary import EditSecondary
|
|||||||
from gen.lib import NoteType
|
from gen.lib import NoteType
|
||||||
|
|
||||||
from DisplayTabs import SourceEmbedList, NoteTab
|
from DisplayTabs import SourceEmbedList, NoteTab
|
||||||
from GrampsWidgets import MonitoredDate, MonitoredEntry, PrivacyButton
|
from widgets import MonitoredDate, MonitoredEntry, PrivacyButton
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -51,7 +51,7 @@ from _EditSecondary import EditSecondary
|
|||||||
from gen.lib import NoteType
|
from gen.lib import NoteType
|
||||||
|
|
||||||
from DisplayTabs import SourceEmbedList, NoteTab
|
from DisplayTabs import SourceEmbedList, NoteTab
|
||||||
from GrampsWidgets import MonitoredEntry, PrivacyButton, MonitoredDataType
|
from widgets import MonitoredEntry, PrivacyButton, MonitoredDataType
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -51,7 +51,7 @@ from gen.lib import NoteType
|
|||||||
import Errors
|
import Errors
|
||||||
|
|
||||||
from DisplayTabs import SourceEmbedList, NoteTab
|
from DisplayTabs import SourceEmbedList, NoteTab
|
||||||
from GrampsWidgets import MonitoredDataType, PrivacyButton
|
from widgets import MonitoredDataType, PrivacyButton
|
||||||
from BasicUtils import name_displayer
|
from BasicUtils import name_displayer
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -48,8 +48,8 @@ from Editors import EditPrimary
|
|||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
from DisplayTabs import (SourceEmbedList, NoteTab, GalleryTab,
|
from DisplayTabs import (SourceEmbedList, NoteTab, GalleryTab,
|
||||||
EventBackRefList, AttrEmbedList)
|
EventBackRefList, AttrEmbedList)
|
||||||
from GrampsWidgets import (MonitoredEntry, PlaceEntry, PrivacyButton,
|
from widgets import (MonitoredEntry, PlaceEntry, PrivacyButton,
|
||||||
MonitoredDataType, MonitoredDate)
|
MonitoredDataType, MonitoredDate)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -45,8 +45,8 @@ import gen.lib
|
|||||||
|
|
||||||
from DisplayTabs import (SourceEmbedList, NoteTab, GalleryTab,
|
from DisplayTabs import (SourceEmbedList, NoteTab, GalleryTab,
|
||||||
EventBackRefList, AttrEmbedList)
|
EventBackRefList, AttrEmbedList)
|
||||||
from GrampsWidgets import (PrivacyButton, MonitoredEntry, PlaceEntry,
|
from widgets import (PrivacyButton, MonitoredEntry, PlaceEntry,
|
||||||
MonitoredDate, MonitoredDataType)
|
MonitoredDate, MonitoredDataType)
|
||||||
from _EditReference import RefTab, EditReference
|
from _EditReference import RefTab, EditReference
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -64,8 +64,8 @@ from ReportBase import ReportUtils
|
|||||||
from DisplayTabs import (EmbeddedList, EventEmbedList, SourceEmbedList,
|
from DisplayTabs import (EmbeddedList, EventEmbedList, SourceEmbedList,
|
||||||
FamilyAttrEmbedList, NoteTab, GalleryTab,
|
FamilyAttrEmbedList, NoteTab, GalleryTab,
|
||||||
FamilyLdsEmbedList, ChildModel)
|
FamilyLdsEmbedList, ChildModel)
|
||||||
from GrampsWidgets import (PrivacyButton, MonitoredEntry, MonitoredDataType,
|
from widgets import (PrivacyButton, MonitoredEntry, MonitoredDataType,
|
||||||
IconButton, LinkBox, BasicLabel)
|
IconButton, LinkBox, BasicLabel)
|
||||||
from ReportBase import CATEGORY_QR_FAMILY
|
from ReportBase import CATEGORY_QR_FAMILY
|
||||||
from QuestionDialog import (ErrorDialog, RunDatabaseRepair, WarningDialog,
|
from QuestionDialog import (ErrorDialog, RunDatabaseRepair, WarningDialog,
|
||||||
MessageHideDialog)
|
MessageHideDialog)
|
||||||
|
@ -54,8 +54,8 @@ import LdsUtils
|
|||||||
from _EditSecondary import EditSecondary
|
from _EditSecondary import EditSecondary
|
||||||
|
|
||||||
from DisplayTabs import SourceEmbedList,NoteTab
|
from DisplayTabs import SourceEmbedList,NoteTab
|
||||||
from GrampsWidgets import (PrivacyButton, MonitoredDate, PlaceEntry,
|
from widgets import (PrivacyButton, MonitoredDate, PlaceEntry,
|
||||||
MonitoredMenu, MonitoredStrMenu)
|
MonitoredMenu, MonitoredStrMenu)
|
||||||
|
|
||||||
_DATA_MAP = {
|
_DATA_MAP = {
|
||||||
gen.lib.LdsOrd.BAPTISM : [
|
gen.lib.LdsOrd.BAPTISM : [
|
||||||
|
@ -36,7 +36,7 @@ import const
|
|||||||
import Config
|
import Config
|
||||||
from _EditSecondary import EditSecondary
|
from _EditSecondary import EditSecondary
|
||||||
|
|
||||||
from GrampsWidgets import MonitoredEntry
|
from widgets import MonitoredEntry
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -47,7 +47,7 @@ import Mime
|
|||||||
import ThumbNails
|
import ThumbNails
|
||||||
import Utils
|
import Utils
|
||||||
from Editors import EditPrimary
|
from Editors import EditPrimary
|
||||||
from GrampsWidgets import MonitoredDate, MonitoredEntry, PrivacyButton
|
from widgets import MonitoredDate, MonitoredEntry, PrivacyButton
|
||||||
from DisplayTabs import (SourceEmbedList, AttrEmbedList, NoteTab,
|
from DisplayTabs import (SourceEmbedList, AttrEmbedList, NoteTab,
|
||||||
MediaBackRefList)
|
MediaBackRefList)
|
||||||
from Editors.AddMedia import AddMediaObject
|
from Editors.AddMedia import AddMediaObject
|
||||||
|
@ -49,7 +49,7 @@ from gen.lib import NoteType
|
|||||||
|
|
||||||
from DisplayTabs import (SourceEmbedList, AttrEmbedList, MediaBackRefList,
|
from DisplayTabs import (SourceEmbedList, AttrEmbedList, MediaBackRefList,
|
||||||
NoteTab)
|
NoteTab)
|
||||||
from GrampsWidgets import MonitoredSpinButton, MonitoredEntry, PrivacyButton
|
from widgets import MonitoredSpinButton, MonitoredEntry, PrivacyButton
|
||||||
from _EditReference import RefTab, EditReference
|
from _EditReference import RefTab, EditReference
|
||||||
from AddMedia import AddMediaObject
|
from AddMedia import AddMediaObject
|
||||||
|
|
||||||
|
@ -46,8 +46,8 @@ from BasicUtils import name_displayer
|
|||||||
from _EditSecondary import EditSecondary
|
from _EditSecondary import EditSecondary
|
||||||
from gen.lib import NoteType
|
from gen.lib import NoteType
|
||||||
from DisplayTabs import GrampsTab,SourceEmbedList,NoteTab
|
from DisplayTabs import GrampsTab,SourceEmbedList,NoteTab
|
||||||
from GrampsWidgets import (MonitoredEntry, MonitoredMenu, MonitoredDate,
|
from widgets import (MonitoredEntry, MonitoredMenu, MonitoredDate,
|
||||||
MonitoredDataType, PrivacyButton)
|
MonitoredDataType, PrivacyButton)
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -47,11 +47,11 @@ import pango
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import Config
|
import Config
|
||||||
from const import GLADE_FILE
|
from const import GLADE_FILE
|
||||||
from Editors._StyledTextEditor import StyledTextEditor
|
from widgets import StyledTextEditor
|
||||||
from Editors._EditPrimary import EditPrimary
|
from Editors._EditPrimary import EditPrimary
|
||||||
from DisplayTabs import GrampsTab, NoteBackRefList
|
from DisplayTabs import GrampsTab, NoteBackRefList
|
||||||
from GrampsWidgets import (MonitoredDataType, MonitoredCheckbox,
|
from widgets import (MonitoredDataType, MonitoredCheckbox,
|
||||||
MonitoredEntry, PrivacyButton)
|
MonitoredEntry, PrivacyButton)
|
||||||
from gen.lib import Note
|
from gen.lib import Note
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ import const
|
|||||||
import Utils
|
import Utils
|
||||||
import Mime
|
import Mime
|
||||||
import gen.lib
|
import gen.lib
|
||||||
import GrampsWidgets
|
import widgets
|
||||||
from BasicUtils import name_displayer
|
from BasicUtils import name_displayer
|
||||||
import Errors
|
import Errors
|
||||||
|
|
||||||
@ -224,12 +224,12 @@ class EditPerson(EditPrimary):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.private = GrampsWidgets.PrivacyButton(
|
self.private = widgets.PrivacyButton(
|
||||||
self.top.get_widget('private'),
|
self.top.get_widget('private'),
|
||||||
self.obj,
|
self.obj,
|
||||||
self.db.readonly)
|
self.db.readonly)
|
||||||
|
|
||||||
self.gender = GrampsWidgets.MonitoredMenu(
|
self.gender = widgets.MonitoredMenu(
|
||||||
self.top.get_widget('gender'),
|
self.top.get_widget('gender'),
|
||||||
self.obj.set_gender,
|
self.obj.set_gender,
|
||||||
self.obj.get_gender,
|
self.obj.get_gender,
|
||||||
@ -240,7 +240,7 @@ class EditPerson(EditPrimary):
|
|||||||
),
|
),
|
||||||
self.db.readonly)
|
self.db.readonly)
|
||||||
|
|
||||||
self.marker = GrampsWidgets.MonitoredDataType(
|
self.marker = widgets.MonitoredDataType(
|
||||||
self.top.get_widget('marker'),
|
self.top.get_widget('marker'),
|
||||||
self.obj.set_marker,
|
self.obj.set_marker,
|
||||||
self.obj.get_marker,
|
self.obj.get_marker,
|
||||||
@ -248,7 +248,7 @@ class EditPerson(EditPrimary):
|
|||||||
self.db.get_marker_types(),
|
self.db.get_marker_types(),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.ntype_field = GrampsWidgets.MonitoredDataType(
|
self.ntype_field = widgets.MonitoredDataType(
|
||||||
self.top.get_widget("ntype"),
|
self.top.get_widget("ntype"),
|
||||||
self.pname.set_type,
|
self.pname.set_type,
|
||||||
self.pname.get_type,
|
self.pname.get_type,
|
||||||
@ -256,7 +256,7 @@ class EditPerson(EditPrimary):
|
|||||||
self.db.get_name_types())
|
self.db.get_name_types())
|
||||||
|
|
||||||
if self.use_patronymic:
|
if self.use_patronymic:
|
||||||
self.prefix = GrampsWidgets.MonitoredEntry(
|
self.prefix = widgets.MonitoredEntry(
|
||||||
self.top.get_widget("prefix"),
|
self.top.get_widget("prefix"),
|
||||||
self.pname.set_patronymic,
|
self.pname.set_patronymic,
|
||||||
self.pname.get_patronymic,
|
self.pname.get_patronymic,
|
||||||
@ -266,44 +266,44 @@ class EditPerson(EditPrimary):
|
|||||||
prefix_label.set_text(_('Patronymic:'))
|
prefix_label.set_text(_('Patronymic:'))
|
||||||
prefix_label.set_use_underline(True)
|
prefix_label.set_use_underline(True)
|
||||||
else:
|
else:
|
||||||
self.prefix = GrampsWidgets.MonitoredEntry(
|
self.prefix = widgets.MonitoredEntry(
|
||||||
self.top.get_widget("prefix"),
|
self.top.get_widget("prefix"),
|
||||||
self.pname.set_surname_prefix,
|
self.pname.set_surname_prefix,
|
||||||
self.pname.get_surname_prefix,
|
self.pname.get_surname_prefix,
|
||||||
self.db.readonly)
|
self.db.readonly)
|
||||||
|
|
||||||
self.suffix = GrampsWidgets.MonitoredEntry(
|
self.suffix = widgets.MonitoredEntry(
|
||||||
self.top.get_widget("suffix"),
|
self.top.get_widget("suffix"),
|
||||||
self.pname.set_suffix,
|
self.pname.set_suffix,
|
||||||
self.pname.get_suffix,
|
self.pname.get_suffix,
|
||||||
self.db.readonly)
|
self.db.readonly)
|
||||||
|
|
||||||
self.call = GrampsWidgets.MonitoredEntry(
|
self.call = widgets.MonitoredEntry(
|
||||||
self.top.get_widget("call"),
|
self.top.get_widget("call"),
|
||||||
self.pname.set_call_name,
|
self.pname.set_call_name,
|
||||||
self.pname.get_call_name,
|
self.pname.get_call_name,
|
||||||
self.db.readonly)
|
self.db.readonly)
|
||||||
|
|
||||||
self.given = GrampsWidgets.MonitoredEntry(
|
self.given = widgets.MonitoredEntry(
|
||||||
self.top.get_widget("given_name"),
|
self.top.get_widget("given_name"),
|
||||||
self.pname.set_first_name,
|
self.pname.set_first_name,
|
||||||
self.pname.get_first_name,
|
self.pname.get_first_name,
|
||||||
self.db.readonly)
|
self.db.readonly)
|
||||||
|
|
||||||
self.title = GrampsWidgets.MonitoredEntry(
|
self.title = widgets.MonitoredEntry(
|
||||||
self.top.get_widget("title"),
|
self.top.get_widget("title"),
|
||||||
self.pname.set_title,
|
self.pname.set_title,
|
||||||
self.pname.get_title,
|
self.pname.get_title,
|
||||||
self.db.readonly)
|
self.db.readonly)
|
||||||
|
|
||||||
self.surname_field = GrampsWidgets.MonitoredEntry(
|
self.surname_field = widgets.MonitoredEntry(
|
||||||
self.top.get_widget("surname"),
|
self.top.get_widget("surname"),
|
||||||
self.pname.set_surname,
|
self.pname.set_surname,
|
||||||
self.pname.get_surname,
|
self.pname.get_surname,
|
||||||
self.db.readonly,
|
self.db.readonly,
|
||||||
autolist=self.db.get_surname_list())
|
autolist=self.db.get_surname_list())
|
||||||
|
|
||||||
self.gid = GrampsWidgets.MonitoredEntry(
|
self.gid = widgets.MonitoredEntry(
|
||||||
self.top.get_widget("gid"),
|
self.top.get_widget("gid"),
|
||||||
self.obj.set_gramps_id,
|
self.obj.set_gramps_id,
|
||||||
self.obj.get_gramps_id,
|
self.obj.get_gramps_id,
|
||||||
|
@ -50,7 +50,7 @@ import Config
|
|||||||
from BasicUtils import name_displayer
|
from BasicUtils import name_displayer
|
||||||
from _EditSecondary import EditSecondary
|
from _EditSecondary import EditSecondary
|
||||||
from gen.lib import NoteType
|
from gen.lib import NoteType
|
||||||
from GrampsWidgets import MonitoredEntry, PrivacyButton
|
from widgets import MonitoredEntry, PrivacyButton
|
||||||
from DisplayTabs import SourceEmbedList, NoteTab
|
from DisplayTabs import SourceEmbedList, NoteTab
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -49,7 +49,7 @@ import gen.lib
|
|||||||
from Editors._EditPrimary import EditPrimary
|
from Editors._EditPrimary import EditPrimary
|
||||||
from DisplayTabs import (GrampsTab, LocationEmbedList, SourceEmbedList,
|
from DisplayTabs import (GrampsTab, LocationEmbedList, SourceEmbedList,
|
||||||
GalleryTab, NoteTab, WebEmbedList, PlaceBackRefList)
|
GalleryTab, NoteTab, WebEmbedList, PlaceBackRefList)
|
||||||
from GrampsWidgets import MonitoredEntry, PrivacyButton
|
from widgets import MonitoredEntry, PrivacyButton
|
||||||
from Errors import ValidationError
|
from Errors import ValidationError
|
||||||
from PlaceUtils import conv_lat_lon
|
from PlaceUtils import conv_lat_lon
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
|
@ -45,7 +45,7 @@ import Config
|
|||||||
from gen.lib import NoteType
|
from gen.lib import NoteType
|
||||||
|
|
||||||
from DisplayTabs import NoteTab,AddrEmbedList,WebEmbedList,SourceBackRefList
|
from DisplayTabs import NoteTab,AddrEmbedList,WebEmbedList,SourceBackRefList
|
||||||
from GrampsWidgets import MonitoredEntry, PrivacyButton, MonitoredDataType
|
from widgets import MonitoredEntry, PrivacyButton, MonitoredDataType
|
||||||
from _EditReference import RefTab, EditReference
|
from _EditReference import RefTab, EditReference
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -44,7 +44,7 @@ import const
|
|||||||
import Config
|
import Config
|
||||||
import gen.lib
|
import gen.lib
|
||||||
|
|
||||||
from GrampsWidgets import MonitoredEntry, MonitoredDataType, PrivacyButton
|
from widgets import MonitoredEntry, MonitoredDataType, PrivacyButton
|
||||||
from DisplayTabs import AddrEmbedList, WebEmbedList, NoteTab, SourceBackRefList
|
from DisplayTabs import AddrEmbedList, WebEmbedList, NoteTab, SourceBackRefList
|
||||||
from Editors._EditPrimary import EditPrimary
|
from Editors._EditPrimary import EditPrimary
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
|
@ -50,7 +50,7 @@ from Editors._EditPrimary import EditPrimary
|
|||||||
|
|
||||||
from DisplayTabs import (NoteTab, GalleryTab, DataEmbedList,
|
from DisplayTabs import (NoteTab, GalleryTab, DataEmbedList,
|
||||||
SourceBackRefList, RepoEmbedList)
|
SourceBackRefList, RepoEmbedList)
|
||||||
from GrampsWidgets import MonitoredEntry, PrivacyButton
|
from widgets import MonitoredEntry, PrivacyButton
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -45,8 +45,8 @@ import gen.lib
|
|||||||
|
|
||||||
from DisplayTabs import (NoteTab, GalleryTab, SourceBackRefList,
|
from DisplayTabs import (NoteTab, GalleryTab, SourceBackRefList,
|
||||||
DataEmbedList, RepoEmbedList)
|
DataEmbedList, RepoEmbedList)
|
||||||
from GrampsWidgets import (PrivacyButton, MonitoredEntry, MonitoredMenu,
|
from widgets import (PrivacyButton, MonitoredEntry, MonitoredMenu,
|
||||||
MonitoredDate)
|
MonitoredDate)
|
||||||
from _EditReference import RefTab, EditReference
|
from _EditReference import RefTab, EditReference
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -42,7 +42,7 @@ from gtk import glade
|
|||||||
import const
|
import const
|
||||||
import Config
|
import Config
|
||||||
from _EditSecondary import EditSecondary
|
from _EditSecondary import EditSecondary
|
||||||
from GrampsWidgets import MonitoredEntry, PrivacyButton, MonitoredDataType
|
from widgets import MonitoredEntry, PrivacyButton, MonitoredDataType
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -39,7 +39,7 @@ import gtk
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import GrampsWidgets
|
import widgets
|
||||||
import gen.lib
|
import gen.lib
|
||||||
|
|
||||||
from Filters.SideBar import SidebarFilter
|
from Filters.SideBar import SidebarFilter
|
||||||
@ -64,11 +64,11 @@ class EventSidebarFilter(SidebarFilter):
|
|||||||
self.filter_event.set_type((gen.lib.EventType.CUSTOM, u''))
|
self.filter_event.set_type((gen.lib.EventType.CUSTOM, u''))
|
||||||
self.etype = gtk.ComboBoxEntry()
|
self.etype = gtk.ComboBoxEntry()
|
||||||
|
|
||||||
self.event_menu = GrampsWidgets.MonitoredDataType(
|
self.event_menu = widgets.MonitoredDataType(
|
||||||
self.etype,
|
self.etype,
|
||||||
self.filter_event.set_type,
|
self.filter_event.set_type,
|
||||||
self.filter_event.get_type)
|
self.filter_event.get_type)
|
||||||
|
|
||||||
self.filter_date = gtk.Entry()
|
self.filter_date = gtk.Entry()
|
||||||
self.filter_place = gtk.Entry()
|
self.filter_place = gtk.Entry()
|
||||||
self.filter_note = gtk.Entry()
|
self.filter_note = gtk.Entry()
|
||||||
|
@ -39,7 +39,7 @@ import gtk
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import GrampsWidgets
|
import widgets
|
||||||
import gen.lib
|
import gen.lib
|
||||||
|
|
||||||
from Filters.SideBar import SidebarFilter
|
from Filters.SideBar import SidebarFilter
|
||||||
@ -74,12 +74,12 @@ class FamilySidebarFilter(SidebarFilter):
|
|||||||
self.family_stub.set_relationship((gen.lib.FamilyRelType.CUSTOM, u''))
|
self.family_stub.set_relationship((gen.lib.FamilyRelType.CUSTOM, u''))
|
||||||
self.rtype = gtk.ComboBoxEntry()
|
self.rtype = gtk.ComboBoxEntry()
|
||||||
|
|
||||||
self.event_menu = GrampsWidgets.MonitoredDataType(
|
self.event_menu = widgets.MonitoredDataType(
|
||||||
self.etype,
|
self.etype,
|
||||||
self.filter_event.set_type,
|
self.filter_event.set_type,
|
||||||
self.filter_event.get_type)
|
self.filter_event.get_type)
|
||||||
|
|
||||||
self.rel_menu = GrampsWidgets.MonitoredDataType(
|
self.rel_menu = widgets.MonitoredDataType(
|
||||||
self.rtype,
|
self.rtype,
|
||||||
self.family_stub.set_relationship,
|
self.family_stub.set_relationship,
|
||||||
self.family_stub.get_relationship)
|
self.family_stub.get_relationship)
|
||||||
@ -87,7 +87,7 @@ class FamilySidebarFilter(SidebarFilter):
|
|||||||
self.filter_marker = gen.lib.Family()
|
self.filter_marker = gen.lib.Family()
|
||||||
self.filter_marker.set_marker((gen.lib.MarkerType.CUSTOM, u''))
|
self.filter_marker.set_marker((gen.lib.MarkerType.CUSTOM, u''))
|
||||||
self.mtype = gtk.ComboBoxEntry()
|
self.mtype = gtk.ComboBoxEntry()
|
||||||
self.marker_menu = GrampsWidgets.MonitoredDataType(
|
self.marker_menu = widgets.MonitoredDataType(
|
||||||
self.mtype,
|
self.mtype,
|
||||||
self.filter_marker.set_marker,
|
self.filter_marker.set_marker,
|
||||||
self.filter_marker.get_marker)
|
self.filter_marker.get_marker)
|
||||||
|
@ -39,7 +39,7 @@ import gtk
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import GrampsWidgets
|
import widgets
|
||||||
from gen.lib import Note, NoteType
|
from gen.lib import Note, NoteType
|
||||||
|
|
||||||
from Filters.SideBar import SidebarFilter
|
from Filters.SideBar import SidebarFilter
|
||||||
@ -62,7 +62,7 @@ class NoteSidebarFilter(SidebarFilter):
|
|||||||
self.note = Note()
|
self.note = Note()
|
||||||
self.note.set_type((NoteType.CUSTOM,''))
|
self.note.set_type((NoteType.CUSTOM,''))
|
||||||
self.ntype = gtk.ComboBoxEntry()
|
self.ntype = gtk.ComboBoxEntry()
|
||||||
self.event_menu = GrampsWidgets.MonitoredDataType(
|
self.event_menu = widgets.MonitoredDataType(
|
||||||
self.ntype,
|
self.ntype,
|
||||||
self.note.set_type,
|
self.note.set_type,
|
||||||
self.note.get_type)
|
self.note.get_type)
|
||||||
|
@ -39,7 +39,7 @@ import gtk
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import GrampsWidgets
|
import widgets
|
||||||
import gen.lib
|
import gen.lib
|
||||||
import DateHandler
|
import DateHandler
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ class PersonSidebarFilter(SidebarFilter):
|
|||||||
self.filter_event = gen.lib.Event()
|
self.filter_event = gen.lib.Event()
|
||||||
self.filter_event.set_type((gen.lib.EventType.CUSTOM, u''))
|
self.filter_event.set_type((gen.lib.EventType.CUSTOM, u''))
|
||||||
self.etype = gtk.ComboBoxEntry()
|
self.etype = gtk.ComboBoxEntry()
|
||||||
self.event_menu = GrampsWidgets.MonitoredDataType(
|
self.event_menu = widgets.MonitoredDataType(
|
||||||
self.etype,
|
self.etype,
|
||||||
self.filter_event.set_type,
|
self.filter_event.set_type,
|
||||||
self.filter_event.get_type)
|
self.filter_event.get_type)
|
||||||
@ -87,7 +87,7 @@ class PersonSidebarFilter(SidebarFilter):
|
|||||||
self.filter_marker = gen.lib.Person()
|
self.filter_marker = gen.lib.Person()
|
||||||
self.filter_marker.set_marker((gen.lib.MarkerType.CUSTOM, u''))
|
self.filter_marker.set_marker((gen.lib.MarkerType.CUSTOM, u''))
|
||||||
self.mtype = gtk.ComboBoxEntry()
|
self.mtype = gtk.ComboBoxEntry()
|
||||||
self.marker_menu = GrampsWidgets.MonitoredDataType(
|
self.marker_menu = widgets.MonitoredDataType(
|
||||||
self.mtype,
|
self.mtype,
|
||||||
self.filter_marker.set_marker,
|
self.filter_marker.set_marker,
|
||||||
self.filter_marker.get_marker)
|
self.filter_marker.get_marker)
|
||||||
|
@ -39,7 +39,7 @@ import gtk
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import GrampsWidgets
|
import widgets
|
||||||
from gen.lib import Repository, RepositoryType
|
from gen.lib import Repository, RepositoryType
|
||||||
|
|
||||||
from Filters.SideBar import SidebarFilter
|
from Filters.SideBar import SidebarFilter
|
||||||
@ -66,7 +66,7 @@ class RepoSidebarFilter(SidebarFilter):
|
|||||||
self.repo = Repository()
|
self.repo = Repository()
|
||||||
self.repo.set_type((RepositoryType.CUSTOM,''))
|
self.repo.set_type((RepositoryType.CUSTOM,''))
|
||||||
self.rtype = gtk.ComboBoxEntry()
|
self.rtype = gtk.ComboBoxEntry()
|
||||||
self.event_menu = GrampsWidgets.MonitoredDataType(
|
self.event_menu = widgets.MonitoredDataType(
|
||||||
self.rtype,
|
self.rtype,
|
||||||
self.repo.set_type,
|
self.repo.set_type,
|
||||||
self.repo.get_type)
|
self.repo.get_type)
|
||||||
|
@ -24,7 +24,7 @@ from gettext import gettext as _
|
|||||||
import gtk
|
import gtk
|
||||||
import pango
|
import pango
|
||||||
|
|
||||||
import GrampsWidgets
|
import widgets
|
||||||
import Config
|
import Config
|
||||||
|
|
||||||
_RETURN = gtk.gdk.keyval_from_name("Return")
|
_RETURN = gtk.gdk.keyval_from_name("Return")
|
||||||
@ -51,7 +51,7 @@ class SidebarFilter:
|
|||||||
self.dbstate = dbstate
|
self.dbstate = dbstate
|
||||||
|
|
||||||
def _init_interface(self):
|
def _init_interface(self):
|
||||||
self.table.attach(GrampsWidgets.MarkupLabel(_('<b>Filter</b>')),
|
self.table.attach(widgets.MarkupLabel(_('<b>Filter</b>')),
|
||||||
0, 2, 0, 1, xoptions=gtk.FILL|gtk.EXPAND, yoptions=0)
|
0, 2, 0, 1, xoptions=gtk.FILL|gtk.EXPAND, yoptions=0)
|
||||||
btn = gtk.Button()
|
btn = gtk.Button()
|
||||||
img = gtk.image_new_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU)
|
img = gtk.image_new_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU)
|
||||||
@ -129,7 +129,7 @@ class SidebarFilter:
|
|||||||
|
|
||||||
def add_entry(self, name, widget):
|
def add_entry(self, name, widget):
|
||||||
if name:
|
if name:
|
||||||
self.table.attach(GrampsWidgets.BasicLabel(name),
|
self.table.attach(widgets.BasicLabel(name),
|
||||||
1, 2, self.position, self.position+1,
|
1, 2, self.position, self.position+1,
|
||||||
xoptions=gtk.FILL, yoptions=0)
|
xoptions=gtk.FILL, yoptions=0)
|
||||||
self.table.attach(widget, 2, 4, self.position, self.position+1,
|
self.table.attach(widget, 2, 4, self.position, self.position+1,
|
||||||
|
@ -52,7 +52,7 @@ from BasicUtils import name_displayer as _nd
|
|||||||
import Utils
|
import Utils
|
||||||
from gen.lib import Name
|
from gen.lib import Name
|
||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
from GrampsWidgets import MarkupLabel, BasicLabel
|
from widgets import MarkupLabel, BasicLabel
|
||||||
from QuestionDialog import ErrorDialog, QuestionDialog2
|
from QuestionDialog import ErrorDialog, QuestionDialog2
|
||||||
from Errors import NameDisplayError
|
from Errors import NameDisplayError
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ import gobject
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import Utils
|
import Utils
|
||||||
import GrampsWidgets
|
import widgets
|
||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
from QuestionDialog import OptionDialog
|
from QuestionDialog import OptionDialog
|
||||||
from Selectors import selector_factory
|
from Selectors import selector_factory
|
||||||
@ -398,8 +398,8 @@ class GuiPersonOption(gtk.HBox):
|
|||||||
|
|
||||||
pevt = gtk.EventBox()
|
pevt = gtk.EventBox()
|
||||||
pevt.add(self.__person_label)
|
pevt.add(self.__person_label)
|
||||||
person_button = GrampsWidgets.SimpleButton(gtk.STOCK_INDEX,
|
person_button = widgets.SimpleButton(gtk.STOCK_INDEX,
|
||||||
self.__get_person_clicked)
|
self.__get_person_clicked)
|
||||||
person_button.set_relief(gtk.RELIEF_NORMAL)
|
person_button.set_relief(gtk.RELIEF_NORMAL)
|
||||||
|
|
||||||
self.pack_start(pevt, False)
|
self.pack_start(pevt, False)
|
||||||
@ -489,8 +489,8 @@ class GuiFamilyOption(gtk.HBox):
|
|||||||
|
|
||||||
pevt = gtk.EventBox()
|
pevt = gtk.EventBox()
|
||||||
pevt.add(self.__family_label)
|
pevt.add(self.__family_label)
|
||||||
family_button = GrampsWidgets.SimpleButton(gtk.STOCK_INDEX,
|
family_button = widgets.SimpleButton(gtk.STOCK_INDEX,
|
||||||
self.__get_family_clicked)
|
self.__get_family_clicked)
|
||||||
family_button.set_relief(gtk.RELIEF_NORMAL)
|
family_button.set_relief(gtk.RELIEF_NORMAL)
|
||||||
|
|
||||||
self.pack_start(pevt, False)
|
self.pack_start(pevt, False)
|
||||||
@ -628,8 +628,8 @@ class GuiNoteOption(gtk.HBox):
|
|||||||
|
|
||||||
pevt = gtk.EventBox()
|
pevt = gtk.EventBox()
|
||||||
pevt.add(self.__note_label)
|
pevt.add(self.__note_label)
|
||||||
note_button = GrampsWidgets.SimpleButton(gtk.STOCK_INDEX,
|
note_button = widgets.SimpleButton(gtk.STOCK_INDEX,
|
||||||
self.__get_note_clicked)
|
self.__get_note_clicked)
|
||||||
note_button.set_relief(gtk.RELIEF_NORMAL)
|
note_button.set_relief(gtk.RELIEF_NORMAL)
|
||||||
|
|
||||||
self.pack_start(pevt, False)
|
self.pack_start(pevt, False)
|
||||||
@ -710,8 +710,8 @@ class GuiMediaOption(gtk.HBox):
|
|||||||
|
|
||||||
pevt = gtk.EventBox()
|
pevt = gtk.EventBox()
|
||||||
pevt.add(self.__media_label)
|
pevt.add(self.__media_label)
|
||||||
media_button = GrampsWidgets.SimpleButton(gtk.STOCK_INDEX,
|
media_button = widgets.SimpleButton(gtk.STOCK_INDEX,
|
||||||
self.__get_media_clicked)
|
self.__get_media_clicked)
|
||||||
media_button.set_relief(gtk.RELIEF_NORMAL)
|
media_button.set_relief(gtk.RELIEF_NORMAL)
|
||||||
|
|
||||||
self.pack_start(pevt, False)
|
self.pack_start(pevt, False)
|
||||||
@ -813,9 +813,9 @@ class GuiPersonListOption(gtk.HBox):
|
|||||||
|
|
||||||
# now setup the '+' and '-' pushbutton for adding/removing people from
|
# now setup the '+' and '-' pushbutton for adding/removing people from
|
||||||
# the container
|
# the container
|
||||||
self.__add_person = GrampsWidgets.SimpleButton(gtk.STOCK_ADD,
|
self.__add_person = widgets.SimpleButton(gtk.STOCK_ADD,
|
||||||
self.__add_person_clicked)
|
self.__add_person_clicked)
|
||||||
self.__del_person = GrampsWidgets.SimpleButton(gtk.STOCK_REMOVE,
|
self.__del_person = widgets.SimpleButton(gtk.STOCK_REMOVE,
|
||||||
self.__del_person_clicked)
|
self.__del_person_clicked)
|
||||||
self.__vbbox = gtk.VButtonBox()
|
self.__vbbox = gtk.VButtonBox()
|
||||||
self.__vbbox.add(self.__add_person)
|
self.__vbbox.add(self.__add_person)
|
||||||
@ -948,10 +948,10 @@ class GuiSurnameColourOption(gtk.HBox):
|
|||||||
self.scrolled_window.set_shadow_type(gtk.SHADOW_OUT)
|
self.scrolled_window.set_shadow_type(gtk.SHADOW_OUT)
|
||||||
self.pack_start(self.scrolled_window, expand=True, fill=True)
|
self.pack_start(self.scrolled_window, expand=True, fill=True)
|
||||||
|
|
||||||
self.add_surname = GrampsWidgets.SimpleButton(gtk.STOCK_ADD,
|
self.add_surname = widgets.SimpleButton(gtk.STOCK_ADD,
|
||||||
self.__add_clicked)
|
self.__add_clicked)
|
||||||
self.del_surname = GrampsWidgets.SimpleButton(gtk.STOCK_REMOVE,
|
self.del_surname = widgets.SimpleButton(gtk.STOCK_REMOVE,
|
||||||
self.__del_clicked)
|
self.__del_clicked)
|
||||||
self.vbbox = gtk.VButtonBox()
|
self.vbbox = gtk.VButtonBox()
|
||||||
self.vbbox.add(self.add_surname)
|
self.vbbox.add(self.add_surname)
|
||||||
self.vbbox.add(self.del_surname)
|
self.vbbox.add(self.del_surname)
|
||||||
|
@ -70,7 +70,7 @@ import PageView
|
|||||||
import Navigation
|
import Navigation
|
||||||
import RecentFiles
|
import RecentFiles
|
||||||
from BasicUtils import name_displayer
|
from BasicUtils import name_displayer
|
||||||
import GrampsWidgets
|
import widgets
|
||||||
import UndoHistory
|
import UndoHistory
|
||||||
from DbLoader import DbLoader
|
from DbLoader import DbLoader
|
||||||
import GrampsDisplay
|
import GrampsDisplay
|
||||||
@ -313,10 +313,10 @@ class ViewManager:
|
|||||||
self.progress.set_size_request(100, -1)
|
self.progress.set_size_request(100, -1)
|
||||||
self.progress.hide()
|
self.progress.hide()
|
||||||
|
|
||||||
self.statusbar = GrampsWidgets.Statusbar()
|
self.statusbar = widgets.Statusbar()
|
||||||
self.statusbar.show()
|
self.statusbar.show()
|
||||||
|
|
||||||
self.warnbtn = GrampsWidgets.WarnButton()
|
self.warnbtn = widgets.WarnButton()
|
||||||
|
|
||||||
hbox2 = gtk.HBox()
|
hbox2 = gtk.HBox()
|
||||||
hbox2.set_spacing(4)
|
hbox2.set_spacing(4)
|
||||||
|
@ -48,7 +48,14 @@ class StyledTextTag():
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
def __init__(self, name=None, value=None, ranges=None):
|
def __init__(self, name=None, value=None, ranges=None):
|
||||||
"""Setup initial instance variable values."""
|
"""Setup initial instance variable values.
|
||||||
|
|
||||||
|
@note: Since L{GrampsType} supports the instance initialization
|
||||||
|
with several different base types, please note that C{name} parameter
|
||||||
|
can be int, str, unicode, tuple, or even another L{StyledTextTagType}
|
||||||
|
instance.
|
||||||
|
|
||||||
|
"""
|
||||||
self.name = StyledTextTagType(name)
|
self.name = StyledTextTagType(name)
|
||||||
self.value = value
|
self.value = value
|
||||||
if ranges is None:
|
if ranges is None:
|
||||||
|
@ -45,7 +45,7 @@ from gtk import glade
|
|||||||
import Config
|
import Config
|
||||||
import GrampsCfg
|
import GrampsCfg
|
||||||
import GrampsDisplay
|
import GrampsDisplay
|
||||||
from GrampsWidgets import MonitoredEntry
|
from widgets import MonitoredEntry
|
||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
from PluginUtils import Tool, register_tool
|
from PluginUtils import Tool, register_tool
|
||||||
from TransUtils import sgettext as _
|
from TransUtils import sgettext as _
|
||||||
|
38
src/widgets/__init__.py
Normal file
38
src/widgets/__init__.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#
|
||||||
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
|
#
|
||||||
|
# Copyright (C) 2008 The Gramps Developers
|
||||||
|
#
|
||||||
|
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
"""Custom widgets."""
|
||||||
|
|
||||||
|
from grampswidgets import *
|
||||||
|
from styledtextbuffer import *
|
||||||
|
from styledtexteditor import *
|
||||||
|
|
||||||
|
from gtk.glade import set_custom_handler
|
||||||
|
|
||||||
|
def get_custom_handler(glade, function_name, widget_name,
|
||||||
|
str1, str2, int1, int2):
|
||||||
|
if function_name == 'ValidatableMaskedEntry':
|
||||||
|
return ValidatableMaskedEntry()
|
||||||
|
if function_name == 'StyledTextEditor':
|
||||||
|
return StyledTextEditor()
|
||||||
|
|
||||||
|
set_custom_handler(get_custom_handler)
|
@ -75,15 +75,15 @@ except:
|
|||||||
INFO_ICON = gtk.STOCK_DIALOG_INFO
|
INFO_ICON = gtk.STOCK_DIALOG_INFO
|
||||||
|
|
||||||
# Enabling custom widgets to be included in Glade
|
# Enabling custom widgets to be included in Glade
|
||||||
def get_custom_handler(glade, function_name, widget_name,
|
##def get_custom_handler(glade, function_name, widget_name,
|
||||||
str1, str2, int1, int2):
|
##str1, str2, int1, int2):
|
||||||
from Editors._StyledTextEditor import StyledTextEditor
|
##from Editors._StyledTextEditor import StyledTextEditor
|
||||||
if function_name == 'ValidatableMaskedEntry':
|
##if function_name == 'ValidatableMaskedEntry':
|
||||||
return ValidatableMaskedEntry()
|
##return ValidatableMaskedEntry()
|
||||||
if function_name == 'StyledTextEditor':
|
##if function_name == 'StyledTextEditor':
|
||||||
return StyledTextEditor()
|
##return StyledTextEditor()
|
||||||
|
|
||||||
gtk.glade.set_custom_handler(get_custom_handler)
|
##gtk.glade.set_custom_handler(get_custom_handler)
|
||||||
|
|
||||||
|
|
||||||
hand_cursor = gtk.gdk.Cursor(gtk.gdk.HAND2)
|
hand_cursor = gtk.gdk.Cursor(gtk.gdk.HAND2)
|
@ -47,9 +47,9 @@ from pango import UNDERLINE_SINGLE
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gen.lib import StyledTextTagType
|
from gen.lib import StyledTextTagType
|
||||||
from Editors._StyledTextBuffer import (StyledTextBuffer, ALLOWED_STYLES,
|
from widgets import (StyledTextBuffer, ALLOWED_STYLES,
|
||||||
MATCH_START, MATCH_END,
|
MATCH_START, MATCH_END,
|
||||||
MATCH_FLAVOR, MATCH_STRING)
|
MATCH_FLAVOR, MATCH_STRING)
|
||||||
from Spell import Spell
|
from Spell import Spell
|
||||||
from GrampsDisplay import url as display_url
|
from GrampsDisplay import url as display_url
|
||||||
|
|
Loading…
Reference in New Issue
Block a user