Compare commits
220 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d5b0d2e347 | |||
| d6e1ebf801 | |||
| 236028d808 | |||
| 3c6253d4ff | |||
| ca154e46cd | |||
| d087a88d93 | |||
| 498284b2ba | |||
| 84eb262c26 | |||
| 497cc66a20 | |||
| 9d28157f31 | |||
| 7683470cf3 | |||
| f48d15de5c | |||
| 5704b4d113 | |||
| a35defb35e | |||
| 164db015e9 | |||
| afd0dbf40e | |||
| fca7917515 | |||
| e4a8cc44ae | |||
| 7d93d35994 | |||
| 8a41d0afd9 | |||
| 9a83d2341b | |||
| 776c4b639a | |||
| 545ec06e6d | |||
| debe141034 | |||
| 135e5639e1 | |||
| 9c7c5453b1 | |||
| de34eab12c | |||
| 4b2030d48b | |||
| 52f4f76c82 | |||
| 6a9be24e1c | |||
| 487435d411 | |||
| c6dcfef776 | |||
| 5866b28877 | |||
| e9b643c5d6 | |||
| 4cc6d3f904 | |||
| f18c6c9189 | |||
| aae0360818 | |||
| f649702b1d | |||
| 83c2b7940d | |||
| 3f0475b252 | |||
| 9c1af31a35 | |||
| 431effe789 | |||
| 2bc8f50ac2 | |||
| 5a6e6959de | |||
| 5b5bf3344f | |||
| af15d80cdb | |||
| 613c11b64f | |||
| dec5bb6390 | |||
| fb178130c8 | |||
| 93812faa40 | |||
| 6d990ba147 | |||
| f8316f1794 | |||
| e36d39f208 | |||
| dbc96aad2e | |||
| 990a833d21 | |||
| af25513134 | |||
| 853d2a638d | |||
| a4c22a3b46 | |||
| 963f99536e | |||
| 6844392c3d | |||
| a7bc1ad0f8 | |||
| 01f6e569a7 | |||
| 6d533d4c35 | |||
| 55e41fadf4 | |||
| ee5ee7db3f | |||
| 5fdcc32703 | |||
| b4aa00dac7 | |||
| 834662a823 | |||
| b25211037a | |||
| 35a03d7994 | |||
| 1a7fad0ab1 | |||
| ac84dc2e26 | |||
| e6ddc51d72 | |||
| e6c1c5f689 | |||
| 5a44ced7b1 | |||
| ba9e469215 | |||
| 7cc523ac4e | |||
| f8d54b64bc | |||
| ce3c465ef5 | |||
| 275e9eebfd | |||
| c9cb640f28 | |||
| 3eaa8115c2 | |||
| 285e23303c | |||
| bda858cc5f | |||
| 597e6a150d | |||
| b9c091a72e | |||
| 2732634e98 | |||
| 23f0fae4e3 | |||
| f459fc1ee4 | |||
| 602097c854 | |||
| 75991dd5cd | |||
| c5951cab7c | |||
| 4c4605e744 | |||
| fcab11a0ee | |||
| 28e4707cd1 | |||
| ffe4ea5306 | |||
| 809a810c37 | |||
| d1592c55be | |||
| 14c76f563f | |||
| 7ba22af095 | |||
| fba0650302 | |||
| 4b5383170c | |||
| 9d78dd6613 | |||
| 31e415f442 | |||
| fe54661b54 | |||
| e0570c9d3a | |||
| 615abec162 | |||
| d71ccad5b5 | |||
| 4b694197cf | |||
| 38651e2349 | |||
| bd9393ddbf | |||
| a6ecbce949 | |||
| 690c95b098 | |||
| f89f313836 | |||
| 49d21ff189 | |||
| 0687de05f4 | |||
| 562c14ebb4 | |||
| b135a50fe9 | |||
| 51db87f2c4 | |||
| 6335ba09de | |||
| 0e6b7ed78b | |||
| ac8bfe2732 | |||
| e8835aa513 | |||
| 91cf708449 | |||
| d397a2a64f | |||
| 95e0b720a9 | |||
| 3552b01910 | |||
| 2da9d7e1ab | |||
| 5e7f896e92 | |||
| d47c4534c6 | |||
| 20d1cb0110 | |||
| 8abec7ba25 | |||
| 465c9d1a0b | |||
| 7947af1fb7 | |||
| e291b76c00 | |||
| 2cde7624f5 | |||
| 6eb3c3f9b2 | |||
| 0ebbeb30b8 | |||
| 82500dc151 | |||
| 1f576221d7 | |||
| b7b5045497 | |||
| 37db7366c1 | |||
| 30acde6546 | |||
| 26fed05e64 | |||
| 2554a1decd | |||
| cfa140e165 | |||
| fbc6414670 | |||
| 8cc62188e1 | |||
| 40399556c2 | |||
| 940b2471c4 | |||
| 718b763b6d | |||
| 234994bfaf | |||
| c62229a449 | |||
| f4b5710959 | |||
| 84d1485cec | |||
| 960a62b4c8 | |||
| 94313ae388 | |||
| d43de411bc | |||
| 6d48930121 | |||
| 5bd5a98ba9 | |||
| 26dd3db5bc | |||
| 057c962fe0 | |||
| bd8f5317ba | |||
| 6a6ccadf6a | |||
| 4cd92c86e1 | |||
| 2cfdd5f179 | |||
| 1c41b04d3d | |||
| 57456a3fdf | |||
| 28babdfd20 | |||
| 83177dbe7b | |||
| 5ccc779779 | |||
| 6cd32e4b74 | |||
| f0f32f6122 | |||
| c81b322009 | |||
| d7fcfc6fb1 | |||
| 466bffef30 | |||
| 7272f94206 | |||
| 450991f5c3 | |||
| 76c8eb47cf | |||
| 07218ca4c4 | |||
| 1d1281ae10 | |||
| c207cf819b | |||
| b294f3608b | |||
| 7423eec380 | |||
| 59c14c507c | |||
| 9d055bb444 | |||
| 494311f234 | |||
| 56762c8444 | |||
| 6eb21926ed | |||
| 1de0ef724f | |||
| 6e5f90e580 | |||
| cdaddc3479 | |||
| 641adf57de | |||
| 1e34c037f3 | |||
| 501be49025 | |||
| 94f8838dd6 | |||
| a5f68318db | |||
| 02cd032f72 | |||
| ee565d5d6b | |||
| b09fa93eea | |||
| 48abb86bb8 | |||
| eb337a8d29 | |||
| 52e908a5a1 | |||
| 9e8420aaac | |||
| 72767dce85 | |||
| 385c3c3d9b | |||
| b9e1ba0195 | |||
| f1ded0d689 | |||
| f45b4316b5 | |||
| 49599fa9c3 | |||
| 170336d573 | |||
| 78216846f2 | |||
| b236953ebe | |||
| c4a2e2791d | |||
| 705fbf4007 | |||
| 72838423a0 | |||
| a5970e71bc | |||
| 430124cdc4 | |||
| 4e7b70b2b4 | |||
| 5125046ac1 |
@@ -1,3 +1,12 @@
|
||||
Version 3.1.3 -- the "What name?" release.
|
||||
* contains translation updates, crash fixes, bug fixes, and minor updates.
|
||||
* fixes and updates to:
|
||||
* -> notes, date handler, GEDCOM parser, GEDCOM export, PlaceView,
|
||||
* -> thumbnails, unicode/text truncation, Gramplets, gtk 2.18/Ubuntu 9.10,
|
||||
* -> xml export/import data loss, GeneWeb GEDCOM import, css updates
|
||||
* several MacPorts-specific fixes
|
||||
* several Windows-specific fixes
|
||||
|
||||
Version 3.1.2 -- the "Skip the impersonations" release.
|
||||
* Contains translation updates and small bug fixes. No new features.
|
||||
* ca, cs, de, fr, he, it, nb, nl, pl, pt_br, ru, sk, sv,
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ dnl May need to run automake && aclocal first
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
dnl NOTE: arg to macro below becomes the "VERSION"
|
||||
AC_INIT(gramps, 3.1.2 [gramps-bugs@lists.sourceforge.net])
|
||||
AC_INIT(gramps, 3.1.4, [gramps-bugs@lists.sourceforge.net])
|
||||
AC_CONFIG_SRCDIR(configure.in)
|
||||
AM_INIT_AUTOMAKE([1.6.3 foreign])
|
||||
|
||||
@@ -92,7 +92,7 @@ try:
|
||||
# Do not import gtk.glade, this can raise a RuntimeError if the
|
||||
# display cannot be opened. Just search it.
|
||||
import imp
|
||||
imp.find_module('gtk/glade')
|
||||
imp.find_module('glade',[[imp.find_module('gtk')[1]]])
|
||||
out("gtk.glade")
|
||||
except ImportError:
|
||||
out("NO")
|
||||
|
||||
+834
-825
File diff suppressed because it is too large
Load Diff
+1235
-1172
File diff suppressed because it is too large
Load Diff
+2579
-2545
File diff suppressed because it is too large
Load Diff
+14093
-13388
File diff suppressed because it is too large
Load Diff
@@ -1677,6 +1677,8 @@ class TextDoc(object):
|
||||
is <b>text</b><i><b> here</b> not</i>
|
||||
overwrite this method if this complexity is not needed.
|
||||
"""
|
||||
#unicode text most be sliced correctly
|
||||
text=unicode(text)
|
||||
FIRST = 0
|
||||
LAST = 1
|
||||
tagspos = {}
|
||||
|
||||
@@ -428,6 +428,8 @@ class NoteBookmarks(ListBookmarks) :
|
||||
def make_label(self, handle):
|
||||
obj = self.dbstate.db.get_note_from_handle(handle)
|
||||
name = obj.get().replace('\n', ' ')
|
||||
#String must be unicode for truncation to work for non ascii characters
|
||||
name = unicode(name)
|
||||
if len(name) > 40:
|
||||
name = name[:40]+"..."
|
||||
return ("%s [%s]" % (name, obj.gramps_id), obj)
|
||||
|
||||
@@ -199,13 +199,19 @@ class FamilyListView(PageView.ListView):
|
||||
pass
|
||||
|
||||
def remove(self, obj):
|
||||
self.uistate.set_busy_cursor(1)
|
||||
import gen.utils
|
||||
|
||||
for handle in self.selected_handles():
|
||||
gen.utils.remove_family_relationships(self.dbstate.db, handle)
|
||||
self.build_tree()
|
||||
self.uistate.set_busy_cursor(0)
|
||||
from QuestionDialog import QuestionDialog2
|
||||
from Utils import data_recover_msg
|
||||
msg = _('Deleting item will remove it from the database.')
|
||||
msg = msg + '\n' + data_recover_msg
|
||||
q = QuestionDialog2(_('Delete %s?') % _('family'), msg,
|
||||
_('_Delete Item'), _('Cancel'))
|
||||
if q.run():
|
||||
self.uistate.set_busy_cursor(1)
|
||||
import gen.utils
|
||||
for handle in self.selected_handles():
|
||||
gen.utils.remove_family_relationships(self.dbstate.db, handle)
|
||||
self.build_tree()
|
||||
self.uistate.set_busy_cursor(0)
|
||||
|
||||
def edit(self, obj):
|
||||
for handle in self.selected_handles():
|
||||
|
||||
+518
-399
File diff suppressed because it is too large
Load Diff
@@ -174,8 +174,7 @@ def make_requested_gramplet(viewpage, name, opts, dbstate, uistate):
|
||||
if msg is None:
|
||||
msg = _("Drag Properties Button to move and click it for setup")
|
||||
if msg:
|
||||
gui.tooltips = gtk.Tooltips()
|
||||
gui.tooltips.set_tip(gui.scrolledwindow, msg)
|
||||
gui.scrolledwindow.set_tooltip_text(msg)
|
||||
gui.tooltips_text = msg
|
||||
gui.make_gui_options()
|
||||
gui.gvoptions.hide()
|
||||
@@ -585,8 +584,7 @@ class Gramplet(object):
|
||||
"""
|
||||
from PluginUtils import make_gui_option
|
||||
#tooltips, dbstate, uistate, track
|
||||
widget, label = make_gui_option(option, None, self.dbstate,
|
||||
self.uistate,None)
|
||||
widget, label = make_gui_option(option, self.dbstate, self.uistate,None)
|
||||
self.option_dict.update({option.get_label(): (widget, option)})
|
||||
self.option_order.append(option.get_label())
|
||||
|
||||
@@ -949,13 +947,10 @@ class GuiGramplet(object):
|
||||
else:
|
||||
tag.set_property('underline', pango.UNDERLINE_NONE)
|
||||
view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(cursor)
|
||||
if self.tooltips:
|
||||
if ttip:
|
||||
self.tooltips.set_tip(self.scrolledwindow,
|
||||
ttip)
|
||||
else:
|
||||
self.tooltips.set_tip(self.scrolledwindow,
|
||||
self.tooltips_text)
|
||||
if ttip:
|
||||
self.scrolledwindow.set_tooltip_text(ttip)
|
||||
elif self.tooltips_text:
|
||||
self.scrolledwindow.set_tooltip_text(self.tooltips_text)
|
||||
return False # handle event further, if necessary
|
||||
|
||||
def on_button_press(self, view, event):
|
||||
@@ -1101,8 +1096,7 @@ class GrampletView(PageView.PersonNavView):
|
||||
# build the GUI:
|
||||
frame = MyScrolledWindow()
|
||||
msg = _("Right click to add gramplets")
|
||||
self.tooltips = gtk.Tooltips()
|
||||
self.tooltips.set_tip(frame, msg)
|
||||
frame.set_tooltip_text(msg)
|
||||
frame.viewpage = self
|
||||
frame.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
||||
self.hbox = gtk.HBox(homogeneous=True)
|
||||
|
||||
@@ -275,13 +275,11 @@ class MediaView(PageView.ListView):
|
||||
ebox = gtk.EventBox()
|
||||
ebox.add(self.image)
|
||||
ebox.connect('button-press-event', self.button_press_event)
|
||||
ebox.set_tooltip_text(
|
||||
_('Double click image to view in an external viewer'))
|
||||
vbox.pack_start(ebox, False)
|
||||
vbox.pack_start(base, True)
|
||||
|
||||
self.ttips = gtk.Tooltips()
|
||||
self.ttips.set_tip(
|
||||
ebox, _('Double click image to view in an external viewer'))
|
||||
|
||||
self.selection.connect('changed', self.row_change)
|
||||
self._set_dnd()
|
||||
return vbox
|
||||
@@ -314,13 +312,11 @@ class MediaView(PageView.ListView):
|
||||
handle = self.first_selected()
|
||||
if not handle:
|
||||
self.image.clear()
|
||||
self.ttips.disable()
|
||||
else:
|
||||
obj = self.dbstate.db.get_object_from_handle(handle)
|
||||
pix = ThumbNails.get_thumbnail_image(
|
||||
Utils.media_path_full(self.dbstate.db, obj.get_path()))
|
||||
self.image.set_from_pixbuf(pix)
|
||||
self.ttips.enable()
|
||||
|
||||
def ui_definition(self):
|
||||
"""
|
||||
|
||||
@@ -367,7 +367,9 @@ class FormattingHelper(object):
|
||||
text = ""
|
||||
for event_ref in family.get_event_ref_list():
|
||||
event = self.dbstate.db.get_event_from_handle(event_ref.ref)
|
||||
if event and event.get_type() == gen.lib.EventType.MARRIAGE:
|
||||
if event and event.get_type() == gen.lib.EventType.MARRIAGE and \
|
||||
(event_ref.get_role() == gen.lib.EventRoleType.FAMILY or
|
||||
event_ref.get_role() == gen.lib.EventRoleType.PRIMARY ):
|
||||
if line_count < 3:
|
||||
return DateHandler.get_date(event)
|
||||
name = str(event.get_type())
|
||||
@@ -527,8 +529,6 @@ class PedigreeView(PageView.PersonNavView):
|
||||
contains the interface. This containter will be inserted into
|
||||
a gtk.Notebook page.
|
||||
"""
|
||||
self.tooltips = gtk.Tooltips()
|
||||
self.tooltips.enable()
|
||||
|
||||
self.notebook = gtk.Notebook()
|
||||
self.notebook.connect("button-press-event", self.bg_button_press_cb)
|
||||
@@ -747,7 +747,8 @@ class PedigreeView(PageView.PersonNavView):
|
||||
((8,26,3,1),None,None),
|
||||
((8,28,3,1),None,None),
|
||||
((8,30,3,1),None,None),)
|
||||
elif self.tree_style == 0:
|
||||
else:
|
||||
#elif self.tree_style == 0:
|
||||
pos_2 =(((0,0,1,3),(1,0,3),(2,1,1,1)),
|
||||
((2,0,1,1),None,None),
|
||||
((2,2,1,1),None,None))
|
||||
@@ -876,7 +877,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
else:
|
||||
pw = PersonBoxWidget( self, self.format_helper, lst[i][0], lst[i][3], positions[i][0][3], image);
|
||||
if positions[i][0][3] < 7:
|
||||
self.tooltips.set_tip(pw, self.format_helper.format_person(lst[i][0], 11))
|
||||
pw.set_tooltip_text(self.format_helper.format_person(lst[i][0], 11))
|
||||
|
||||
pw.connect("button-press-event", self.person_button_press_cb,lst[i][0].get_handle())
|
||||
if positions[i][0][2] > 1:
|
||||
@@ -944,7 +945,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
if lst[i] and lst[i][2]:
|
||||
line.add_events(gtk.gdk.ENTER_NOTIFY_MASK) # Required for tooltip and mouse-over
|
||||
line.add_events(gtk.gdk.LEAVE_NOTIFY_MASK) # Required for tooltip and mouse-over
|
||||
self.tooltips.set_tip(line, self.format_helper.format_relation(lst[i][2], 11))
|
||||
line.set_tooltip_text(self.format_helper.format_relation(lst[i][2], 11))
|
||||
if lst[i*2+1]:
|
||||
line.set_data("frela", lst[i*2+1][1])
|
||||
if lst[i*2+2]:
|
||||
@@ -978,7 +979,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
childlist = find_children(self.dbstate.db,lst[0][0])
|
||||
if childlist:
|
||||
l.connect("clicked",self.on_show_child_menu)
|
||||
self.tooltips.set_tip(l, _("Jump to child..."))
|
||||
l.set_tooltip_text(_("Jump to child..."))
|
||||
else:
|
||||
l.set_sensitive(False)
|
||||
ymid = int(math.floor(ymax/2))
|
||||
@@ -987,7 +988,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
l.add(gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_IN))
|
||||
if lst[1]:
|
||||
l.connect("clicked",self.on_childmenu_changed,lst[1][0].handle)
|
||||
self.tooltips.set_tip(l, _("Jump to father"))
|
||||
l.set_tooltip_text(("Jump to father"))
|
||||
else:
|
||||
l.set_sensitive(False)
|
||||
ymid = int(math.floor(ymax/4))
|
||||
@@ -996,7 +997,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
l.add(gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_IN))
|
||||
if lst[2]:
|
||||
l.connect("clicked",self.on_childmenu_changed,lst[2][0].handle)
|
||||
self.tooltips.set_tip(l, _("Jump to mother"))
|
||||
l.set_tooltip_text(("Jump to mother"))
|
||||
else:
|
||||
l.set_sensitive(False)
|
||||
ymid = int(math.floor(ymax/4*3))
|
||||
|
||||
@@ -31,6 +31,7 @@ PersonView interface.
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
import cPickle as pickle
|
||||
import time
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -41,6 +42,14 @@ import gtk
|
||||
import pango
|
||||
from gtk.gdk import ACTION_COPY, BUTTON1_MASK
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# set up logging
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import logging
|
||||
_LOG = logging.getLogger(".gui.personview")
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# GRAMPS modules
|
||||
@@ -518,6 +527,7 @@ class PersonView(PageView.PersonNavView):
|
||||
since it can change when rows are unselected when the model is set.
|
||||
"""
|
||||
if self.active:
|
||||
cput = time.clock()
|
||||
if Config.get(Config.FILTER):
|
||||
filter_info = (PeopleModel.GENERIC, self.generic_filter)
|
||||
else:
|
||||
@@ -525,7 +535,9 @@ class PersonView(PageView.PersonNavView):
|
||||
|
||||
self.model = PeopleModel(self.dbstate.db, filter_info, skip)
|
||||
active = self.dbstate.active
|
||||
cput1 = time.clock()
|
||||
self.tree.set_model(self.model)
|
||||
cput2 = time.clock()
|
||||
|
||||
if const.USE_TIPS and self.model.tooltip_column is not None:
|
||||
self.tooltips = TreeTips.TreeTips(self.tree,
|
||||
@@ -539,6 +551,9 @@ class PersonView(PageView.PersonNavView):
|
||||
self.uistate.show_filter_results(self.dbstate,
|
||||
self.model.displayed,
|
||||
self.model.total)
|
||||
_LOG.debug(self.__class__.__name__ + ' build_tree ' +
|
||||
str(time.clock() - cput) + ' sec')
|
||||
_LOG.debug(' setting model ' + str(cput2 - cput1) + ' sec')
|
||||
else:
|
||||
self.dirty = True
|
||||
|
||||
@@ -710,6 +725,7 @@ class PersonView(PageView.PersonNavView):
|
||||
if not self.model:
|
||||
return
|
||||
if self.active:
|
||||
cput = time.clock()
|
||||
self.dirty = False
|
||||
for node in set(handle_list):
|
||||
person = self.dbstate.db.get_person_from_handle(node)
|
||||
@@ -729,6 +745,8 @@ class PersonView(PageView.PersonNavView):
|
||||
path = self.model.on_get_path(node)
|
||||
pnode = self.model.get_iter(path)
|
||||
self.model.row_inserted(path, pnode)
|
||||
_LOG.debug(self.__class__.__name__ + ' person_added ' +
|
||||
str(time.clock() - cput) + ' sec')
|
||||
else:
|
||||
self.dirty = True
|
||||
|
||||
@@ -745,6 +763,7 @@ class PersonView(PageView.PersonNavView):
|
||||
if not self.model:
|
||||
return
|
||||
|
||||
cput = time.clock()
|
||||
expand = []
|
||||
self.tree.map_expanded_rows(self.func, expand)
|
||||
|
||||
@@ -753,11 +772,14 @@ class PersonView(PageView.PersonNavView):
|
||||
path = self.model.mapper.top_iter2path.get(i)
|
||||
if path:
|
||||
self.tree.expand_row(path, False)
|
||||
_LOG.debug(self.__class__.__name__ + ' person_removed ' +
|
||||
str(time.clock() - cput) + ' sec')
|
||||
|
||||
def person_updated(self, handle_list):
|
||||
if not self.model:
|
||||
return
|
||||
|
||||
cput = time.clock()
|
||||
self.model.clear_cache()
|
||||
for node in handle_list:
|
||||
person = self.dbstate.db.get_person_from_handle(node)
|
||||
@@ -796,6 +818,8 @@ class PersonView(PageView.PersonNavView):
|
||||
break
|
||||
|
||||
self.goto_active_person()
|
||||
_LOG.debug(self.__class__.__name__ + ' person_updated ' +
|
||||
str(time.clock() - cput) + ' sec')
|
||||
|
||||
def get_selected_objects(self):
|
||||
(mode, paths) = self.selection.get_selected_rows()
|
||||
|
||||
@@ -173,15 +173,11 @@ class PlaceView(PageView.ListView):
|
||||
widget.set_menu(mmenu)
|
||||
if gtk.pygtk_version >= (2, 12, 0):
|
||||
widget.set_arrow_tooltip_text(actionservices.arrowtooltip)
|
||||
hbox=gtk.HBox()
|
||||
img = gtk.Image()
|
||||
img.set_from_stock(gtk.STOCK_JUMP_TO,
|
||||
gtk.ICON_SIZE_LARGE_TOOLBAR)
|
||||
hbox.pack_start(img)
|
||||
self.mapslistlabel.append(gtk.Label(self.mapservice_label()))
|
||||
hbox.pack_start(self.mapslistlabel[-1])
|
||||
hbox.show_all()
|
||||
widget.set_icon_widget(hbox)
|
||||
lbl = gtk.Label(self.mapservice_label())
|
||||
lbl.show()
|
||||
self.mapslistlabel.append(lbl)
|
||||
widget.set_label_widget(self.mapslistlabel[-1])
|
||||
widget.set_stock_id(gtk.STOCK_JUMP_TO)
|
||||
|
||||
def __create_maps_menu_actions(self):
|
||||
"""
|
||||
@@ -223,6 +219,13 @@ class PlaceView(PageView.ListView):
|
||||
"""
|
||||
Run the map service
|
||||
"""
|
||||
#First test if any map service is available
|
||||
if not len(self.mapservicedata):
|
||||
msg = _("No map service is available.")
|
||||
msg2 = _("Check your installation.")
|
||||
ErrorDialog(msg, msg2)
|
||||
return
|
||||
|
||||
place_handles = self.selected_handles()
|
||||
try:
|
||||
place_handle = self.selected_handles()[0]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2001-2007 Donald N. Allingham
|
||||
# Copyright (C) 2009 Gary Burton
|
||||
#
|
||||
# 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
|
||||
@@ -91,6 +92,7 @@ _SDATA_START = 2
|
||||
_SDATA_STOP = 4
|
||||
_RETURN = gtk.gdk.keyval_from_name("Return")
|
||||
_KP_ENTER = gtk.gdk.keyval_from_name("KP_Enter")
|
||||
_SPACE = gtk.gdk.keyval_from_name("space")
|
||||
_LEFT_BUTTON = 1
|
||||
_RIGHT_BUTTON = 3
|
||||
|
||||
@@ -130,6 +132,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
|
||||
self.color = gtk.TextView().style.white
|
||||
self.child = None
|
||||
self.old_handle = None
|
||||
|
||||
Config.client.notify_add("/apps/gramps/preferences/relation-shade",
|
||||
self.shade_update)
|
||||
@@ -417,12 +420,19 @@ class RelationshipView(PageView.PersonNavView):
|
||||
return True
|
||||
|
||||
def _change_person(self, obj):
|
||||
if obj == self.old_handle:
|
||||
#same object, keep present scroll position
|
||||
old_vadjust = self.scroll.get_vadjustment().value
|
||||
self.old_handle = obj
|
||||
else:
|
||||
#different object, scroll to top
|
||||
old_vadjust = self.scroll.get_vadjustment().lower
|
||||
self.old_handle = obj
|
||||
self.scroll.get_vadjustment().value = \
|
||||
self.scroll.get_vadjustment().lower
|
||||
if self.redrawing:
|
||||
return False
|
||||
self.redrawing = True
|
||||
self.tooltips = gtk.Tooltips()
|
||||
|
||||
for old_child in self.vbox.get_children():
|
||||
self.vbox.remove(old_child)
|
||||
@@ -503,6 +513,8 @@ class RelationshipView(PageView.PersonNavView):
|
||||
self.child.show_all()
|
||||
|
||||
self.vbox.pack_start(self.child, False)
|
||||
#reset scroll position as it was before
|
||||
self.scroll.get_vadjustment().value = old_vadjust
|
||||
self.redrawing = False
|
||||
self.uistate.modify_statusbar(self.dbstate)
|
||||
|
||||
@@ -528,7 +540,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
if Config.get(Config.RELEDITBTN):
|
||||
button = widgets.IconButton(self.edit_button_press,
|
||||
person.handle)
|
||||
self.tooltips.set_tip(button, _('Edit %s') % name)
|
||||
button.set_tooltip_text(_('Edit %s') % name)
|
||||
else:
|
||||
button = None
|
||||
hbox = widgets.LinkBox(label, button)
|
||||
@@ -747,28 +759,28 @@ class RelationshipView(PageView.PersonNavView):
|
||||
if self.reorder_sensitive:
|
||||
add = widgets.IconButton(self.reorder_button_press, None,
|
||||
gtk.STOCK_SORT_ASCENDING)
|
||||
self.tooltips.set_tip(add, ord_msg)
|
||||
add.set_tooltip_text(ord_msg)
|
||||
hbox.pack_start(add, False)
|
||||
|
||||
add = widgets.IconButton(call_fcn, None, gtk.STOCK_ADD)
|
||||
self.tooltips.set_tip(add, add_msg)
|
||||
add.set_tooltip_text(add_msg)
|
||||
hbox.pack_start(add, False)
|
||||
|
||||
if is_parent:
|
||||
add = widgets.IconButton(self.select_family, None,
|
||||
gtk.STOCK_INDEX)
|
||||
self.tooltips.set_tip(add, sel_msg)
|
||||
add.set_tooltip_text(sel_msg)
|
||||
hbox.pack_start(add, False)
|
||||
|
||||
if family:
|
||||
edit = widgets.IconButton(self.edit_family, family.handle,
|
||||
gtk.STOCK_EDIT)
|
||||
self.tooltips.set_tip(edit, edit_msg)
|
||||
edit.set_tooltip_text(edit_msg)
|
||||
hbox.pack_start(edit, False)
|
||||
if not self.dbstate.db.readonly:
|
||||
delete = widgets.IconButton(del_fcn, family.handle,
|
||||
gtk.STOCK_REMOVE)
|
||||
self.tooltips.set_tip(delete, del_msg)
|
||||
delete.set_tooltip_text(del_msg)
|
||||
hbox.pack_start(delete, False)
|
||||
self.attach.attach(hbox, _BTN_START, _BTN_STOP, self.row, self.row+1)
|
||||
self.row += 1
|
||||
@@ -873,13 +885,11 @@ class RelationshipView(PageView.PersonNavView):
|
||||
addchild = widgets.IconButton(self.add_child_to_fam,
|
||||
family.handle,
|
||||
gtk.STOCK_ADD)
|
||||
self.tooltips.set_tip(addchild,
|
||||
_('Add new child to family'))
|
||||
addchild.set_tooltip_text(_('Add new child to family'))
|
||||
selchild = widgets.IconButton(self.sel_child_to_fam,
|
||||
family.handle,
|
||||
gtk.STOCK_INDEX)
|
||||
self.tooltips.set_tip(selchild,
|
||||
_('Add existing child to family'))
|
||||
selchild.set_tooltip_text(_('Add existing child to family'))
|
||||
hbox.pack_start(addchild, False)
|
||||
hbox.pack_start(selchild, False)
|
||||
|
||||
@@ -923,7 +933,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
if Config.get(Config.RELEDITBTN):
|
||||
button = widgets.IconButton(self.edit_button_press,
|
||||
handle)
|
||||
self.tooltips.set_tip(button, _('Edit %s') % name[0])
|
||||
button.set_tooltip_text(('Edit %s') % name[0])
|
||||
else:
|
||||
button = None
|
||||
vbox.pack_start(widgets.LinkBox(link_label, button),
|
||||
@@ -976,7 +986,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
link_label.modify_bg(gtk.STATE_NORMAL, self.color)
|
||||
if Config.get(Config.RELEDITBTN):
|
||||
button = widgets.IconButton(self.edit_button_press, handle)
|
||||
self.tooltips.set_tip(button, _('Edit %s') % name[0])
|
||||
button.set_tooltip_text(_('Edit %s') % name[0])
|
||||
else:
|
||||
button = None
|
||||
vbox.pack_start(widgets.LinkBox(link_label, button))
|
||||
@@ -1063,7 +1073,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
link_label.set_padding(3, 0)
|
||||
if child_should_be_linked and Config.get(Config.RELEDITBTN):
|
||||
button = widgets.IconButton(self.edit_button_press, handle)
|
||||
self.tooltips.set_tip(button, _('Edit %s') % name[0])
|
||||
button.set_tooltip_text(_('Edit %s') % name[0])
|
||||
else:
|
||||
button = None
|
||||
|
||||
@@ -1094,7 +1104,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
return None
|
||||
|
||||
birth = ReportUtils.get_birth_or_fallback(self.dbstate.db, person)
|
||||
if birth and birth.get_type != gen.lib.EventType.BIRTH:
|
||||
if birth and birth.get_type() != gen.lib.EventType.BIRTH:
|
||||
sdate = DateHandler.get_date(birth)
|
||||
if sdate:
|
||||
bdate = "<i>%s</i>" % cgi.escape(sdate)
|
||||
@@ -1106,7 +1116,7 @@ class RelationshipView(PageView.PersonNavView):
|
||||
bdate = ""
|
||||
|
||||
death = ReportUtils.get_death_or_fallback(self.dbstate.db, person)
|
||||
if death and death.get_type != gen.lib.EventType.DEATH:
|
||||
if death and death.get_type() != gen.lib.EventType.DEATH:
|
||||
sdate = DateHandler.get_date(death)
|
||||
if sdate:
|
||||
ddate = "<i>%s</i>" % cgi.escape(sdate)
|
||||
@@ -1199,7 +1209,9 @@ class RelationshipView(PageView.PersonNavView):
|
||||
for event_ref in family.get_event_ref_list():
|
||||
handle = event_ref.ref
|
||||
event = self.dbstate.db.get_event_from_handle(handle)
|
||||
if event.get_type() == gen.lib.EventType.MARRIAGE:
|
||||
if event and event.get_type() == gen.lib.EventType.MARRIAGE and \
|
||||
(event_ref.get_role() == gen.lib.EventRoleType.FAMILY or
|
||||
event_ref.get_role() == gen.lib.EventRoleType.PRIMARY ):
|
||||
self.write_event_ref(vbox, _('Marriage'), event)
|
||||
value = True
|
||||
return value
|
||||
@@ -1331,13 +1343,11 @@ class RelationshipView(PageView.PersonNavView):
|
||||
addchild = widgets.IconButton(self.add_child_to_fam,
|
||||
family.handle,
|
||||
gtk.STOCK_ADD)
|
||||
self.tooltips.set_tip(addchild,
|
||||
_('Add new child to family'))
|
||||
addchild.set_tooltip_text(_('Add new child to family'))
|
||||
selchild = widgets.IconButton(self.sel_child_to_fam,
|
||||
family.handle,
|
||||
gtk.STOCK_INDEX)
|
||||
self.tooltips.set_tip(selchild,
|
||||
_('Add existing child to family'))
|
||||
selchild.set_tooltip_text(_('Add existing child to family'))
|
||||
hbox.pack_start(addchild, False)
|
||||
hbox.pack_start(selchild, False)
|
||||
self.attach.attach(
|
||||
@@ -1594,7 +1604,7 @@ def button_activated(event, mouse_button):
|
||||
if (event.type == gtk.gdk.BUTTON_PRESS and \
|
||||
event.button == mouse_button) or \
|
||||
(event.type == gtk.gdk.KEY_PRESS and \
|
||||
event.keyval in (_RETURN, _KP_ENTER)):
|
||||
event.keyval in (_RETURN, _KP_ENTER, _SPACE)):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
@@ -9,19 +9,20 @@ pkgdata_PYTHON = \
|
||||
_Date_ca.py\
|
||||
_Date_cs.py\
|
||||
_Date_de.py\
|
||||
_Date_ru.py\
|
||||
_Date_lt.py\
|
||||
_Date_fr.py\
|
||||
_Date_es.py\
|
||||
_Date_fi.py\
|
||||
_Date_sv.py\
|
||||
_Date_nb.py\
|
||||
_Date_nl.py\
|
||||
_Date_sk.py\
|
||||
_Date_pl.py\
|
||||
_Date_pt.py\
|
||||
_Date_fr.py\
|
||||
_Date_hr.py\
|
||||
_Date_it.py\
|
||||
_Date_lt.py\
|
||||
_Date_nb.py\
|
||||
_Date_nl.py\
|
||||
_Date_pl.py\
|
||||
_Date_pt.py\
|
||||
_Date_ru.py\
|
||||
_Date_sk.py\
|
||||
_Date_sr.py\
|
||||
_Date_sv.py\
|
||||
_DateDisplay.py\
|
||||
_DateParser.py\
|
||||
_DateHandler.py\
|
||||
|
||||
@@ -69,7 +69,7 @@ class DateParserCZ(DateParser):
|
||||
u'r' : Date.CAL_FRENCH,
|
||||
u'perský' : Date.CAL_PERSIAN,
|
||||
u'p' : Date.CAL_PERSIAN,
|
||||
u'swedish' : Date.CAL_SWEDISH,
|
||||
u'švédský' : Date.CAL_SWEDISH,
|
||||
u's' : Date.CAL_SWEDISH,
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ class DateDisplayCZ(DateDisplay):
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d1 = self.display_cal[cal](start)
|
||||
d2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'medzi',
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'mezi',
|
||||
d1, u'a', d2, self.calendar[cal])
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
|
||||
@@ -58,8 +58,8 @@ class DateParserFR(DateParser):
|
||||
|
||||
# Add common value
|
||||
|
||||
month_to_int[u"bluviose"] = 1
|
||||
month_to_int[u"vendose"] = 2
|
||||
month_to_int[u"bluviose"] = 5
|
||||
month_to_int[u"vendose"] = 6
|
||||
month_to_int[u"7bre"] = 9
|
||||
month_to_int[u"8bre"] = 10
|
||||
month_to_int[u"9bre"] = 11
|
||||
|
||||
@@ -180,7 +180,7 @@ class DateParserHR(DateParser):
|
||||
"""
|
||||
DateParser.init_strings(self)
|
||||
# match 'Day. MONTH year.' format with or without dots
|
||||
self._text2 = re.compile('(\d+)?\.?\s+?%s\.?\s*((\d+)(/\d+)?)?\s*\.?$'
|
||||
self._text2 = re.compile('(\d+)?\.?\s*?%s\.?\s*((\d+)(/\d+)?)?\s*\.?$'
|
||||
% self._mon_str, re.IGNORECASE)
|
||||
# match Day.Month.Year.
|
||||
self._numeric = re.compile(
|
||||
|
||||
@@ -0,0 +1,393 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2004-2007 Donald N. Allingham
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
# Serbian version by Vlada Perić <vlada.peric@gmail.com>, 2009.
|
||||
# Based on the Croatian DateHandler by Josip
|
||||
|
||||
"""
|
||||
Serbian-specific classes for parsing and displaying dates.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Python modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import re
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.lib import Date
|
||||
from _DateParser import DateParser
|
||||
from _DateDisplay import DateDisplay
|
||||
from _DateHandler import register_datehandler
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Serbian parser
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class DateParserSR(DateParser):
|
||||
"""
|
||||
Converts a text string into a Date object
|
||||
"""
|
||||
month_to_int = DateParser.month_to_int
|
||||
|
||||
month_to_int[u"januar"] = 1
|
||||
month_to_int[u"januara"] = 1
|
||||
month_to_int[u"jan"] = 1
|
||||
month_to_int[u"јан"] = 1
|
||||
month_to_int[u"јануара"] = 1
|
||||
month_to_int[u"јануар"] = 1
|
||||
month_to_int[u"i"] = 1
|
||||
|
||||
month_to_int[u"februar"] = 2
|
||||
month_to_int[u"februara"] = 2
|
||||
month_to_int[u"feb"] = 2
|
||||
month_to_int[u"феб"] = 2
|
||||
month_to_int[u"фебруар"] = 2
|
||||
month_to_int[u"фебруара"] = 2
|
||||
month_to_int[u"ii"] = 2
|
||||
|
||||
month_to_int[u"mart"] = 3
|
||||
month_to_int[u"marta"] = 3
|
||||
month_to_int[u"mar"] = 3
|
||||
month_to_int[u"мар"] = 3
|
||||
month_to_int[u"март"] = 3
|
||||
month_to_int[u"марта"] = 3
|
||||
month_to_int[u"iii"] = 3
|
||||
|
||||
month_to_int[u"april"] = 4
|
||||
month_to_int[u"aprila"] = 4
|
||||
month_to_int[u"apr"] = 4
|
||||
month_to_int[u"апр"] = 4
|
||||
month_to_int[u"април"] = 4
|
||||
month_to_int[u"априла"] = 4
|
||||
month_to_int[u"iv"] = 4
|
||||
|
||||
month_to_int[u"maj"] = 5
|
||||
month_to_int[u"maja"] = 5
|
||||
month_to_int[u"мај"] = 5
|
||||
month_to_int[u"маја"] = 5
|
||||
month_to_int[u"v"] = 5
|
||||
|
||||
month_to_int[u"jun"] = 6
|
||||
month_to_int[u"juna"] = 6
|
||||
month_to_int[u"јун"] = 6
|
||||
month_to_int[u"јуна"] = 6
|
||||
month_to_int[u"vi"] = 6
|
||||
|
||||
month_to_int[u"jul"] = 7
|
||||
month_to_int[u"jula"] = 7
|
||||
month_to_int[u"јул"] = 7
|
||||
month_to_int[u"јула"] = 7
|
||||
month_to_int[u"vii"] = 7
|
||||
|
||||
month_to_int[u"avgust"] = 8
|
||||
month_to_int[u"avgusta"] = 8
|
||||
month_to_int[u"avg"] = 8
|
||||
month_to_int[u"авг"] = 8
|
||||
month_to_int[u"август"] = 8
|
||||
month_to_int[u"августа"] = 8
|
||||
month_to_int[u"viii"] = 8
|
||||
|
||||
month_to_int[u"septembar"] = 9
|
||||
month_to_int[u"septembra"] = 9
|
||||
month_to_int[u"sep"] = 9
|
||||
month_to_int[u"сеп"] = 9
|
||||
month_to_int[u"септембар"] = 9
|
||||
month_to_int[u"септембра"] = 9
|
||||
month_to_int[u"ix"] = 9
|
||||
|
||||
month_to_int[u"oktobar"] = 10
|
||||
month_to_int[u"oktobra"] = 10
|
||||
month_to_int[u"okt"] = 10
|
||||
month_to_int[u"окт"] = 10
|
||||
month_to_int[u"октобар"] = 10
|
||||
month_to_int[u"октобра"] = 10
|
||||
month_to_int[u"x"] = 10
|
||||
|
||||
month_to_int[u"novembar"] = 11
|
||||
month_to_int[u"novembra"] = 11
|
||||
month_to_int[u"nov"] = 11
|
||||
month_to_int[u"нов"] = 11
|
||||
month_to_int[u"новембар"] = 11
|
||||
month_to_int[u"новембра"] = 11
|
||||
month_to_int[u"xi"] = 11
|
||||
|
||||
month_to_int[u"decembar"] = 12
|
||||
month_to_int[u"decembra"] = 12
|
||||
month_to_int[u"dec"] = 12
|
||||
month_to_int[u"дец"] = 12
|
||||
month_to_int[u"децембар"] = 12
|
||||
month_to_int[u"децембра"] = 12
|
||||
month_to_int[u"xii"] = 12
|
||||
|
||||
modifier_to_int = {
|
||||
u'pre' : Date.MOD_BEFORE,
|
||||
u'posle' : Date.MOD_AFTER,
|
||||
u'oko' : Date.MOD_ABOUT,
|
||||
u'cca' : Date.MOD_ABOUT,
|
||||
|
||||
u'пре' : Date.MOD_BEFORE,
|
||||
u'после' : Date.MOD_AFTER,
|
||||
u'око' : Date.MOD_ABOUT,
|
||||
}
|
||||
|
||||
calendar_to_int = {
|
||||
u'gregorijanski' : Date.CAL_GREGORIAN,
|
||||
u'greg.' : Date.CAL_GREGORIAN,
|
||||
u'julijanski' : Date.CAL_JULIAN,
|
||||
u'jul.' : Date.CAL_JULIAN,
|
||||
u'hebrejski' : Date.CAL_HEBREW,
|
||||
u'hebr.' : Date.CAL_HEBREW,
|
||||
u'islamski' : Date.CAL_ISLAMIC,
|
||||
u'isl.' : Date.CAL_ISLAMIC,
|
||||
u'francuski republikanski': Date.CAL_FRENCH,
|
||||
u'franc.' : Date.CAL_FRENCH,
|
||||
u'persijski' : Date.CAL_PERSIAN,
|
||||
u'pers. ' : Date.CAL_PERSIAN,
|
||||
u'švedski' : Date.CAL_SWEDISH,
|
||||
u'šv.' : Date.CAL_SWEDISH,
|
||||
|
||||
u'грегоријански' : Date.CAL_GREGORIAN,
|
||||
u'грег.' : Date.CAL_GREGORIAN,
|
||||
u'јулијански' : Date.CAL_JULIAN,
|
||||
u'јул.' : Date.CAL_JULIAN,
|
||||
u'хебрејски' : Date.CAL_HEBREW,
|
||||
u'хебр.' : Date.CAL_HEBREW,
|
||||
u'исламски' : Date.CAL_ISLAMIC,
|
||||
u'исл.' : Date.CAL_ISLAMIC,
|
||||
u'француски републикански': Date.CAL_FRENCH,
|
||||
u'франц.' : Date.CAL_FRENCH,
|
||||
u'персијски' : Date.CAL_PERSIAN,
|
||||
u'перс. ' : Date.CAL_PERSIAN,
|
||||
u'шведски' : Date.CAL_SWEDISH,
|
||||
u'шв' : Date.CAL_SWEDISH,
|
||||
}
|
||||
|
||||
quality_to_int = {
|
||||
u'procenjeno' : Date.QUAL_ESTIMATED,
|
||||
u'pro.' : Date.QUAL_ESTIMATED,
|
||||
u'izračunato' : Date.QUAL_CALCULATED,
|
||||
u'izr.' : Date.QUAL_CALCULATED,
|
||||
|
||||
u'процењено' : Date.QUAL_ESTIMATED,
|
||||
u'про.' : Date.QUAL_ESTIMATED,
|
||||
u'израчунато' : Date.QUAL_CALCULATED,
|
||||
u'изр.' : Date.QUAL_CALCULATED,
|
||||
}
|
||||
|
||||
bce = [u"пре нове ере", u"пре Христа", u"п.н.е."
|
||||
u"pre nove ere", u"pre Hrista", u"p.n.e."] + DateParser.bce
|
||||
|
||||
def init_strings(self):
|
||||
"""
|
||||
compiles regular expression strings for matching dates
|
||||
"""
|
||||
DateParser.init_strings(self)
|
||||
# match 'Day. MONTH year.' format with or without dots
|
||||
self._text2 = re.compile('(\d+)?\.?\s*?%s\s*((\d+)(/\d+)?)?\.?\s*$'
|
||||
% self._mon_str, re.IGNORECASE)
|
||||
|
||||
# match Day.Month.Year.
|
||||
self._numeric = re.compile("((\d+)[/\. ])?\s*((\d+)[/\.])?\s*(\d+)\.?$")
|
||||
|
||||
_span1 = [u'od', u'од']
|
||||
_span2 = [u'do', u'до']
|
||||
_range1 = [u'između', u'између']
|
||||
_range2 = [u'i', u'и']
|
||||
self._span = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
|
||||
('|'.join(_span1),'|'.join(_span2)),
|
||||
re.IGNORECASE)
|
||||
self._range = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
|
||||
('|'.join(_range1),'|'.join(_range2)),
|
||||
re.IGNORECASE)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Serbian display
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class DateDisplaySR_latin(DateDisplay):
|
||||
"""
|
||||
Serbian (latin) date display class
|
||||
"""
|
||||
calendar = (
|
||||
"", u" (julijanski)", u" (hebrejski)",
|
||||
u" (francuski republikanski)", u" (persijski)", u" (islamski)",
|
||||
u" (švedski)"
|
||||
)
|
||||
|
||||
_mod_str = ("", "pre ", "posle ", "oko ", "", "", "")
|
||||
|
||||
_qual_str = ("", "procenjeno ", "izračunato ")
|
||||
|
||||
_bce_str = "%s p.n.e."
|
||||
|
||||
formats = (
|
||||
"GGGG-MM-DD (ISO-8601)",
|
||||
"Numerički (D.M.GGGG.)",
|
||||
"D. MMM GGGG.",
|
||||
"D. Mesec GGGG.",
|
||||
"D. Rb GGGG."
|
||||
)
|
||||
|
||||
roman_months = (
|
||||
"",
|
||||
"I",
|
||||
"II",
|
||||
"III",
|
||||
"IV",
|
||||
"V",
|
||||
"VI",
|
||||
"VII",
|
||||
"VIII",
|
||||
"IX",
|
||||
"X",
|
||||
"XI",
|
||||
"XII"
|
||||
)
|
||||
|
||||
sr_months = ("",
|
||||
u"januara",
|
||||
u"februara",
|
||||
u"marta",
|
||||
u"aprila",
|
||||
u"maja",
|
||||
u"juna",
|
||||
u"jula",
|
||||
u"avgusta",
|
||||
u"septembra",
|
||||
u"oktobra",
|
||||
u"novembra",
|
||||
u"decembra"
|
||||
)
|
||||
|
||||
sr_months3 = ("",
|
||||
u"jan",
|
||||
u"feb",
|
||||
u"mar",
|
||||
u"apr",
|
||||
u"maj",
|
||||
u"jun",
|
||||
u"jul",
|
||||
u"avg",
|
||||
u"sep",
|
||||
u"okt",
|
||||
u"nov",
|
||||
u"dec"
|
||||
)
|
||||
|
||||
def _display_gregorian(self, date_val):
|
||||
"""
|
||||
display gregorian calendar date in different format
|
||||
"""
|
||||
year = self._slash_year(date_val[2], date_val[3])
|
||||
if self.format == 0:
|
||||
return self.display_iso(date_val)
|
||||
elif self.format == 1:
|
||||
if date_val[3]:
|
||||
return self.display_iso(date_val)
|
||||
else:
|
||||
if date_val[0] == 0 and date_val[1] == 0:
|
||||
value = str(date_val[2])
|
||||
else:
|
||||
value = self._tformat.replace('%m', str(date_val[1]))
|
||||
value = value.replace('%d', str(date_val[0]))
|
||||
value = value.replace('%Y', str(abs(date_val[2])))
|
||||
value = value.replace('-', '/')
|
||||
elif self.format == 2:
|
||||
# Day. MON Year.
|
||||
if date_val[0] == 0:
|
||||
if date_val[1] == 0:
|
||||
value = u"%s." % year
|
||||
else:
|
||||
value = u"%s %s." % (self.sr_months3[date_val[1]], year)
|
||||
else:
|
||||
value = u"%d. %s %s." % (date_val[0],
|
||||
self.sr_months3[date_val[1]], year)
|
||||
elif self.format == 3:
|
||||
# Day. MONTH Year.
|
||||
if date_val[0] == 0:
|
||||
if date_val[1] == 0:
|
||||
value = u"%s." % year
|
||||
else:
|
||||
value = u"%s %s." % (self.sr_months[date_val[1]], year)
|
||||
else:
|
||||
value = u"%d. %s %s." % (date_val[0],
|
||||
self.sr_months[date_val[1]], year)
|
||||
else:
|
||||
# Day RomanMon Year
|
||||
if date_val[0] == 0:
|
||||
if date_val[1] == 0:
|
||||
value = u"%s." % year
|
||||
else:
|
||||
value = "%s %s." % (self.roman_months[date_val[1]], year)
|
||||
else:
|
||||
value = "%d. %s %s." % (date_val[0],
|
||||
self.roman_months[date_val[1]], year)
|
||||
if date_val[2] < 0:
|
||||
return self._bce_str % value
|
||||
else:
|
||||
return value
|
||||
|
||||
def display(self, date):
|
||||
"""
|
||||
Return a text string representing the date.
|
||||
"""
|
||||
mod = date.get_modifier()
|
||||
cal = date.get_calendar()
|
||||
qual = date.get_quality()
|
||||
start = date.get_start_date()
|
||||
|
||||
qual_str = self._qual_str[qual]
|
||||
|
||||
if mod == Date.MOD_TEXTONLY:
|
||||
return date.get_text()
|
||||
elif start == Date.EMPTY:
|
||||
return ""
|
||||
elif mod == Date.MOD_SPAN:
|
||||
d_1 = self.display_cal[cal](start)
|
||||
d_2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'od', d_1, u'do', d_2,
|
||||
self.calendar[cal])
|
||||
elif mod == Date.MOD_RANGE:
|
||||
d_1 = self.display_cal[cal](start)
|
||||
d_2 = self.display_cal[cal](date.get_stop_date())
|
||||
return "%s%s %s %s %s%s" % (qual_str, u'između', d_1, u'i', d_2,
|
||||
self.calendar[cal])
|
||||
else:
|
||||
text = self.display_cal[date.get_calendar()](start)
|
||||
return "%s%s%s%s" % (qual_str, self._mod_str[mod], text,
|
||||
self.calendar[cal])
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Register classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
register_datehandler(('sr', 'serbian', 'srpski', 'sr_RS'),
|
||||
DateParserSR, DateDisplaySR_latin)
|
||||
@@ -29,11 +29,14 @@ from _DateHandler import (LANG, LANG_SHORT, LANG_TO_PARSER, LANG_TO_DISPLAY,
|
||||
register_datehandler)
|
||||
|
||||
# Import all the localized handlers
|
||||
import _Date_ca
|
||||
import _Date_cs
|
||||
import _Date_de
|
||||
import _Date_es
|
||||
import _Date_fi
|
||||
import _Date_fr
|
||||
import _Date_hr
|
||||
import _Date_it
|
||||
import _Date_lt
|
||||
import _Date_nb
|
||||
import _Date_nl
|
||||
@@ -41,10 +44,8 @@ import _Date_pl
|
||||
import _Date_pt
|
||||
import _Date_ru
|
||||
import _Date_sk
|
||||
import _Date_sr
|
||||
import _Date_sv
|
||||
import _Date_hr
|
||||
import _Date_ca
|
||||
import _Date_it
|
||||
|
||||
# Initialize global parser
|
||||
try:
|
||||
|
||||
@@ -107,7 +107,7 @@ class EventModel(BaseModel):
|
||||
return u''
|
||||
|
||||
def column_type(self,data):
|
||||
return str(gen.lib.EventType(data[COLUMN_TYPE]))
|
||||
return unicode(gen.lib.EventType(data[COLUMN_TYPE]))
|
||||
|
||||
def column_id(self,data):
|
||||
return unicode(data[COLUMN_ID])
|
||||
|
||||
@@ -46,6 +46,7 @@ import GrampsLocale
|
||||
import DateHandler
|
||||
from BasicUtils import name_displayer
|
||||
import gen.lib
|
||||
from gen.lib import EventRoleType
|
||||
import gen.utils
|
||||
|
||||
from _BaseModel import BaseModel
|
||||
@@ -126,10 +127,12 @@ class FamilyModel(BaseModel):
|
||||
return u""
|
||||
|
||||
def column_type(self, data):
|
||||
return str(gen.lib.FamilyRelType(data[5]))
|
||||
return unicode(gen.lib.FamilyRelType(data[5]))
|
||||
|
||||
def column_marriage(self, data):
|
||||
erlist = [ gen.lib.EventRef().unserialize(d) for d in data[6] ]
|
||||
erlist = [x for x in erlist if x.get_role()==EventRoleType.FAMILY or
|
||||
x.get_role()==EventRoleType.PRIMARY]
|
||||
event = gen.utils.marriage_from_eventref_list(self.db, erlist)
|
||||
if event:
|
||||
return DateHandler.displayer.display(event.date)
|
||||
|
||||
@@ -40,7 +40,7 @@ import locale
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import logging
|
||||
log = logging.getLogger(".")
|
||||
_LOG = logging.getLogger(".gui.peoplemodel")
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -243,6 +243,7 @@ class PeopleModel(gtk.GenericTreeModel):
|
||||
"""
|
||||
Initialize the model building the initial data
|
||||
"""
|
||||
cput = time.clock()
|
||||
gtk.GenericTreeModel.__init__(self)
|
||||
|
||||
self.db = db
|
||||
@@ -291,6 +292,8 @@ class PeopleModel(gtk.GenericTreeModel):
|
||||
data_filter = None
|
||||
self.current_filter = data_filter
|
||||
self.rebuild_data(data_filter, skip)
|
||||
_LOG.debug(self.__class__.__name__ + ' __init__ ' +
|
||||
str(time.clock() - cput) + ' sec')
|
||||
|
||||
def update_todo(self,client,cnxn_id,entry,data):
|
||||
self.todo_color = Config.get(Config.TODO_COLOR)
|
||||
@@ -305,9 +308,12 @@ class PeopleModel(gtk.GenericTreeModel):
|
||||
"""
|
||||
Convience function that calculates the new data and assigns it.
|
||||
"""
|
||||
cput = time.clock()
|
||||
self.calculate_data(data_filter, skip)
|
||||
self.assign_data()
|
||||
self.current_filter = data_filter
|
||||
_LOG.debug(self.__class__.__name__ + ' rebuild_data ' +
|
||||
str(time.clock() - cput) + ' sec')
|
||||
|
||||
def _build_search_sub(self,dfilter, skip):
|
||||
|
||||
@@ -521,7 +527,7 @@ class PeopleModel(gtk.GenericTreeModel):
|
||||
GrampsLocale.codeset)
|
||||
|
||||
def column_gender(self, data, node):
|
||||
return PeopleModel._GENDER[data[PeopleModel._GENDER_COL]]
|
||||
return unicode(PeopleModel._GENDER[data[PeopleModel._GENDER_COL]])
|
||||
|
||||
def column_birth_day(self, data, node):
|
||||
try:
|
||||
|
||||
@@ -104,7 +104,7 @@ class RepositoryModel(BaseModel):
|
||||
return unicode(data[1])
|
||||
|
||||
def column_type(self,data):
|
||||
return str(gen.lib.RepositoryType(data[2]))
|
||||
return unicode(gen.lib.RepositoryType(data[2]))
|
||||
|
||||
def column_name(self,data):
|
||||
return unicode(data[3])
|
||||
|
||||
@@ -87,8 +87,7 @@ class BackRefList(EmbeddedList):
|
||||
Method has signature of, and overrides create_buttons from _ButtonTab.py
|
||||
"""
|
||||
self.edit_btn = SimpleButton(gtk.STOCK_EDIT, self.edit_button_clicked)
|
||||
self.tooltips = gtk.Tooltips()
|
||||
self.tooltips.set_tip(self.edit_btn, _('Edit reference'))
|
||||
self.edit_btn.set_tooltip_text(_('Edit reference'))
|
||||
|
||||
hbox = gtk.HBox()
|
||||
hbox.set_spacing(6)
|
||||
|
||||
@@ -98,7 +98,6 @@ class ButtonTab(GrampsTab):
|
||||
"""
|
||||
self.dirty_selection = False
|
||||
GrampsTab.__init__(self,dbstate, uistate, track, name)
|
||||
self.tooltips = gtk.Tooltips()
|
||||
self.create_buttons(share_button, move_buttons, jump_button)
|
||||
|
||||
def create_buttons(self, share_button, move_buttons, jump_button):
|
||||
@@ -113,22 +112,22 @@ class ButtonTab(GrampsTab):
|
||||
self.edit_btn = SimpleButton(gtk.STOCK_EDIT, self.edit_button_clicked)
|
||||
self.del_btn = SimpleButton(gtk.STOCK_REMOVE, self.del_button_clicked)
|
||||
|
||||
self.tooltips.set_tip(self.add_btn, self._MSG['add'])
|
||||
self.tooltips.set_tip(self.edit_btn, self._MSG['edit'])
|
||||
self.tooltips.set_tip(self.del_btn, self._MSG['del'])
|
||||
self.add_btn.set_tooltip_text(self._MSG['add'])
|
||||
self.edit_btn.set_tooltip_text(self._MSG['edit'])
|
||||
self.del_btn.set_tooltip_text(self._MSG['del'])
|
||||
|
||||
if share_button:
|
||||
self.share_btn = SimpleButton(gtk.STOCK_INDEX, self.share_button_clicked)
|
||||
self.tooltips.set_tip(self.share_btn, self._MSG['share'])
|
||||
self.share_btn.set_tooltip_text(self._MSG['share'])
|
||||
else:
|
||||
self.share_btn = None
|
||||
|
||||
if move_buttons:
|
||||
self.up_btn = SimpleButton(gtk.STOCK_GO_UP, self.up_button_clicked)
|
||||
self.tooltips.set_tip(self.up_btn, self._MSG['up'])
|
||||
self.up_btn.set_tooltip_text(self._MSG['up'])
|
||||
self.down_btn = SimpleButton(gtk.STOCK_GO_DOWN,
|
||||
self.down_button_clicked)
|
||||
self.tooltips.set_tip(self.down_btn, self._MSG['down'])
|
||||
self.down_btn.set_tooltip_text(self._MSG['down'])
|
||||
else:
|
||||
self.up_btn = None
|
||||
self.down_btn = None
|
||||
@@ -146,7 +145,7 @@ class ButtonTab(GrampsTab):
|
||||
|
||||
if jump_button:
|
||||
self.jump_btn = SimpleButton(gtk.STOCK_JUMP_TO, self.jump_button_clicked)
|
||||
self.tooltips.set_tip(self.jump_btn, self._MSG['jump'])
|
||||
self.jump_btn.set_tooltip_text(self._MSG['jump'])
|
||||
else:
|
||||
self.jump_btn = None
|
||||
|
||||
|
||||
@@ -240,11 +240,15 @@ class EmbeddedList(ButtonTab):
|
||||
pass
|
||||
|
||||
def _find_row(self, x, y):
|
||||
row = self.tree.get_path_at_pos(x, y)
|
||||
row = self.tree.get_dest_row_at_pos(x, y)
|
||||
if row is None:
|
||||
return len(self.get_data())
|
||||
else:
|
||||
return row[0][0]
|
||||
if row[1] in (gtk.TREE_VIEW_DROP_BEFORE,
|
||||
gtk.TREE_VIEW_DROP_INTO_OR_BEFORE):
|
||||
return row[0][0]
|
||||
else:
|
||||
return row[0][0]+1
|
||||
|
||||
def _handle_drag(self, row, obj):
|
||||
self.get_data().insert(row, obj)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2006 Donald N. Allingham
|
||||
# Copyright (C) 2009 Gary Burton
|
||||
#
|
||||
# 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
|
||||
@@ -344,11 +345,11 @@ class GalleryTab(ButtonTab):
|
||||
dnd_types = [ self._DND_TYPE.target(), self._DND_EXTRA.target(),
|
||||
DdTargets.MEDIAOBJ.target()]
|
||||
|
||||
self.iconlist.drag_dest_set(gtk.DEST_DEFAULT_ALL, dnd_types,
|
||||
gtk.gdk.ACTION_COPY)
|
||||
self.iconlist.drag_source_set(gtk.gdk.BUTTON1_MASK,
|
||||
[self._DND_TYPE.target()],
|
||||
gtk.gdk.ACTION_COPY)
|
||||
self.iconlist.enable_model_drag_dest(dnd_types,
|
||||
gtk.gdk.ACTION_COPY)
|
||||
self.iconlist.enable_model_drag_source(gtk.gdk.BUTTON1_MASK,
|
||||
[self._DND_TYPE.target()],
|
||||
gtk.gdk.ACTION_COPY)
|
||||
self.iconlist.connect('drag_data_get', self.drag_data_get)
|
||||
if not self.dbstate.db.readonly:
|
||||
self.iconlist.connect('drag_data_received', self.drag_data_received)
|
||||
|
||||
@@ -39,7 +39,7 @@ class NoteModel(gtk.ListStore):
|
||||
self.db = db
|
||||
for handle in note_list:
|
||||
note = self.db.get_note_from_handle(handle)
|
||||
text = note.get().replace('\n', ' ')
|
||||
text = unicode(note.get().replace('\n', ' '))
|
||||
if len(text) > 80:
|
||||
text = text[:80]+"..."
|
||||
self.append(row=[
|
||||
|
||||
@@ -87,7 +87,6 @@ class ObjEntry(object):
|
||||
self.set_val = set_val
|
||||
self.uistate = uistate
|
||||
self.track = track
|
||||
self.tooltips = gtk.Tooltips()
|
||||
|
||||
#connect drag and drop
|
||||
self._init_dnd()
|
||||
@@ -219,25 +218,25 @@ class ObjEntry(object):
|
||||
image.set_from_stock(gtk.STOCK_REMOVE, gtk.ICON_SIZE_BUTTON)
|
||||
image.show()
|
||||
self.share.add(image)
|
||||
self.tooltips.set_tip(self.share, self.DEL_STR)
|
||||
self.share.set_tooltip_text(self.DEL_STR)
|
||||
if self.add_edt is not None:
|
||||
image = gtk.Image()
|
||||
image.set_from_stock(gtk.STOCK_EDIT, gtk.ICON_SIZE_BUTTON)
|
||||
image.show()
|
||||
self.add_edt.add(image)
|
||||
self.tooltips.set_tip(self.add_edt, self.EDIT_STR)
|
||||
self.add_edt.set_tooltip_text(self.EDIT_STR)
|
||||
else:
|
||||
image = gtk.Image()
|
||||
image.set_from_stock(gtk.STOCK_INDEX, gtk.ICON_SIZE_BUTTON)
|
||||
image.show()
|
||||
self.share.add(image)
|
||||
self.tooltips.set_tip(self.share, self.SHARE_STR)
|
||||
self.share.set_tooltip_text(self.SHARE_STR)
|
||||
if self.add_edt is not None:
|
||||
image = gtk.Image()
|
||||
image.set_from_stock(gtk.STOCK_ADD, gtk.ICON_SIZE_BUTTON)
|
||||
image.show()
|
||||
self.add_edt.add(image)
|
||||
self.tooltips.set_tip(self.add_edt, self.ADD_STR)
|
||||
self.add_edt.set_tooltip_text(self.ADD_STR)
|
||||
|
||||
class PlaceEntry(ObjEntry):
|
||||
"""
|
||||
@@ -384,10 +383,10 @@ class NoteEntry(ObjEntry):
|
||||
|
||||
def get_label(self, note):
|
||||
txt = " ".join(note.get().split())
|
||||
#String must be unicode for truncation to work for non ascii characters
|
||||
txt = unicode(txt)
|
||||
if len(txt) > 35:
|
||||
txt = txt[:35]+"..."
|
||||
else:
|
||||
txt = txt
|
||||
txt = txt[:35] + "..."
|
||||
return "%s [%s]" % (txt, note.gramps_id)
|
||||
|
||||
def call_editor(self, obj=None):
|
||||
|
||||
@@ -409,7 +409,6 @@ class EditFamily(EditPrimary):
|
||||
|
||||
def __init__(self, dbstate, uistate, track, family):
|
||||
|
||||
self.tooltips = gtk.Tooltips()
|
||||
EditPrimary.__init__(self, dbstate, uistate, track,
|
||||
family, dbstate.db.get_family_from_handle,
|
||||
dbstate.db.get_family_from_gramps_id)
|
||||
@@ -543,12 +542,10 @@ class EditFamily(EditPrimary):
|
||||
self.mbutton_del = self.top.get_widget('mbutton_del')
|
||||
self.mbutton_edit = self.top.get_widget('mbutton_edit')
|
||||
|
||||
self.tooltips.set_tip(self.mbutton_index,
|
||||
_("Select a person as the mother"))
|
||||
self.tooltips.set_tip(self.mbutton_add,
|
||||
_("Add a new person as the mother"))
|
||||
self.tooltips.set_tip(self.mbutton_del,
|
||||
_("Remove the person as the mother"))
|
||||
self.mbutton_index.set_tooltip_text(_("Select a person as the mother"))
|
||||
self.mbutton_add.set_tooltip_text(_("Add a new person as the mother"))
|
||||
self.mbutton_del.set_tooltip_text(_("Remove the person as the mother"))
|
||||
|
||||
|
||||
self.mbutton_edit.connect('button-press-event', self.edit_mother)
|
||||
self.mbutton_edit.connect('key-press-event', self.edit_mother)
|
||||
@@ -561,12 +558,9 @@ class EditFamily(EditPrimary):
|
||||
self.fbutton_del = self.top.get_widget('fbutton_del')
|
||||
self.fbutton_edit = self.top.get_widget('fbutton_edit')
|
||||
|
||||
self.tooltips.set_tip(self.fbutton_index,
|
||||
_("Select a person as the father"))
|
||||
self.tooltips.set_tip(self.fbutton_add,
|
||||
_("Add a new person as the father"))
|
||||
self.tooltips.set_tip(self.fbutton_del,
|
||||
_("Remove the person as the father"))
|
||||
self.fbutton_index.set_tooltip_text(_("Select a person as the father"))
|
||||
self.fbutton_add.set_tooltip_text(_("Add a new person as the father"))
|
||||
self.fbutton_del.set_tooltip_text(_("Remove the person as the father"))
|
||||
|
||||
self.fbutton_edit.connect('button-press-event', self.edit_father)
|
||||
self.fbutton_edit.connect('key-press-event', self.edit_father)
|
||||
@@ -856,7 +850,7 @@ class EditFamily(EditPrimary):
|
||||
if death and death.get_type() == gen.lib.EventType.BURIAL:
|
||||
death_label.set_label(_("Burial:"))
|
||||
|
||||
self.tooltips.set_tip(btn_edit, _('Edit %s') % name)
|
||||
btn_edit.set_tooltip_text(_('Edit %s') % name)
|
||||
btn_index.hide()
|
||||
btn_add.hide()
|
||||
btn_del.show()
|
||||
|
||||
@@ -119,7 +119,9 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) :
|
||||
self.top_title = _("Export Assistant")
|
||||
ManagedWindow.ManagedWindow.__init__(self,uistate,[],
|
||||
self.__class__)
|
||||
self.set_window(self, None, self.top_title, isWindow=True)
|
||||
#set_window is present in both parent classes
|
||||
ManagedWindow.ManagedWindow.set_window(self, self, None,
|
||||
self.top_title, isWindow=True)
|
||||
|
||||
#set up callback method for the export plugins
|
||||
self.callback = self.pulse_progressbar
|
||||
@@ -197,8 +199,6 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) :
|
||||
table.set_row_spacings(6)
|
||||
table.set_col_spacings(6)
|
||||
|
||||
tip = gtk.Tooltips()
|
||||
|
||||
group = None
|
||||
recent_type = Config.get(Config.RECENT_EXPORT_TYPE)
|
||||
|
||||
@@ -207,11 +207,11 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) :
|
||||
description= self.__exporters[ix].get_description()
|
||||
|
||||
button = gtk.RadioButton(group,title)
|
||||
button.set_tooltip_text(description)
|
||||
if not group:
|
||||
group = button
|
||||
self.format_buttons.append(button)
|
||||
table.attach(button,0,2,2*ix,2*ix+1)
|
||||
tip.set_tip(button,description)
|
||||
if ix == recent_type :
|
||||
button.set_active(True)
|
||||
|
||||
|
||||
@@ -214,44 +214,6 @@ class MyLesserEqualGreater(gtk.ComboBox):
|
||||
else:
|
||||
self.set_active(self.clist.index('equal to'))
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# MySource - Combo box with list of sources with a standard interface
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MySource(gtk.ComboBox):
|
||||
|
||||
def __init__(self, db):
|
||||
gtk.ComboBox.__init__(self)
|
||||
self.db = db
|
||||
store = gtk.ListStore(gobject.TYPE_STRING)
|
||||
self.set_model(store)
|
||||
cell = gtk.CellRendererText()
|
||||
self.pack_start(cell, True)
|
||||
self.add_attribute(cell, 'text', 0)
|
||||
|
||||
self.slist = []
|
||||
for src_handle in self.db.get_source_handles(sort_handles=True):
|
||||
src = self.db.get_source_from_handle(src_handle)
|
||||
self.slist.append(src.get_gramps_id())
|
||||
title = src.get_title()
|
||||
if len(title) > 44:
|
||||
title = title[:40] + "..."
|
||||
store.append(row=["%s [%s]" % (title, src.get_gramps_id())])
|
||||
|
||||
self.set_active(0)
|
||||
self.show()
|
||||
|
||||
def get_text(self):
|
||||
active = self.get_active()
|
||||
if active < 0:
|
||||
return ""
|
||||
return self.slist[active]
|
||||
|
||||
def set_text(self, val):
|
||||
if val in self.slist:
|
||||
self.set_active(self.slist.index(val))
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# MyPlaces - AutoCombo text entry with list of places attached. Provides
|
||||
@@ -272,6 +234,8 @@ class MyPlaces(gtk.Entry):
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MyID(gtk.HBox):
|
||||
_invalid_id_txt = _('Not a valid ID')
|
||||
_empty_id_txt = _invalid_id_txt
|
||||
|
||||
obj_name = {
|
||||
'Person' : _('Person'),
|
||||
@@ -300,10 +264,8 @@ class MyID(gtk.HBox):
|
||||
self.button.show()
|
||||
self.pack_start(self.entry)
|
||||
self.add(self.button)
|
||||
self.tooltips = gtk.Tooltips()
|
||||
self.tooltips.set_tip(self.button, _('Select %s from a list')
|
||||
% self.obj_name[namespace])
|
||||
self.tooltips.enable()
|
||||
self.button.set_tooltip_text(_('Select %s from a list')
|
||||
% self.obj_name[namespace])
|
||||
self.show()
|
||||
self.set_text('')
|
||||
|
||||
@@ -348,13 +310,30 @@ class MyID(gtk.HBox):
|
||||
return name
|
||||
|
||||
def set_text(self, val):
|
||||
try:
|
||||
name = self.name_from_gramps_id(val)
|
||||
self.tooltips.set_tip(self.entry, name)
|
||||
except AttributeError:
|
||||
self.tooltips.set_tip(self.entry, _('Not a valid ID'))
|
||||
if not val:
|
||||
self.entry.set_tooltip_text(self._empty_id_txt)
|
||||
else:
|
||||
try:
|
||||
name = self.name_from_gramps_id(val)
|
||||
self.entry.set_tooltip_text(name)
|
||||
except AttributeError:
|
||||
self.entry.set_tooltip_text(self._invalid_id_txt)
|
||||
self.entry.set_text(val)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# MySource - select ID of sources with a standard interface
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MySource(MyID):
|
||||
|
||||
_empty_id_txt = _('Give or select a source ID, leave empty to find objects'
|
||||
' with no source.')
|
||||
def __init__(self, dbstate, uistate, track):
|
||||
MyID.__init__(self, dbstate, uistate, track, namespace='Source')
|
||||
self.entry.set_tooltip_text(self._empty_id_txt)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@@ -486,7 +465,7 @@ class EditRule(ManagedWindow.ManagedWindow):
|
||||
t = MyID(self.dbstate, self.uistate, self.track,
|
||||
self.namespace)
|
||||
elif v == _('Source ID:'):
|
||||
t = MySource(self.db)
|
||||
t = MySource(self.dbstate, self.uistate, self.track)
|
||||
elif v == _('Filter name:'):
|
||||
t = MyFilters(self.filterdb.get_filters(self.namespace),
|
||||
self.filter_name)
|
||||
|
||||
@@ -133,6 +133,8 @@ class ShowResults(ManagedWindow.ManagedWindow):
|
||||
elif self.namespace == 'Note':
|
||||
note = self.db.get_note_from_handle(handle)
|
||||
name = note.get().replace('\n', ' ')
|
||||
#String must be unicode for truncation to work for non ascii characters
|
||||
name = unicode(name)
|
||||
if len(name) > 80:
|
||||
name = name[:80]+"..."
|
||||
gid = note.get_gramps_id()
|
||||
|
||||
@@ -56,12 +56,15 @@ class HasCommonAncestorWith(Rule):
|
||||
# ancestor list once.
|
||||
# Start with filling the cache for root person (gramps_id in self.list[0])
|
||||
self.ancestor_cache = {}
|
||||
self.root_person = db.get_person_from_gramps_id(self.list[0])
|
||||
self.add_ancs(db, self.root_person)
|
||||
root_person = db.get_person_from_gramps_id(self.list[0])
|
||||
self.add_ancs(db, root_person)
|
||||
self.with_people = [root_person.handle]
|
||||
|
||||
def add_ancs(self, db, person):
|
||||
if person.handle not in self.ancestor_cache:
|
||||
self.ancestor_cache[person.handle] = set()
|
||||
else:
|
||||
return
|
||||
|
||||
for fam_handle in person.get_parent_family_handle_list():
|
||||
fam = db.get_family_from_handle(fam_handle)
|
||||
@@ -78,8 +81,10 @@ class HasCommonAncestorWith(Rule):
|
||||
self.ancestor_cache = {}
|
||||
|
||||
def has_common_ancestor(self, other):
|
||||
if self.ancestor_cache[self.root_person.handle] & self.ancestor_cache[other.handle]:
|
||||
return True
|
||||
for handle in self.with_people:
|
||||
if self.ancestor_cache[handle] & \
|
||||
self.ancestor_cache[other.handle]:
|
||||
return True
|
||||
return False
|
||||
|
||||
def apply(self, db, person):
|
||||
|
||||
@@ -55,12 +55,22 @@ class HasCommonAncestorWithFilterMatch(HasCommonAncestorWith,MatchesFilter):
|
||||
HasCommonAncestorWith.__init__(self,list)
|
||||
self.ancestor_cache = {}
|
||||
|
||||
def init_ancestor_cache(self,db):
|
||||
def prepare(self, db):
|
||||
self.db = db
|
||||
# For each(!) person we keep track of who their ancestors
|
||||
# are, in a set(). So we only have to compute a person's
|
||||
# ancestor list once.
|
||||
# Start with filling the cache for root person (gramps_id in self.list[0])
|
||||
self.ancestor_cache = {}
|
||||
self.with_people = []
|
||||
filt = MatchesFilter(self.list)
|
||||
filt.prepare(db)
|
||||
def init(self, h): self.ancestor_cache[h] = 1
|
||||
for handle in db.get_person_handles(sort_handles=False):
|
||||
if (handle not in self.ancestor_cache
|
||||
and filt.apply (db, db.get_person_from_handle(handle))):
|
||||
for_each_ancestor(db,[handle],init,self)
|
||||
person = db.get_person_from_handle(handle)
|
||||
if filt.apply (db, person):
|
||||
#store all people in the filter so as to compare later
|
||||
self.with_people.append(person.handle)
|
||||
#fill list of ancestor of person if not present yet
|
||||
if handle not in self.ancestor_cache:
|
||||
self.add_ancs(db, person)
|
||||
filt.reset()
|
||||
|
||||
@@ -48,12 +48,21 @@ class HasSourceOf(Rule):
|
||||
description = _('Matches people who have a particular source')
|
||||
|
||||
def prepare(self,db):
|
||||
if self.list[0] == '':
|
||||
self.source_handle = None
|
||||
self.nosource = True
|
||||
return
|
||||
|
||||
self.nosource = False
|
||||
try:
|
||||
self.source_handle = db.get_source_from_gramps_id(self.list[0]).get_handle()
|
||||
except:
|
||||
self.source_handle = None
|
||||
|
||||
def apply(self,db,person):
|
||||
def apply(self, db, person):
|
||||
if not self.source_handle:
|
||||
return False
|
||||
return person.has_source_reference( self.source_handle)
|
||||
if self.nosource:
|
||||
return len(person.get_source_references()) == 0
|
||||
else:
|
||||
return False
|
||||
return person.has_source_reference(self.source_handle)
|
||||
|
||||
@@ -20,7 +20,7 @@ from Filters.Rules._ChangedSinceBase import ChangedSinceBase
|
||||
class ChangedSince(ChangedSinceBase):
|
||||
"""Rules that checks for places changed since a specific time."""
|
||||
|
||||
name = ('Places changed after <date time>')
|
||||
name = _('Places changed after <date time>')
|
||||
description = _("Matches place records changed after a specified "
|
||||
"date-time (yyyy-mm-dd hh:mm:ss) or in the range, if a second "
|
||||
"date-time is given")
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
@@ -76,6 +77,9 @@ class Rule(object):
|
||||
return ';'.join(v)
|
||||
|
||||
def match_substring(self, param_index, str_var):
|
||||
# make str_var unicode so that search for ü works
|
||||
# see issue 3188
|
||||
str_var = unicode(str_var)
|
||||
if self.list[param_index] and \
|
||||
(str_var.upper().find(self.list[param_index].upper()) == -1):
|
||||
return False
|
||||
|
||||
@@ -41,7 +41,6 @@ class SidebarFilter(object):
|
||||
self.table.set_row_spacings(6)
|
||||
self.table.set_col_spacing(0, 6)
|
||||
self.table.set_col_spacing(1, 6)
|
||||
self.tooltips = gtk.Tooltips()
|
||||
self.apply_btn = gtk.Button(stock=gtk.STOCK_FIND)
|
||||
self.clear_btn = gtk.Button()
|
||||
|
||||
@@ -119,7 +118,7 @@ class SidebarFilter(object):
|
||||
self.add_entry(name, widget)
|
||||
widget.connect('key-press-event', self.key_press)
|
||||
if tooltip:
|
||||
self.tooltips.set_tip(widget, tooltip)
|
||||
widget.set_tooltip_text(tooltip)
|
||||
|
||||
def key_press(self, obj, event):
|
||||
if not event.state or event.state in (gtk.gdk.MOD2_MASK,):
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2009 Gary Burton
|
||||
#
|
||||
# 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
|
||||
@@ -312,6 +313,22 @@ class GedcomParser(UpdateCallback):
|
||||
self.rid2id = {}
|
||||
self.nid2id = {}
|
||||
|
||||
#
|
||||
# Parse table for SUBM tag
|
||||
#
|
||||
self.subm_parse_tbl = {
|
||||
# +1 NAME <SUBMITTER_NAME>
|
||||
TOKEN_NAME : self.__subm_name,
|
||||
# +1 <<ADDRESS_STRUCTURE>>
|
||||
TOKEN_ADDR : self.__subm_addr,
|
||||
TOKEN_PHON : self.__subm_phon,
|
||||
# +1 <<MULTIMEDIA_LINK>>
|
||||
# +1 LANG <LANGUAGE_PREFERENCE>
|
||||
# +1 RFN <SUBMITTER_REGISTERED_RFN>
|
||||
# +1 RIN <AUTOMATED_RECORD_ID>
|
||||
# +1 <<CHANGE_DATE>>
|
||||
}
|
||||
|
||||
#
|
||||
# Parse table for INDI tag
|
||||
#
|
||||
@@ -802,7 +819,6 @@ class GedcomParser(UpdateCallback):
|
||||
self.want_parse_warnings = False
|
||||
self.__parse_header_source()
|
||||
self.want_parse_warnings = True
|
||||
self.__parse_submitter()
|
||||
if self.use_def_src:
|
||||
self.dbase.add_source(self.def_src, self.trans)
|
||||
self.__parse_record()
|
||||
@@ -866,6 +882,8 @@ class GedcomParser(UpdateCallback):
|
||||
we create a new family, assign the handle and GRAMPS ID.
|
||||
"""
|
||||
family = gen.lib.Family()
|
||||
# Add a counter for reordering the children later:
|
||||
family.child_ref_count = 0
|
||||
intid = self.fid2id.get(gramps_id)
|
||||
if self.dbase.has_family_handle(intid):
|
||||
family.unserialize(self.dbase.get_raw_family_data(intid))
|
||||
@@ -1098,24 +1116,25 @@ class GedcomParser(UpdateCallback):
|
||||
except TypeError:
|
||||
return
|
||||
|
||||
def __parse_submitter(self):
|
||||
def __parse_submitter(self, line):
|
||||
"""
|
||||
Parses the submitter data
|
||||
|
||||
n @<XREF:SUBM>@ SUBM
|
||||
+1 NAME <SUBMITTER_NAME>
|
||||
+1 <<ADDRESS_STRUCTURE>>
|
||||
+1 <<MULTIMEDIA_LINK>>
|
||||
+1 LANG <LANGUAGE_PREFERENCE>
|
||||
+1 RFN <SUBMITTER_REGISTERED_RFN>
|
||||
+1 RIN <AUTOMATED_RECORD_ID>
|
||||
+1 <<CHANGE_DATE>>
|
||||
"""
|
||||
line = self.__get_next_line()
|
||||
if line.data != "SUBM":
|
||||
self._backup()
|
||||
return
|
||||
else:
|
||||
while True:
|
||||
line = self.__get_next_line()
|
||||
if self.__level_is_finished(line, 1):
|
||||
break
|
||||
elif line.token == TOKEN_NAME:
|
||||
if self.use_def_src:
|
||||
self.def_src.set_author(line.data)
|
||||
elif line.token == TOKEN_ADDR:
|
||||
self.__skip_subordinate_levels(2)
|
||||
researcher = gen.lib.Researcher()
|
||||
state = GedcomUtils.CurrentState()
|
||||
state.res = researcher
|
||||
state.level = 1
|
||||
self.__parse_level(state, self.subm_parse_tbl, self.__undefined)
|
||||
self.dbase.set_researcher(state.res)
|
||||
|
||||
def __parse_record(self):
|
||||
"""
|
||||
@@ -1137,7 +1156,9 @@ class GedcomParser(UpdateCallback):
|
||||
self.__parse_obje(line)
|
||||
elif key in ("REPO", "REPOSITORY"):
|
||||
self.__parse_repo(line)
|
||||
elif key in ("SUBM", "SUBN", "SUBMITTER"):
|
||||
elif key in ("SUBM", "SUBMITTER"):
|
||||
self.__parse_submitter(line)
|
||||
elif key in ("SUBN"):
|
||||
self.__skip_subordinate_levels(1)
|
||||
elif line.token in (TOKEN_SUBM, TOKEN_SUBN, TOKEN_IGNORE):
|
||||
self.__skip_subordinate_levels(1)
|
||||
@@ -1147,7 +1168,7 @@ class GedcomParser(UpdateCallback):
|
||||
line.data.startswith("SOURCE "):
|
||||
# A source formatted in a single line, for example:
|
||||
# 0 @S62@ SOUR This is the title of the source
|
||||
source = self.__find_or_create_source(self.sid_map[line[3]])
|
||||
source = self.__find_or_create_source(self.sid_map[line.data])
|
||||
source.set_title(line.data[5:])
|
||||
self.dbase.commit_source(source, self.trans)
|
||||
elif key[0:4] == "NOTE":
|
||||
@@ -2409,12 +2430,14 @@ class GedcomParser(UpdateCallback):
|
||||
reflist = [ ref for ref in state.family.get_child_ref_list() \
|
||||
if ref.ref == child.handle ]
|
||||
|
||||
if reflist:
|
||||
if reflist: # The child has been referenced already
|
||||
ref = reflist[0]
|
||||
if sub_state.frel:
|
||||
ref.set_father_relation(sub_state.frel)
|
||||
if sub_state.mrel:
|
||||
ref.set_mother_relation(sub_state.mrel)
|
||||
# then we will set the order now:
|
||||
self.set_child_ref_order(state.family, ref)
|
||||
else:
|
||||
ref = gen.lib.ChildRef()
|
||||
ref.ref = child.handle
|
||||
@@ -2424,6 +2447,16 @@ class GedcomParser(UpdateCallback):
|
||||
ref.set_mother_relation(sub_state.mrel)
|
||||
state.family.add_child_ref(ref)
|
||||
|
||||
def set_child_ref_order(self, family, child_ref):
|
||||
"""
|
||||
Sets the child_ref in family.child_ref_list to be in the position
|
||||
family.child_ref_count. This reorders the children to be in the
|
||||
order given in the FAM section.
|
||||
"""
|
||||
family.child_ref_list.remove(child_ref)
|
||||
family.child_ref_list.insert(family.child_ref_count, child_ref)
|
||||
family.child_ref_count += 1
|
||||
|
||||
def __family_slgs(self, line, state):
|
||||
"""
|
||||
n SLGS {1:1}
|
||||
@@ -2490,7 +2523,7 @@ class GedcomParser(UpdateCallback):
|
||||
if line.data and line.data[0] == '@':
|
||||
self.__not_recognized(line, state.level)
|
||||
else:
|
||||
(form, filename, title, note) = self.__obje(state.level)
|
||||
(form, filename, title, note) = self.__obje(state.level + 1)
|
||||
self.build_media_object(state.family, form, filename, title, note)
|
||||
|
||||
def __family_comm(self, line, state):
|
||||
@@ -2688,7 +2721,7 @@ class GedcomParser(UpdateCallback):
|
||||
if line.data and line.data[0] == '@':
|
||||
self.__not_recognized(line, state.level)
|
||||
else:
|
||||
(form, filename, title, note) = self.__obje(state.level)
|
||||
(form, filename, title, note) = self.__obje(state.level + 1)
|
||||
self.build_media_object(state.event, form, filename, title, note)
|
||||
|
||||
def __event_type(self, line, state):
|
||||
@@ -2710,7 +2743,7 @@ class GedcomParser(UpdateCallback):
|
||||
else:
|
||||
try:
|
||||
name = gen.lib.EventType((gen.lib.EventType.CUSTOM,
|
||||
line[3]))
|
||||
line.data))
|
||||
except AttributeError:
|
||||
name = gen.lib.EventType(gen.lib.EventType.UNKNOWN)
|
||||
state.event.set_type(name)
|
||||
@@ -3459,7 +3492,7 @@ class GedcomParser(UpdateCallback):
|
||||
@type state: CurrentState
|
||||
"""
|
||||
state.repo_ref.set_call_number(line.data)
|
||||
self.__skip_subordinate_levels(state.level+1)
|
||||
#self.__skip_subordinate_levels(state.level+1)
|
||||
|
||||
def __repo_ref_medi(self, line, state):
|
||||
name = line.data
|
||||
@@ -4136,20 +4169,28 @@ class GedcomParser(UpdateCallback):
|
||||
elif line.token == TOKEN_TIME:
|
||||
tstr = line.data
|
||||
elif line.token == TOKEN_DATE:
|
||||
dstr = line.data
|
||||
#GedcomLex converted already to Date object
|
||||
dobj = line.data
|
||||
elif line.token == TOKEN_NOTE:
|
||||
self.__skip_subordinate_levels(level+1)
|
||||
else:
|
||||
self.__not_recognized(line, level+1)
|
||||
|
||||
# Attempt to convert the values to a valid change time
|
||||
if tstr:
|
||||
if dobj:
|
||||
dstr = "%s %s %s" % (dobj.get_day(), dobj.get_month(),
|
||||
dobj.get_year())
|
||||
try:
|
||||
if dstr:
|
||||
tstruct = time.strptime("%s %s" % (dstr, tstr),
|
||||
"%d %b %Y %H:%M:%S")
|
||||
if tstr:
|
||||
try:
|
||||
tstruct = time.strptime("%s %s" % (dstr, tstr),
|
||||
"%d %m %Y %H:%M:%S")
|
||||
except ValueError:
|
||||
#seconds is optional in GEDCOM
|
||||
tstruct = time.strptime("%s %s" % (dstr, tstr),
|
||||
"%d %m %Y %H:%M")
|
||||
else:
|
||||
tstruct = time.strptime(tstr, "%d %b %Y")
|
||||
tstruct = time.strptime(dstr, "%d %m %Y")
|
||||
val = time.mktime(tstruct)
|
||||
obj.change = val
|
||||
except ValueError:
|
||||
@@ -4275,4 +4316,44 @@ class GedcomParser(UpdateCallback):
|
||||
sref.set_reference_handle(self.def_src.handle)
|
||||
obj.add_source_reference(sref)
|
||||
|
||||
def __subm_name(self, line, state):
|
||||
"""
|
||||
@param line: The current line in GedLine format
|
||||
@type line: GedLine
|
||||
@param state: The current state
|
||||
@type state: CurrentState
|
||||
"""
|
||||
state.res.set_name(line.data)
|
||||
|
||||
def __subm_addr(self, line, state):
|
||||
"""
|
||||
@param line: The current line in GedLine format
|
||||
@type line: GedLine
|
||||
@param state: The current state
|
||||
@type state: CurrentState
|
||||
"""
|
||||
sub_state = GedcomUtils.CurrentState(level=state.level + 1)
|
||||
sub_state.location = gen.lib.Location()
|
||||
sub_state.location.set_street(line.data)
|
||||
|
||||
self.__parse_level(sub_state, self.parse_loc_tbl, self.__undefined)
|
||||
|
||||
location = sub_state.location
|
||||
state.res.set_address(location.get_street())
|
||||
state.res.set_city(location.get_city())
|
||||
state.res.set_state(location.get_state())
|
||||
state.res.set_country(location.get_country())
|
||||
state.res.set_postal_code(location.get_postal_code())
|
||||
|
||||
def __subm_phon(self, line, state):
|
||||
"""
|
||||
n PHON <PHONE_NUMBER> {0:3}
|
||||
|
||||
@param line: The current line in GedLine format
|
||||
@type line: GedLine
|
||||
@param state: The current state
|
||||
@type state: CurrentState
|
||||
"""
|
||||
state.res.set_phone(line.data)
|
||||
|
||||
#===eof===
|
||||
|
||||
@@ -895,6 +895,7 @@ class ListView(BookMarkView):
|
||||
self.columns.append(column)
|
||||
self.list.append_column(column)
|
||||
index += 1
|
||||
self.setup_filter()
|
||||
|
||||
def build_tree(self):
|
||||
if self.active:
|
||||
|
||||
@@ -158,7 +158,7 @@ class GuiStringOption(gtk.Entry):
|
||||
"""
|
||||
This class displays an option that is a simple one-line string.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
"""
|
||||
@param option: The option to display.
|
||||
@type option: gen.plug.menu.StringOption
|
||||
@@ -168,7 +168,7 @@ class GuiStringOption(gtk.Entry):
|
||||
self.__option = option
|
||||
self.set_text( self.__option.get_value() )
|
||||
self.connect('changed', self.__text_changed)
|
||||
tooltip.set_tip(self, self.__option.get_help())
|
||||
self.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
self.__option.connect('avail-changed', self.__update_avail)
|
||||
self.__update_avail()
|
||||
@@ -195,12 +195,12 @@ class GuiColorOption(gtk.ColorButton):
|
||||
"""
|
||||
This class displays an option that allows the selection of a colour.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
self.__option = option
|
||||
value = self.__option.get_value()
|
||||
gtk.ColorButton.__init__( self, gtk.gdk.color_parse(value) )
|
||||
self.connect('color-set', self.__value_changed)
|
||||
tooltip.set_tip(self, self.__option.get_help())
|
||||
self.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
def __value_changed(self, obj): # IGNORE:W0613 - obj is unused
|
||||
"""
|
||||
@@ -223,7 +223,7 @@ class GuiNumberOption(gtk.SpinButton):
|
||||
This class displays an option that is a simple number with defined maximum
|
||||
and minimum values.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
self.__option = option
|
||||
|
||||
decimals = 0
|
||||
@@ -243,7 +243,7 @@ class GuiNumberOption(gtk.SpinButton):
|
||||
|
||||
self.set_value(self.__option.get_value())
|
||||
self.connect('value_changed', self.__value_changed)
|
||||
tooltip.set_tip(self, self.__option.get_help())
|
||||
self.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
self.__option.connect('avail-changed', self.__update_avail)
|
||||
self.__update_avail()
|
||||
@@ -271,7 +271,7 @@ class GuiTextOption(gtk.ScrolledWindow):
|
||||
"""
|
||||
This class displays an option that is a multi-line string.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
self.__option = option
|
||||
gtk.ScrolledWindow.__init__(self)
|
||||
self.set_shadow_type(gtk.SHADOW_IN)
|
||||
@@ -287,7 +287,7 @@ class GuiTextOption(gtk.ScrolledWindow):
|
||||
# Required for tooltip
|
||||
gtext.add_events(gtk.gdk.ENTER_NOTIFY_MASK)
|
||||
gtext.add_events(gtk.gdk.LEAVE_NOTIFY_MASK)
|
||||
tooltip.set_tip(gtext, self.__option.get_help())
|
||||
gtext.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
self.__buff = gtext.get_buffer()
|
||||
self.__buff.connect('changed', self.__value_changed)
|
||||
@@ -310,12 +310,12 @@ class GuiBooleanOption(gtk.CheckButton):
|
||||
"""
|
||||
This class displays an option that is a boolean (True or False).
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
self.__option = option
|
||||
gtk.CheckButton.__init__(self, self.__option.get_label())
|
||||
self.set_active(self.__option.get_value())
|
||||
self.connect('toggled', self.__value_changed)
|
||||
tooltip.set_tip(self, self.__option.get_help())
|
||||
self.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
self.__option.connect('avail-changed', self.__update_avail)
|
||||
self.__update_avail()
|
||||
@@ -343,7 +343,7 @@ class GuiEnumeratedListOption(gtk.HBox):
|
||||
This class displays an option that provides a finite number of values.
|
||||
Each possible value is assigned a value and a description.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
gtk.HBox.__init__(self)
|
||||
evtBox = gtk.EventBox()
|
||||
self.__option = option
|
||||
@@ -353,7 +353,7 @@ class GuiEnumeratedListOption(gtk.HBox):
|
||||
|
||||
self.__update_options()
|
||||
|
||||
tooltip.set_tip(self, self.__option.get_help())
|
||||
self.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
self.__combo.connect('changed', self.__value_changed)
|
||||
self.__option.connect('options-changed', self.__update_options)
|
||||
@@ -407,7 +407,7 @@ class GuiPersonOption(gtk.HBox):
|
||||
This class displays an option that allows a person from the
|
||||
database to be selected.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
"""
|
||||
@param option: The option to display.
|
||||
@type option: gen.plug.menu.PersonOption
|
||||
@@ -436,8 +436,8 @@ class GuiPersonOption(gtk.HBox):
|
||||
person = self.__db.get_default_person()
|
||||
self.__update_person(person)
|
||||
|
||||
tooltip.set_tip(pevt, self.__option.get_help())
|
||||
tooltip.set_tip(person_button, _('Select a different person'))
|
||||
pevt.set_tooltip_text(self.__option.get_help())
|
||||
person_button.set_tooltip_text(_('Select a different person'))
|
||||
|
||||
self.__option.connect('avail-changed', self.__update_avail)
|
||||
self.__update_avail()
|
||||
@@ -498,7 +498,7 @@ class GuiFamilyOption(gtk.HBox):
|
||||
This class displays an option that allows a family from the
|
||||
database to be selected.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
"""
|
||||
@param option: The option to display.
|
||||
@type option: gen.plug.menu.FamilyOption
|
||||
@@ -524,8 +524,8 @@ class GuiFamilyOption(gtk.HBox):
|
||||
|
||||
self.__initialize_family()
|
||||
|
||||
tooltip.set_tip(pevt, self.__option.get_help())
|
||||
tooltip.set_tip(family_button, _('Select a different family'))
|
||||
pevt.set_tooltip_text(self.__option.get_help())
|
||||
family_button.set_tooltip_text(_('Select a different family'))
|
||||
|
||||
self.__option.connect('avail-changed', self.__update_avail)
|
||||
self.__update_avail()
|
||||
@@ -637,7 +637,7 @@ class GuiNoteOption(gtk.HBox):
|
||||
This class displays an option that allows a note from the
|
||||
database to be selected.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
"""
|
||||
@param option: The option to display.
|
||||
@type option: gen.plug.menu.NoteOption
|
||||
@@ -666,8 +666,8 @@ class GuiNoteOption(gtk.HBox):
|
||||
note = self.__db.get_note_from_gramps_id(nid)
|
||||
self.__update_note(note)
|
||||
|
||||
tooltip.set_tip(pevt, self.__option.get_help())
|
||||
tooltip.set_tip(note_button, _('Select an existing note'))
|
||||
pevt.set_tooltip_text(self.__option.get_help())
|
||||
note_button.set_tooltip_text(_('Select an existing note'))
|
||||
|
||||
self.__option.connect('avail-changed', self.__update_avail)
|
||||
self.__update_avail()
|
||||
@@ -688,10 +688,10 @@ class GuiNoteOption(gtk.HBox):
|
||||
if note:
|
||||
note_id = note.get_gramps_id()
|
||||
txt = " ".join(note.get().split())
|
||||
#String must be unicode for truncation to work for non ascii characters
|
||||
txt = unicode(txt)
|
||||
if len(txt) > 35:
|
||||
txt = txt[:35]+"..."
|
||||
else:
|
||||
txt = txt
|
||||
txt = txt[:35] + "..."
|
||||
txt = "%s [%s]" % (txt, note_id)
|
||||
|
||||
self.__note_label.set_text( txt )
|
||||
@@ -719,7 +719,7 @@ class GuiMediaOption(gtk.HBox):
|
||||
This class displays an option that allows a media object from the
|
||||
database to be selected.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
"""
|
||||
@param option: The option to display.
|
||||
@type option: gen.plug.menu.MediaOption
|
||||
@@ -748,8 +748,8 @@ class GuiMediaOption(gtk.HBox):
|
||||
media = self.__db.get_object_from_gramps_id(mid)
|
||||
self.__update_media(media)
|
||||
|
||||
tooltip.set_tip(pevt, self.__option.get_help())
|
||||
tooltip.set_tip(media_button, _('Select an existing media object'))
|
||||
pevt.set_tooltip_text(self.__option.get_help())
|
||||
media_button.set_tooltip_text(_('Select an existing media object'))
|
||||
|
||||
self.__option.connect('avail-changed', self.__update_avail)
|
||||
self.__update_avail()
|
||||
@@ -796,7 +796,7 @@ class GuiPersonListOption(gtk.HBox):
|
||||
This class displays a widget that allows multiple people from the
|
||||
database to be selected.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
"""
|
||||
@param option: The option to display.
|
||||
@type option: gen.plug.menu.PersonListOption
|
||||
@@ -849,7 +849,7 @@ class GuiPersonListOption(gtk.HBox):
|
||||
self.__vbbox.set_layout(gtk.BUTTONBOX_SPREAD)
|
||||
self.pack_end(self.__vbbox, expand=False)
|
||||
|
||||
tooltip.set_tip(self.__tree_view, self.__option.get_help())
|
||||
self.__tree_view.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
def __update_value(self):
|
||||
"""
|
||||
@@ -936,7 +936,7 @@ class GuiPlaceListOption(gtk.HBox):
|
||||
This class displays a widget that allows multiple places from the
|
||||
database to be selected.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
"""
|
||||
@param option: The option to display.
|
||||
@type option: gen.plug.menu.PlaceListOption
|
||||
@@ -989,7 +989,7 @@ class GuiPlaceListOption(gtk.HBox):
|
||||
self.__vbbox.set_layout(gtk.BUTTONBOX_SPREAD)
|
||||
self.pack_end(self.__vbbox, expand=False)
|
||||
|
||||
tooltip.set_tip(self.__tree_view, self.__option.get_help())
|
||||
self.__tree_view.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
def __update_value(self):
|
||||
"""
|
||||
@@ -1048,7 +1048,7 @@ class GuiSurnameColorOption(gtk.HBox):
|
||||
selected from the database, and to assign a colour (not necessarily
|
||||
unique) to each one.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
"""
|
||||
@param option: The option to display.
|
||||
@type option: gen.plug.menu.SurnameColorOption
|
||||
@@ -1112,7 +1112,7 @@ class GuiSurnameColorOption(gtk.HBox):
|
||||
colour = tmp.pop(0)
|
||||
self.__model.append([surname, colour])
|
||||
|
||||
tooltip.set_tip(self.__tree_view, self.__option.get_help())
|
||||
self.__tree_view.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
def __value_changed(self):
|
||||
"""
|
||||
@@ -1201,7 +1201,7 @@ class GuiDestinationOption(gtk.HBox):
|
||||
This class displays an option that allows the user to select a
|
||||
DestinationOption.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
"""
|
||||
@param option: The option to display.
|
||||
@type option: gen.plug.menu.DestinationOption
|
||||
@@ -1222,7 +1222,7 @@ class GuiDestinationOption(gtk.HBox):
|
||||
self.pack_start(self.__entry, True, True)
|
||||
self.pack_end(self.__button, False, False)
|
||||
|
||||
tooltip.set_tip(self, self.__option.get_help())
|
||||
self.set_tooltip_text(self.__option.get_help())
|
||||
|
||||
self.__option.connect('options-changed', self.__option_changed)
|
||||
|
||||
@@ -1296,14 +1296,14 @@ class GuiStyleOption(GuiEnumeratedListOption):
|
||||
"""
|
||||
This class displays a StyleOption.
|
||||
"""
|
||||
def __init__(self, option, dbstate, uistate, track, tooltip):
|
||||
def __init__(self, option, dbstate, uistate, track):
|
||||
"""
|
||||
@param option: The option to display.
|
||||
@type option: gen.plug.menu.StyleOption
|
||||
@return: nothing
|
||||
"""
|
||||
GuiEnumeratedListOption.__init__(self, option, dbstate,
|
||||
uistate, track, tooltip)
|
||||
uistate, track)
|
||||
self.__option = option
|
||||
|
||||
self.__button = gtk.Button("%s..." % _("Style Editor"))
|
||||
@@ -1344,7 +1344,6 @@ class GuiMenuOptions(object):
|
||||
# Fill options_dict with report/tool defaults:
|
||||
self.options_dict = {}
|
||||
self.options_help = {}
|
||||
self.__tooltips = gtk.Tooltips()
|
||||
self.add_menu_options(self.menu)
|
||||
for name in self.menu.get_all_option_names():
|
||||
option = self.menu.get_option_by_name(name)
|
||||
@@ -1387,8 +1386,8 @@ class GuiMenuOptions(object):
|
||||
if name in self.options_dict:
|
||||
option.set_value(self.options_dict[name])
|
||||
|
||||
widget, label = make_gui_option(option, self.__tooltips,
|
||||
dialog.dbstate, dialog.uistate, dialog.track)
|
||||
widget, label = make_gui_option(option, dialog.dbstate,
|
||||
dialog.uistate, dialog.track)
|
||||
|
||||
if widget is None:
|
||||
print "UNKNOWN OPTION: ", option
|
||||
@@ -1408,7 +1407,7 @@ class GuiMenuOptions(object):
|
||||
option = self.menu.get_option_by_name(name)
|
||||
self.options_dict[name] = option.get_value()
|
||||
|
||||
def make_gui_option(option, tooltips, dbstate, uistate, track):
|
||||
def make_gui_option(option, dbstate, uistate, track):
|
||||
"""
|
||||
Stand-alone function so that Options can be used in other
|
||||
ways, too. Takes an Option and returns a GuiOption.
|
||||
@@ -1417,49 +1416,40 @@ def make_gui_option(option, tooltips, dbstate, uistate, track):
|
||||
label = True
|
||||
pmgr = gen.plug.PluginManager.get_instance()
|
||||
external_options = pmgr.get_external_opt_dict()
|
||||
if tooltips == None:
|
||||
tooltips = gtk.Tooltips()
|
||||
elif type(tooltips) == type(""):
|
||||
msg = tooltips
|
||||
tooltips = gtk.Tooltips()
|
||||
# FIXME: what widget?
|
||||
#tooltips.set_tip(gui.scrolledwindow, msg)
|
||||
if isinstance(option, gen.plug.menu.PersonOption):
|
||||
widget = GuiPersonOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiPersonOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.FamilyOption):
|
||||
widget = GuiFamilyOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiFamilyOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.NoteOption):
|
||||
widget = GuiNoteOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiNoteOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.MediaOption):
|
||||
widget = GuiMediaOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiMediaOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.PersonListOption):
|
||||
widget = GuiPersonListOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiPersonListOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.NumberOption):
|
||||
widget = GuiNumberOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiNumberOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.BooleanOption):
|
||||
widget = GuiBooleanOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiBooleanOption(option, dbstate, uistate, track)
|
||||
label = False
|
||||
elif isinstance(option, gen.plug.menu.DestinationOption):
|
||||
widget = GuiDestinationOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiDestinationOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.StringOption):
|
||||
widget = GuiStringOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiStringOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.StyleOption):
|
||||
widget = GuiStyleOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiStyleOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.EnumeratedListOption):
|
||||
widget = GuiEnumeratedListOption(option, dbstate, uistate, track,
|
||||
tooltips)
|
||||
widget = GuiEnumeratedListOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.TextOption):
|
||||
widget = GuiTextOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiTextOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.ColorOption):
|
||||
widget = GuiColorOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiColorOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.SurnameColorOption):
|
||||
widget = GuiSurnameColorOption(option, dbstate, uistate, track,
|
||||
tooltips)
|
||||
widget = GuiSurnameColorOption(option, dbstate, uistate, track)
|
||||
elif isinstance(option, gen.plug.menu.PlaceListOption):
|
||||
widget = GuiPlaceListOption(option, dbstate, uistate, track, tooltips)
|
||||
widget = GuiPlaceListOption(option, dbstate, uistate, track)
|
||||
elif option.__class__ in external_options:
|
||||
widget = external_options[option.__class__](option, dbstate, uistate,
|
||||
track, tooltips)
|
||||
track)
|
||||
else:
|
||||
raise AttributeError(
|
||||
"can't make GuiOption: unknown option type: '%s'" % option)
|
||||
|
||||
@@ -119,12 +119,7 @@ class PluginDialog(ManagedWindow.ManagedWindow):
|
||||
self.apply_button.set_label(_("_Apply"))
|
||||
self.apply_button.set_use_underline(True)
|
||||
if tool_tip:
|
||||
try:
|
||||
tttips = gtk.tooltips_data_get(self.apply_button)
|
||||
if tttips:
|
||||
tttips[0].set_tip(self.apply_button, tool_tip)
|
||||
except AttributeError:
|
||||
pass
|
||||
self.apply_button.set_tooltip_text(tool_tip)
|
||||
|
||||
self.item = None
|
||||
self.build_plugin_tree(item_list, categories)
|
||||
|
||||
@@ -74,14 +74,14 @@ class Citation(object):
|
||||
@return: The key of the added reference among all the references.
|
||||
@rtype: char
|
||||
"""
|
||||
letter_count = len(string.lowercase)
|
||||
letter_count = len(string.ascii_lowercase)
|
||||
ref_count = len(self.__ref_list)
|
||||
x_ref_count = ref_count
|
||||
# Return "a" for ref_count = 0, otherwise log(0) does not work
|
||||
if ref_count == 0:
|
||||
self.__ref_list.append(("a", source_ref))
|
||||
return "a"
|
||||
last_letter = string.lowercase[ ref_count % letter_count ]
|
||||
last_letter = string.ascii_lowercase[ ref_count % letter_count ]
|
||||
key = ""
|
||||
# Calculate prek number of digits.
|
||||
number_of_letters = int(math.log(float(ref_count),float(letter_count)))+1
|
||||
@@ -94,7 +94,7 @@ class Citation(object):
|
||||
x_ref_count = x_ref_count - pow(letter_count, n)
|
||||
for letter in range(1, number_of_letters):
|
||||
index = x_ref_count / pow(letter_count, letter) % letter_count
|
||||
key += string.lowercase[ index ]
|
||||
key += string.ascii_lowercase[ index ]
|
||||
key = key + last_letter
|
||||
self.__ref_list.append((key, source_ref))
|
||||
return key
|
||||
|
||||
@@ -79,7 +79,7 @@ def _validate_options(options, dbase):
|
||||
phandle = dbase.get_person_handles()[0]
|
||||
person = dbase.get_person_from_handle(phandle)
|
||||
if not person:
|
||||
print "Please specify a person"
|
||||
print "ERROR: Please specify a person"
|
||||
if person:
|
||||
option.set_value(person.get_gramps_id())
|
||||
|
||||
@@ -88,13 +88,22 @@ def _validate_options(options, dbase):
|
||||
family = dbase.get_family_from_gramps_id(fid)
|
||||
if not family:
|
||||
person = dbase.get_default_person()
|
||||
family_list = person.get_family_handle_list()
|
||||
family_list = []
|
||||
family_handle = None
|
||||
if person:
|
||||
family_list = person.get_family_handle_list()
|
||||
if family_list:
|
||||
family_handle = family_list[0]
|
||||
else:
|
||||
family_handle = dbase.get_family_handles()[0]
|
||||
family = dbase.get_family_from_handle(family_handle)
|
||||
option.set_value(family.get_gramps_id())
|
||||
flist = dbase.get_family_handles()
|
||||
if flist:
|
||||
family_handle = flist[0]
|
||||
if family_handle:
|
||||
family = dbase.get_family_from_handle(family_handle)
|
||||
option.set_value(family.get_gramps_id())
|
||||
else:
|
||||
print "ERROR: Please specify a family"
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -821,7 +821,7 @@ if _DOT_FOUND:
|
||||
|
||||
_FORMATS += [{ 'type' : "svgz",
|
||||
'ext' : "svgz",
|
||||
'descr': _("Compressed Structured Vector Graphs (SVG)"),
|
||||
'descr': _("Compressed Structured Vector Graphs (SVGZ)"),
|
||||
'mime' : "image/svgz",
|
||||
'class': GVSvgzDoc }]
|
||||
|
||||
|
||||
@@ -813,5 +813,6 @@ class MenuReportOptions(GuiMenuOptions,ReportOptions):
|
||||
# properly.
|
||||
for optname in self.options_dict:
|
||||
menu_option = self.menu.get_option_by_name(optname)
|
||||
menu_option.set_value(self.options_dict[optname])
|
||||
if menu_option:
|
||||
menu_option.set_value(self.options_dict[optname])
|
||||
|
||||
|
||||
+28
-4
@@ -58,7 +58,7 @@ import DateHandler
|
||||
import GrampsDisplay
|
||||
import ManagedWindow
|
||||
from TransUtils import sgettext as _
|
||||
|
||||
from Utils import mac
|
||||
from DdTargets import DdTargets
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -323,7 +323,9 @@ class ScratchPadNote(ScratchPadWrapper):
|
||||
value = self._db.get_note_from_handle(handle)
|
||||
|
||||
self._title = value.get_gramps_id()
|
||||
#String must be unicode for truncation to work for non ascii characters
|
||||
note = value.get().replace('\n', ' ')
|
||||
note = unicode(note)
|
||||
if len(note) > 80:
|
||||
self._value = note[:80]+"..."
|
||||
else:
|
||||
@@ -494,6 +496,8 @@ class ScratchPadSourceRef(ScratchPadGrampsTypeWrapper):
|
||||
text = ""
|
||||
if len(srctxtlist) > 0:
|
||||
text = " ".join(srctxtlist[0].get().split())
|
||||
#String must be unicode for truncation to work for non ascii characters
|
||||
text = unicode(text)
|
||||
if len(text) > 60:
|
||||
text = text[:60]+"..."
|
||||
self._value = _("Volume/Page: %(pag)s -- %(sourcetext)s") % {
|
||||
@@ -1100,15 +1104,35 @@ class ScratchPadListView(object):
|
||||
return
|
||||
|
||||
# Find a wrapper class
|
||||
possible_wrappers = [target for target in context.targets \
|
||||
if target in self._target_type_to_wrapper_class_map.keys()]
|
||||
possible_wrappers = []
|
||||
if mac():
|
||||
# context is empty on mac due to a bug, work around this
|
||||
# Note that this workaround code works fine in linux too as
|
||||
# we know very well inside of GRAMPS what sel_data can be, so
|
||||
# we can anticipate on it, instead of letting the wrapper handle
|
||||
# it. This is less clean however !
|
||||
# See http://www.gramps-project.org/bugs/view.php?id=3089 for
|
||||
# an explaination of why this is required.
|
||||
dragtype = None
|
||||
try:
|
||||
dragtype = pickle.loads(sel_data)[0]
|
||||
except pickle.UnpicklingError, msg :
|
||||
# not a pickled object, probably text
|
||||
if isinstance(sel_data, basestring):
|
||||
dragtype = DdTargets.TEXT.drag_type
|
||||
if dragtype in self._target_type_to_wrapper_class_map:
|
||||
possible_wrappers = [dragtype]
|
||||
else:
|
||||
possible_wrappers = [target for target in context.targets \
|
||||
if target in self._target_type_to_wrapper_class_map]
|
||||
|
||||
if len(possible_wrappers) == 0:
|
||||
# No wrapper for this class
|
||||
return
|
||||
|
||||
# Just select the first match.
|
||||
wrapper_class = self._target_type_to_wrapper_class_map[str(possible_wrappers[0])]
|
||||
wrapper_class = self._target_type_to_wrapper_class_map[
|
||||
str(possible_wrappers[0])]
|
||||
|
||||
o = wrapper_class(self.dbstate,sel_data)
|
||||
# try:
|
||||
|
||||
+43
-9
@@ -30,6 +30,7 @@ import sys
|
||||
import locale
|
||||
import random
|
||||
import time
|
||||
import platform
|
||||
|
||||
from TransUtils import sgettext as _
|
||||
|
||||
@@ -50,7 +51,7 @@ import gen.lib
|
||||
import Errors
|
||||
from QuestionDialog import WarningDialog, ErrorDialog
|
||||
|
||||
from const import TEMP_DIR, USER_HOME
|
||||
from const import TEMP_DIR, USER_HOME, WINDOWS, MACOS, LINUX
|
||||
import shutil
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -256,6 +257,37 @@ def add_menuitem(menu, msg, obj, func):
|
||||
item.show()
|
||||
menu.append(item)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Platform determination functions
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
def lin():
|
||||
"""
|
||||
Return True if a linux system
|
||||
Note: Normally do as linux in else statement of a check !
|
||||
"""
|
||||
if platform.system() in LINUX:
|
||||
return True
|
||||
return False
|
||||
|
||||
def mac():
|
||||
"""
|
||||
Return True if a Macintosh system
|
||||
"""
|
||||
if platform.system() in MACOS:
|
||||
return True
|
||||
return False
|
||||
|
||||
def win():
|
||||
"""
|
||||
Return True if a windows system
|
||||
"""
|
||||
if platform.system() in WINDOWS:
|
||||
return True
|
||||
return False
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@@ -611,7 +643,9 @@ def probably_alive(person, db, current_date=None, limit=0):
|
||||
# code above did not look at birth, only at other events
|
||||
birth_obj = birth.get_date_object()
|
||||
if birth_obj.get_valid():
|
||||
# only if this is a valid birth:
|
||||
# only if this is a valid birth date:
|
||||
if birth_obj.match(current_date,">>"):
|
||||
return False
|
||||
if too_old(birth_obj, current_date.get_year()):
|
||||
return False
|
||||
if not_too_old(birth_obj, current_date.get_year()):
|
||||
@@ -771,9 +805,7 @@ def not_too_old(date, current_year=None):
|
||||
time_struct = time.localtime(time.time())
|
||||
current_year = time_struct[0]
|
||||
year = date.get_year()
|
||||
if year > current_year:
|
||||
return False
|
||||
return (year != 0 and current_year - year < _MAX_AGE_PROB_ALIVE)
|
||||
return (year != 0 and abs(current_year - year) < _MAX_AGE_PROB_ALIVE)
|
||||
|
||||
def too_old(date, current_year=None):
|
||||
if current_year:
|
||||
@@ -782,9 +814,7 @@ def too_old(date, current_year=None):
|
||||
time_struct = time.localtime(time.time())
|
||||
the_current_year = time_struct[0]
|
||||
year = date.get_year()
|
||||
if year > the_current_year:
|
||||
return True
|
||||
return (year != 0 and the_current_year - year > _MAX_AGE_PROB_ALIVE)
|
||||
return (year != 0 and abs(the_current_year - year) > _MAX_AGE_PROB_ALIVE)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -1134,8 +1164,12 @@ def open_file_with_default_application( file_path ):
|
||||
ErrorDialog(_("Error Opening File"), str(msg))
|
||||
else:
|
||||
search = os.environ['PATH'].split(':')
|
||||
if os.sys.platform == 'darwin':
|
||||
utility = 'open'
|
||||
else:
|
||||
utility = 'xdg-open'
|
||||
for lpath in search:
|
||||
prog = os.path.join(lpath, 'xdg-open')
|
||||
prog = os.path.join(lpath, utility)
|
||||
if os.path.isfile(prog):
|
||||
os.spawnvpe(os.P_NOWAIT, prog, [prog, norm_path], os.environ)
|
||||
return
|
||||
|
||||
+4
-27
@@ -218,7 +218,6 @@ class ViewManager(object):
|
||||
self.button_handlers = []
|
||||
self.buttons = []
|
||||
self.merge_ids = []
|
||||
self.tips = gtk.Tooltips()
|
||||
self._key = None
|
||||
self.file_loaded = False
|
||||
|
||||
@@ -356,17 +355,8 @@ class ViewManager(object):
|
||||
openbtn = gtk.MenuToolButton('gramps-db')
|
||||
openbtn.connect('clicked', self.__open_activate)
|
||||
openbtn.set_sensitive(False)
|
||||
open_tips = gtk.Tooltips()
|
||||
openbtn.set_arrow_tooltip(
|
||||
open_tips,
|
||||
_("Connect to a recent database"),
|
||||
_("Connect to a recent database"))
|
||||
|
||||
openbtn.set_tooltip(
|
||||
open_tips,
|
||||
_("Manage databases"),
|
||||
_("Manage databases")
|
||||
)
|
||||
openbtn.set_arrow_tooltip_text(_("Connect to a recent database"))
|
||||
openbtn.set_tooltip_text(_("Manage databases"))
|
||||
openbtn.show()
|
||||
return openbtn
|
||||
|
||||
@@ -733,10 +723,7 @@ class ViewManager(object):
|
||||
try:
|
||||
PluginWindows.PluginStatus(self.uistate, [])
|
||||
except Errors.WindowActiveError:
|
||||
old_win = self.uistate.gwm.get_item_from_id(
|
||||
PluginWindows.PluginStatus)
|
||||
old_win.close()
|
||||
PluginWindows.PluginStatus(self.uistate, [])
|
||||
pass
|
||||
|
||||
def sidebar_toggle(self, obj):
|
||||
"""
|
||||
@@ -796,15 +783,6 @@ class ViewManager(object):
|
||||
self.notebook.set_current_page(page_no)
|
||||
self.__vb_handlers_unblock()
|
||||
|
||||
def __setup_text_tips(self, use_text):
|
||||
"""
|
||||
Enable/disable the text tips in the sidebar
|
||||
"""
|
||||
if use_text:
|
||||
self.tips.disable()
|
||||
else:
|
||||
self.tips.enable()
|
||||
|
||||
def __delete_pages(self):
|
||||
"""
|
||||
Calls on_delete() for each view
|
||||
@@ -820,7 +798,6 @@ class ViewManager(object):
|
||||
self.prev_nav = PageView.NAVIGATION_NONE
|
||||
|
||||
use_text = Config.get(Config.SIDEBAR_TEXT)
|
||||
self.__setup_text_tips(use_text)
|
||||
|
||||
index = 0
|
||||
for page_def in self.views:
|
||||
@@ -885,7 +862,7 @@ class ViewManager(object):
|
||||
button.set_alignment(0, 0.5)
|
||||
|
||||
# add the tooltip
|
||||
self.tips.set_tip(button, page_title)
|
||||
button.set_tooltip_text(page_title)
|
||||
|
||||
# connect the signal, along with the index as user data
|
||||
handler_id = button.connect('clicked', self.__vb_clicked, index)
|
||||
|
||||
@@ -193,6 +193,16 @@ XMLFILE = "data.gramps"
|
||||
NO_SURNAME = "(%s)" % _("none")
|
||||
NO_GIVEN = "(%s)" % _("none")
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Platforms
|
||||
# Never test on LINUX, handle Linux in the else statement as default
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
LINUX = ["Linux", "linux"]
|
||||
MACOS = ["Darwin", "darwin"]
|
||||
WINDOWS = ["Windows", "win32"]
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Options Constants
|
||||
|
||||
+39
-37
@@ -72,6 +72,7 @@ img {
|
||||
background:none;
|
||||
}
|
||||
.content {
|
||||
padding-top: 1cm;
|
||||
background-color:#FFF;
|
||||
}
|
||||
.content div.snapshot {
|
||||
@@ -178,43 +179,6 @@ a:visited {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
#alphabet {
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding:0 0 0 9px;
|
||||
border-top:solid 2px #000;
|
||||
border-bottom:solid 4px #000;
|
||||
background-color:#EEE;
|
||||
}
|
||||
#alphabet ul li.letters {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
.letters:after {
|
||||
content:" |";
|
||||
}
|
||||
#alphabet ul li.letters a {
|
||||
display:block;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
color:#000;
|
||||
margin:0;
|
||||
padding:5px 5px;
|
||||
text-decoration:none;
|
||||
}
|
||||
#alphabet ul li.letters a:hover {
|
||||
background-color:#000;
|
||||
color:#FFF;
|
||||
}
|
||||
|
||||
/* Navigation
|
||||
----------------------------------------------------- */
|
||||
#navigation, #subnavigation {
|
||||
@@ -264,6 +228,44 @@ background-color:#EEE;
|
||||
border-width:0 0 1px 0;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
div#alphabet {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
background-color: #EEE;
|
||||
}
|
||||
div#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding: 0px 0px 0px 16px;
|
||||
border-width: 2px 0px 4px 0px;
|
||||
border-style: solid;
|
||||
border-color: #000;
|
||||
}
|
||||
div#alphabet ul li:after {
|
||||
content:" |";
|
||||
}
|
||||
div#alphabet ul li {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
div#alphabet ul li a {
|
||||
display: block;
|
||||
padding: 4px 8px 4px 8px;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
margin:0;
|
||||
text-decoration:none;
|
||||
color: #000;
|
||||
}
|
||||
div#alphabet ul li a:hover {
|
||||
background-color: #000;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Main Table
|
||||
----------------------------------------------------- */
|
||||
table {
|
||||
|
||||
@@ -67,6 +67,7 @@ img {
|
||||
background:none;
|
||||
}
|
||||
.content {
|
||||
padding-top: 1cm;
|
||||
background-color:#FFF;
|
||||
}
|
||||
.content div.snapshot {
|
||||
@@ -156,9 +157,10 @@ a:visited {
|
||||
/* Header
|
||||
----------------------------------------------------- */
|
||||
#header {
|
||||
padding:15px 15px 2px 15px;
|
||||
padding:15px 15px 15px 15px;
|
||||
margin:0;
|
||||
background-color:#454;
|
||||
height: 1cm;
|
||||
}
|
||||
#SiteTitle {
|
||||
color:#E0E6E0;
|
||||
@@ -171,51 +173,14 @@ a:visited {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
#alphabet {
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding:0 0 0 9px;
|
||||
border-top:solid 2px #000;
|
||||
border-bottom:solid 4px #000;
|
||||
background-color:#454;
|
||||
}
|
||||
#alphabet ul li.letters {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
.letters:after {
|
||||
content:" |";
|
||||
}
|
||||
#alphabet ul li.letters a {
|
||||
display:block;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
color:#000;
|
||||
margin:0;
|
||||
padding:5px 5px;
|
||||
text-decoration:none;
|
||||
}
|
||||
#alphabet ul li.letters a:hover {
|
||||
background-color:#000;
|
||||
color:#FFF;
|
||||
}
|
||||
|
||||
/* Navigation
|
||||
----------------------------------------------------- */
|
||||
#navigation {
|
||||
#navigation, #subnavigation {
|
||||
margin:0;
|
||||
padding:4px 0 0 0;
|
||||
background-color:#454;
|
||||
}
|
||||
#navigation ul {
|
||||
#navigation ul, #subnavigation ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:22px;
|
||||
@@ -223,12 +188,12 @@ a:visited {
|
||||
padding:0 0 0 12px;
|
||||
border-bottom:1px solid #7C8F7C;
|
||||
}
|
||||
#navigation ul li {
|
||||
#navigation ul li, #subnavigation ul li {
|
||||
margin:0;
|
||||
padding:0;
|
||||
float:left;
|
||||
}
|
||||
#navigation ul li a {
|
||||
#navigation ul li a, #subnavigation ul li a {
|
||||
display:block;
|
||||
font-size:12px;
|
||||
line-height:100%;
|
||||
@@ -239,14 +204,14 @@ a:visited {
|
||||
padding:5px 5px;
|
||||
background-color:#454;
|
||||
}
|
||||
#navigation ul li a:hover {
|
||||
#navigation ul li a:hover, #subnavigation ul li a:hover {
|
||||
color:#FFF;
|
||||
padding-top:4px;
|
||||
background-color:#9DBF9D;
|
||||
border-top:solid 1px #454;
|
||||
border-bottom:solid 1px #000;
|
||||
}
|
||||
#navigation ul li.CurrentSection a {
|
||||
#navigation ul li.CurrentSection a, #subnavigation ul li.CurrentSection a {
|
||||
color:#454;
|
||||
padding-bottom:4px;
|
||||
border-top:solid 1px #7C8F7C;
|
||||
@@ -255,11 +220,49 @@ a:visited {
|
||||
border-bottom:solid 1px #FFF;
|
||||
background-color:#FFF;
|
||||
}
|
||||
#navigation ul li.CurrentSection a:hover {
|
||||
#navigation ul li.CurrentSection a:hover, #subnavigation ul li.CurrentSection a:hover {
|
||||
padding-top:5px;
|
||||
background-color:#FFF;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
div#alphabet {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
background-color: #454;
|
||||
}
|
||||
div#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding: 0px 0px 0px 16px;
|
||||
border-width: 2px 0px 4px 0px;
|
||||
border-style: solid;
|
||||
border-color: #FFF;
|
||||
}
|
||||
div#alphabet ul li:after {
|
||||
content:" |";
|
||||
}
|
||||
div#alphabet ul li {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
div#alphabet ul li a {
|
||||
display:block;
|
||||
padding: 4px 8px 4px 8px;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
margin:0;
|
||||
text-decoration:none;
|
||||
color: #FFF;
|
||||
}
|
||||
div#alphabet ul li a:hover {
|
||||
background-color: #000;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Main Table
|
||||
----------------------------------------------------- */
|
||||
table {
|
||||
@@ -902,7 +905,7 @@ div#sourcerefs ol li ol {
|
||||
page-break-before:always;
|
||||
margin:0;
|
||||
padding:0;
|
||||
background:none;
|
||||
background-color: #FFF;
|
||||
}
|
||||
#treeContainer {
|
||||
position:relative;
|
||||
|
||||
@@ -70,6 +70,7 @@ img {
|
||||
background:none;
|
||||
}
|
||||
.content {
|
||||
padding-top: 1cm;
|
||||
background-color:#FAFAFF;
|
||||
}
|
||||
.content div.snapshot {
|
||||
@@ -176,43 +177,6 @@ a:visited {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
#alphabet {
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding:0 0 0 9px;
|
||||
border-top:solid 2px #000;
|
||||
border-bottom:solid 4px #000;
|
||||
background-color:#E0E0E9;
|
||||
}
|
||||
#alphabet ul li.letters {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
.letters:after {
|
||||
content:" |";
|
||||
}
|
||||
#alphabet ul li.letters a {
|
||||
display:block;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
color:#000;
|
||||
margin:0;
|
||||
padding:5px 5px;
|
||||
text-decoration:none;
|
||||
}
|
||||
#alphabet ul li.letters a:hover {
|
||||
background-color:#000;
|
||||
color:#FFF;
|
||||
}
|
||||
|
||||
/* Navigation
|
||||
----------------------------------------------------- */
|
||||
#navigation, #subnavigation {
|
||||
@@ -262,6 +226,44 @@ a:visited {
|
||||
border-width:0 0 1px 0;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
div#alphabet {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
background-color: #E0E0E9;
|
||||
}
|
||||
div#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding: 0px 0px 0px 16px;
|
||||
border-width: 2px 0px 4px 0px;
|
||||
border-style: solid;
|
||||
border-color: #000;
|
||||
}
|
||||
div#alphabet ul li:after {
|
||||
content:" |";
|
||||
}
|
||||
div#alphabet ul li {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
div#alphabet ul li a {
|
||||
display:block;
|
||||
padding: 4px 8px 4px 8px;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
margin:0;
|
||||
text-decoration:none;
|
||||
color: #000;
|
||||
}
|
||||
div#alphabet ul li a:hover {
|
||||
background-color: #000;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Main Table
|
||||
----------------------------------------------------- */
|
||||
table {
|
||||
|
||||
@@ -71,6 +71,7 @@ img {
|
||||
background:none;
|
||||
}
|
||||
.content {
|
||||
padding-top: 1cm;
|
||||
background-color:#FFFBE7;
|
||||
}
|
||||
.content div.snapshot {
|
||||
@@ -177,43 +178,6 @@ a:visited {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
#alphabet {
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding:0 0 0 9px;
|
||||
border-top:solid 2px #000;
|
||||
border-bottom:solid 4px #000;
|
||||
background-color:#FFE09F;
|
||||
}
|
||||
#alphabet ul li.letters {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
.letters:after {
|
||||
content:" |";
|
||||
}
|
||||
#alphabet ul li.letters a {
|
||||
display:block;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
color:#000;
|
||||
margin:0;
|
||||
padding:5px 5px;
|
||||
text-decoration:none;
|
||||
}
|
||||
#alphabet ul li.letters a:hover {
|
||||
background-color:#000;
|
||||
color:#FFF;
|
||||
}
|
||||
|
||||
/* Navigation
|
||||
----------------------------------------------------- */
|
||||
#navigation, #subnavigation {
|
||||
@@ -263,6 +227,44 @@ a:visited {
|
||||
border-width:0 0 1px 0;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
div#alphabet {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
background-color: #FFE09F;
|
||||
}
|
||||
div#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding: 0px 0px 0px 16px;
|
||||
border-width: 2px 0px 4px 0px;
|
||||
border-style: solid;
|
||||
border-color: #000;
|
||||
}
|
||||
div#alphabet ul li:after {
|
||||
content:" |";
|
||||
}
|
||||
div#alphabet ul li {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
div#alphabet ul li a {
|
||||
display:block;
|
||||
padding: 4px 8px 4px 8px;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
margin:0;
|
||||
text-decoration:none;
|
||||
color: #000;
|
||||
}
|
||||
div#alphabet ul li a:hover {
|
||||
background-color: #000;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Main Table
|
||||
----------------------------------------------------- */
|
||||
table {
|
||||
|
||||
@@ -71,6 +71,7 @@ img {
|
||||
background:none;
|
||||
}
|
||||
.content {
|
||||
padding-top: 1cm;
|
||||
background-color:#FFF;
|
||||
}
|
||||
.content div.snapshot {
|
||||
@@ -177,43 +178,6 @@ a:visited {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
#alphabet {
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding:0 0 0 9px;
|
||||
border-top:solid 2px #000;
|
||||
border-bottom:solid 4px #000;
|
||||
background-color:#EAEEF4;
|
||||
}
|
||||
#alphabet ul li.letters {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
.letters:after {
|
||||
content:" |";
|
||||
}
|
||||
#alphabet ul li.letters a {
|
||||
display:block;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
color:#000;
|
||||
margin:0;
|
||||
padding:5px 5px;
|
||||
text-decoration:none;
|
||||
}
|
||||
#alphabet ul li.letters a:hover {
|
||||
background-color:#000;
|
||||
color:#FFF;
|
||||
}
|
||||
|
||||
/* Navigation
|
||||
----------------------------------------------------- */
|
||||
#navigation, #subnavigation {
|
||||
@@ -263,6 +227,44 @@ a:visited {
|
||||
border-width:0 0 1px 0;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
div#alphabet {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
background-color: #EAFFF4;
|
||||
}
|
||||
div#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding: 0px 0px 0px 16px;
|
||||
border-width: 2px 0px 4px 0px;
|
||||
border-style: solid;
|
||||
border-color: #000;
|
||||
}
|
||||
div#alphabet ul li:after {
|
||||
content:" |";
|
||||
}
|
||||
div#alphabet ul li {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
div#alphabet ul li a {
|
||||
display:block;
|
||||
padding: 4px 8px 4px 8px;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
margin:0;
|
||||
text-decoration:none;
|
||||
color: #000;
|
||||
}
|
||||
div#alphabet ul li a:hover {
|
||||
background-color: #000;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Main Table
|
||||
----------------------------------------------------- */
|
||||
table {
|
||||
|
||||
+40
-38
@@ -81,7 +81,7 @@ img {
|
||||
.content {
|
||||
width:965px;
|
||||
margin:0 auto;
|
||||
padding-bottom:.5em;
|
||||
padding: 1cm 0px .5em 0px;
|
||||
background:url(../images/Web_Mainz_Mid.png) #FFF2C6 repeat;
|
||||
}
|
||||
.content div.snapshot {
|
||||
@@ -198,43 +198,6 @@ a:visited {
|
||||
margin:0 0 5px 50px;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
#alphabet {
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding:0 0 0 9px;
|
||||
border-top:solid 2px #000;
|
||||
border-bottom:solid 4px #000;
|
||||
background:url(../images/Web_Mainz_MidLight.png) #FFF2C6;
|
||||
}
|
||||
#alphabet ul li.letters {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
.letters:after {
|
||||
content:" |";
|
||||
}
|
||||
#alphabet ul li.letters a {
|
||||
display:block;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
color:#000;
|
||||
margin:0;
|
||||
padding:5px 5px;
|
||||
text-decoration:none;
|
||||
}
|
||||
#alphabet ul li.letters a:hover {
|
||||
background-color:#000;
|
||||
color:#FFF;
|
||||
}
|
||||
|
||||
/* Navigation
|
||||
----------------------------------------------------- */
|
||||
#navigation, #subnavigation {
|
||||
@@ -288,6 +251,45 @@ a:visited {
|
||||
border-width:0 0 1px 0;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
div#alphabet {
|
||||
width: 965px;
|
||||
margin: 0;
|
||||
background-color: #FFF2C6;
|
||||
}
|
||||
div#alphabet ul {
|
||||
padding: 0px 25px 0px 25px;
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding: 0px 0px 0px 16px;
|
||||
border-width: 2px 0px 4px 0px;
|
||||
border-style: solid;
|
||||
border-color: #000;
|
||||
}
|
||||
div#alphabet ul li:after {
|
||||
content:" |";
|
||||
}
|
||||
div#alphabet ul li {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
div#alphabet ul li a {
|
||||
display:block;
|
||||
padding: 4px 8px 4px 8px;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
margin:0;
|
||||
text-decoration:none;
|
||||
color: #000;
|
||||
}
|
||||
div#alphabet ul li a:hover {
|
||||
background-color: #000;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Main Table
|
||||
----------------------------------------------------- */
|
||||
table {
|
||||
|
||||
+56
-57
@@ -83,6 +83,7 @@ img {
|
||||
background:none;
|
||||
}
|
||||
.content {
|
||||
padding-top: 1cm;
|
||||
background-color:#FFF;
|
||||
}
|
||||
.content div.snapshot {
|
||||
@@ -203,75 +204,35 @@ p#user_header {
|
||||
background-color:#542;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
#alphabet {
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding:0 0 0 9px;
|
||||
border-top:solid 2px #000;
|
||||
border-bottom:solid 4px #000;
|
||||
background-color:#A97;
|
||||
}
|
||||
#alphabet ul li.letters {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
.letters:after {
|
||||
content:" |";
|
||||
}
|
||||
#alphabet ul li.letters a {
|
||||
display:block;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
color:#000;
|
||||
margin:0;
|
||||
padding:5px 5px;
|
||||
text-decoration:none;
|
||||
}
|
||||
#alphabet ul li.letters a:hover {
|
||||
background-color:#000;
|
||||
color:#FFF;
|
||||
}
|
||||
|
||||
/* Navigation
|
||||
----------------------------------------------------- */
|
||||
#navigation, #subnavigation {
|
||||
margin:0;
|
||||
padding:0;
|
||||
div#navigation, div#subnavigation {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#navigation ul, #subnavigation ul {
|
||||
div#navigation ul, div#subnavigation ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:32px;
|
||||
min-width: 900px;
|
||||
height: 40px;
|
||||
margin:0;
|
||||
padding:0 0 0 9px;
|
||||
background-color:#A97;
|
||||
border-bottom:solid 1px #542;
|
||||
padding: 0px 0px 0px 16px;
|
||||
border-bottom: solid 2px #5D835F;
|
||||
}
|
||||
#navigation ul li, #subnavigation ul li {
|
||||
margin:0;
|
||||
div#navigation ul li, div#subnavigation ul li {
|
||||
float:left;
|
||||
}
|
||||
#navigation ul li a, #subnavigation ul li a {
|
||||
display:block;
|
||||
div#navigation ul li a, div#subnavigation ul li a {
|
||||
display: block;
|
||||
padding: 12px 16px 14px 1px;
|
||||
float:left;
|
||||
font:normal 16px/100% serif;
|
||||
color:#542;
|
||||
font: .8em bold italic small-caps verdana, serif;
|
||||
color: #000;
|
||||
text-decoration:none;
|
||||
margin:0;
|
||||
padding:8px 13px;
|
||||
|
||||
}
|
||||
#navigation ul li a:hover, #subnavigation ul li a:hover {
|
||||
background-color:#C1B398;
|
||||
border-bottom:solid 1px #542;
|
||||
div#navigation ul li a:hover, div#subnavigation ul li a:hover {
|
||||
background-color: #C1B398;
|
||||
}
|
||||
#navigation ul li.CurrentSection a, #subnavigation ul li.CurrentSection a {
|
||||
font-size:19px;
|
||||
@@ -290,6 +251,44 @@ p#user_header {
|
||||
border-width:0 0 1px 0;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
div#alphabet {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
background-color: #A97;
|
||||
}
|
||||
div#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding: 0px 0px 0px 16px;
|
||||
border-width: 2px 0px 4px 0px;
|
||||
border-style: solid;
|
||||
border-color: #000;
|
||||
}
|
||||
div#alphabet ul li:after {
|
||||
content:" |";
|
||||
}
|
||||
div#alphabet ul li {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
div#alphabet ul li a {
|
||||
display:block;
|
||||
padding: 4px 8px 4px 8px;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
margin:0;
|
||||
text-decoration:none;
|
||||
color: #000;
|
||||
}
|
||||
div#alphabet ul li a:hover {
|
||||
background-color: #000;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Main Table
|
||||
----------------------------------------------------- */
|
||||
table.infolist {
|
||||
|
||||
@@ -67,7 +67,7 @@ img {
|
||||
.content div.snapshot {
|
||||
float:right;
|
||||
margin:1.6em;
|
||||
padding:0;
|
||||
padding-top: .5cm;
|
||||
background:none;
|
||||
}
|
||||
.content div.snapshot div.thumbnail {
|
||||
|
||||
+68
-77
@@ -204,7 +204,7 @@ span.preposition {
|
||||
----------------------------------------------------- */
|
||||
#header {
|
||||
margin:0;
|
||||
height:1.5cm;
|
||||
height: 60px;
|
||||
padding:0 0 .9em 0;
|
||||
background-color:#542;
|
||||
border-bottom:solid 2px #6AF364;
|
||||
@@ -284,99 +284,89 @@ p#user_header {
|
||||
padding:0;
|
||||
}
|
||||
|
||||
/* Navigation
|
||||
----------------------------------------------------- */
|
||||
div#navigation, div#subnavigation {
|
||||
width: 100%;
|
||||
}
|
||||
div#navigation ul, div#subnavigation ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height: 42px;
|
||||
margin:0;
|
||||
padding: 0px 0px 0px 20px;
|
||||
border-bottom: solid 2px #5D835F;
|
||||
}
|
||||
div#navigation ul li, div#subnavigation ul li {
|
||||
float:left;
|
||||
}
|
||||
body#WebCal divdiv#navigation ul li a {
|
||||
color: #FFF;
|
||||
}
|
||||
div#navigation ul li a, div#subnavigation ul li a {
|
||||
display: block;
|
||||
padding: 12px 10px 14px 1px;
|
||||
float:left;
|
||||
font:normal 16px/100% serif;
|
||||
color: #000;
|
||||
text-decoration:none;
|
||||
margin:0;
|
||||
}
|
||||
div#navigation ul li a:hover, div#subnavigation ul li a:hover {
|
||||
background-color: #C1B398;
|
||||
color: #000;
|
||||
}
|
||||
div#navigation ul li.CurrentSection a, div#subnavigation ul li.CurrentSection a {
|
||||
font-weight:bold;
|
||||
font-style: italic;
|
||||
background-color: #CCC;
|
||||
color: #000;
|
||||
}
|
||||
div#navigation ul li.CurrentSection a:hover {
|
||||
background-color: #000;
|
||||
color: #FFF;
|
||||
}
|
||||
div#subnavigation ul li.CurrentSection a {
|
||||
border-width: 0px 0px 2px 0px;
|
||||
border-color: #FFF;
|
||||
}
|
||||
|
||||
/* Alphabet Navigation
|
||||
----------------------------------------------------- */
|
||||
div#alphabet {
|
||||
padding:0;
|
||||
margin:0;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
background-color: #6AF364;
|
||||
}
|
||||
div#alphabet ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:24px;
|
||||
margin:0;
|
||||
padding:0 0 0 9px;
|
||||
border-top:solid 2px #000;
|
||||
border-bottom:solid 4px #000;
|
||||
background-color:#6AF364;
|
||||
padding: 0px 0px 0px 16px;
|
||||
border-width: 2px 0px 4px 0px;
|
||||
border-style: solid;
|
||||
border-color: #000;
|
||||
}
|
||||
div#alphabet ul li:after {
|
||||
content:" |";
|
||||
}
|
||||
div#alphabet ul li:before {
|
||||
content:" ";
|
||||
}
|
||||
div#alphabet ul li.letters {
|
||||
div#alphabet ul li {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
div#alphabet ul li.letters a {
|
||||
div#alphabet ul li a {
|
||||
display:block;
|
||||
padding: 4px 8px 4px 8px;
|
||||
float:left;
|
||||
font:bold 16px/100% sans;
|
||||
color:#000;
|
||||
margin:0;
|
||||
padding:5px 5px;
|
||||
text-decoration:none;
|
||||
color: #000;
|
||||
}
|
||||
div#alphabet ul li.letters a:hover {
|
||||
background-color:#000;
|
||||
color:#FFF;
|
||||
}
|
||||
|
||||
/* Navigation
|
||||
----------------------------------------------------- */
|
||||
#navigation, #subnavigation {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
#navigation ul, #subnavigation ul {
|
||||
list-style:none;
|
||||
min-width:770px;
|
||||
height:32px;
|
||||
margin:0;
|
||||
padding:0 0 0 9px;
|
||||
background-color:#FFF;
|
||||
border-bottom:solid 2px #000;
|
||||
}
|
||||
#navigation ul li, #subnavigation ul li {
|
||||
margin:0;
|
||||
float:left;
|
||||
}
|
||||
#navigation ul li a, #subnavigation ul li a {
|
||||
display:block;
|
||||
float:left;
|
||||
font:normal 16px/100% serif;
|
||||
color:#000;
|
||||
text-decoration:none;
|
||||
margin:0;
|
||||
padding:5px 5px;
|
||||
|
||||
}
|
||||
#navigation ul li a:hover, #subnavigation ul li a:hover {
|
||||
background-color:#C1B398;
|
||||
color:#000;
|
||||
border-top:solid 3px #C1B398;
|
||||
border-bottom:solid 8px #C1B398;
|
||||
}
|
||||
#navigation ul li.CurrentSection a, #subnavigation ul li.CurrentSection a {
|
||||
font-weight:bold;
|
||||
font-size:16px;
|
||||
margin-top:-6px;
|
||||
padding-top:11px;
|
||||
padding-bottom:8px;
|
||||
border-right:solid 1px #6AF364;
|
||||
border-left:solid 1px #6AF364;
|
||||
border-bottom:solid 4px #000;
|
||||
background-color:#000;
|
||||
color:#FFF;
|
||||
}
|
||||
#navigation ul li.CurrentSection a:hover {
|
||||
background-color:#228A22;
|
||||
border-bottom:solid 4px #228A22;
|
||||
}
|
||||
#subnavigation ul li.CurrentSection a {
|
||||
border-width:0 0 1px 0;
|
||||
div#alphabet ul li a:hover {
|
||||
background-color: #000;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Main Table
|
||||
@@ -1196,7 +1186,6 @@ div#pedigree {
|
||||
/* Calendar : General */
|
||||
body#WebCal {
|
||||
padding:0 14px;
|
||||
background-color:#542;
|
||||
}
|
||||
.calendar {
|
||||
empty-cells:show;
|
||||
@@ -1235,7 +1224,8 @@ body#WebCal {
|
||||
color:#FFF;
|
||||
}
|
||||
#CreatorInfo a:hover {
|
||||
color:#FFF;
|
||||
background-color: #C1B398;
|
||||
color: #000;
|
||||
}
|
||||
.calendar thead tr th.weekend,
|
||||
.calendar thead tr th.weekday {
|
||||
@@ -1246,13 +1236,14 @@ body#WebCal {
|
||||
}
|
||||
.calendar tfoot tr td {
|
||||
padding:.7em 5% 1em 5%;
|
||||
border-top:solid 2px #000;
|
||||
border-top: solid 1px #5D835F;
|
||||
vertical-align:middle;
|
||||
color:#453619;
|
||||
color: #000;
|
||||
background-color:#D8F3D6;
|
||||
}
|
||||
|
||||
/* Calendar : Date Numeral */
|
||||
/* Calendar : Date Numeral
|
||||
------------------------------------------- */
|
||||
.calendar tbody tr td div.date {
|
||||
float:right;
|
||||
display:block;
|
||||
|
||||
@@ -161,6 +161,10 @@ class GrampsType(object):
|
||||
if value in self._E2IMAP:
|
||||
self.__value = self._E2IMAP[value]
|
||||
self.__string = u''
|
||||
if self.__value == self._CUSTOM:
|
||||
#if the custom event is actually 'Custom' then we should save it
|
||||
# with that string value. That is, 'Custom' is in _E2IMAP
|
||||
self.__string = value
|
||||
else:
|
||||
self.__value = self._CUSTOM
|
||||
self.__string = value
|
||||
|
||||
@@ -106,6 +106,17 @@ class BasicPrimaryObject(BaseObject, PrivacyBase):
|
||||
"""
|
||||
return self.change
|
||||
|
||||
def set_change_time(self, change):
|
||||
"""
|
||||
Modify the time that the data was last changed.
|
||||
|
||||
The value must be in the format returned by the time.time() command.
|
||||
|
||||
@param change: new time
|
||||
@type change: int in format as time.time() command
|
||||
"""
|
||||
self.change = change
|
||||
|
||||
def get_change_display(self):
|
||||
"""
|
||||
Return the string representation of the last change time.
|
||||
|
||||
@@ -454,10 +454,9 @@ class LivingProxyDb(ProxyDbBase):
|
||||
new_person.set_gender(person.get_gender())
|
||||
new_person.set_gramps_id(person.get_gramps_id())
|
||||
new_person.set_handle(person.get_handle())
|
||||
new_person.set_change_time(person.get_change_time())
|
||||
new_person.set_family_handle_list(person.get_family_handle_list())
|
||||
new_person.set_parent_family_handle_list(
|
||||
person.get_parent_family_handle_list() )
|
||||
|
||||
return new_person
|
||||
|
||||
|
||||
|
||||
@@ -726,6 +726,8 @@ def sanitize_source_ref(db, source_ref):
|
||||
"""
|
||||
new_ref = SourceRef()
|
||||
new_ref.set_date_object(source_ref.get_date_object())
|
||||
new_ref.set_page(source_ref.get_page())
|
||||
new_ref.set_confidence_level(source_ref.get_confidence_level())
|
||||
new_ref.set_reference_handle(source_ref.get_reference_handle())
|
||||
copy_notes(db, source_ref, new_ref)
|
||||
|
||||
@@ -774,6 +776,7 @@ def sanitize_person(db,person):
|
||||
new_person.set_gender(person.get_gender())
|
||||
new_person.set_gramps_id(person.get_gramps_id())
|
||||
new_person.set_handle(person.get_handle())
|
||||
new_person.set_change_time(person.get_change_time())
|
||||
|
||||
# copy names if not private
|
||||
name = person.get_primary_name()
|
||||
@@ -864,6 +867,7 @@ def sanitize_source(db,source):
|
||||
new_source.set_abbreviation(source.get_abbreviation())
|
||||
new_source.set_gramps_id(source.get_gramps_id())
|
||||
new_source.set_handle(source.get_handle())
|
||||
new_source.set_change_time(source.get_change_time())
|
||||
new_source.set_marker(source.get_marker())
|
||||
new_source.set_data_map(source.get_data_map())
|
||||
|
||||
@@ -900,6 +904,7 @@ def sanitize_media(db,media):
|
||||
new_media.set_description(media.get_description())
|
||||
new_media.set_gramps_id(media.get_gramps_id())
|
||||
new_media.set_handle(media.get_handle())
|
||||
new_media.set_change_time(media.get_change_time())
|
||||
new_media.set_date_object(media.get_date_object())
|
||||
new_media.set_marker(media.get_marker())
|
||||
|
||||
@@ -928,6 +933,7 @@ def sanitize_place(db,place):
|
||||
new_place.set_title(place.get_title())
|
||||
new_place.set_gramps_id(place.get_gramps_id())
|
||||
new_place.set_handle(place.get_handle())
|
||||
new_place.set_change_time(place.get_change_time())
|
||||
new_place.set_longitude(place.get_longitude())
|
||||
new_place.set_latitude(place.get_latitude())
|
||||
new_place.set_main_location(place.get_main_location())
|
||||
@@ -963,6 +969,7 @@ def sanitize_event(db,event):
|
||||
new_event.set_handle(event.get_handle())
|
||||
new_event.set_date_object(event.get_date_object())
|
||||
new_event.set_marker(event.get_marker())
|
||||
new_event.set_change_time(event.get_change_time())
|
||||
|
||||
copy_source_ref_list(db,event, new_event)
|
||||
copy_notes(db,event, new_event)
|
||||
@@ -996,6 +1003,7 @@ def sanitize_family(db,family):
|
||||
new_family.set_handle(family.get_handle())
|
||||
new_family.set_marker(family.get_marker())
|
||||
new_family.set_relationship(family.get_relationship())
|
||||
new_family.set_change_time(family.get_change_time())
|
||||
|
||||
# Copy the father handle.
|
||||
father_handle = family.get_father_handle()
|
||||
@@ -1063,6 +1071,7 @@ def sanitize_repository(db,repository):
|
||||
new_repository.set_name(repository.get_name())
|
||||
new_repository.set_gramps_id(repository.get_gramps_id())
|
||||
new_repository.set_handle(repository.get_handle())
|
||||
new_repository.set_change_time(repository.get_change_time())
|
||||
new_repository.set_marker(repository.get_marker())
|
||||
|
||||
copy_notes(db,repository, new_repository)
|
||||
|
||||
@@ -66,8 +66,8 @@ def delete_person_from_database(db, person, trans):
|
||||
|
||||
for phandle in person_list:
|
||||
p = db.get_person_from_handle(phandle)
|
||||
p.remove_handle_references('Person', handle)
|
||||
db.commit_person(person, trans)
|
||||
p.remove_handle_references('Person', [handle])
|
||||
db.commit_person(p, trans)
|
||||
db.remove_person(handle, trans)
|
||||
|
||||
def remove_family_relationships(db, family_handle, trans=None):
|
||||
|
||||
@@ -2194,12 +2194,13 @@ Mapstraction.prototype.getCenter = function() {
|
||||
/**
|
||||
* setCenter sets the central point of the map
|
||||
* @param {LatLonPoint} point The point at which to center the map
|
||||
* @options {hash} optional parameters, such as {pan:true}
|
||||
*/
|
||||
Mapstraction.prototype.setCenter = function(point) {
|
||||
Mapstraction.prototype.setCenter = function(point, options) {
|
||||
if(this.loaded[this.api] === false) {
|
||||
var me = this;
|
||||
this.onload[this.api].push( function() {
|
||||
me.setCenter(point);
|
||||
me.setCenter(point, options);
|
||||
} );
|
||||
return;
|
||||
}
|
||||
@@ -2215,14 +2216,16 @@ Mapstraction.prototype.setCenter = function(point) {
|
||||
break;
|
||||
case 'google':
|
||||
case 'openstreetmap':
|
||||
map.setCenter(point.toGoogle());
|
||||
break;
|
||||
if(options != null && options['pan']) { map.panTo(point.toGoogle()); }
|
||||
else { map.setCenter(point.toGoogle()); }
|
||||
break;
|
||||
case 'openlayers':
|
||||
map.setCenter(point.toOpenLayers());
|
||||
break;
|
||||
case 'microsoft':
|
||||
map.SetCenter(point.toMicrosoft());
|
||||
break;
|
||||
if(options != null && options['pan']) { map.PanToLatLong(point.toMicrosoft()); }
|
||||
else { map.SetCenter(point.toMicrosoft()); }
|
||||
break;
|
||||
case 'multimap':
|
||||
map.goToPosition(point.toMultiMap());
|
||||
break;
|
||||
@@ -2463,7 +2466,7 @@ Mapstraction.prototype.visibleCenterAndZoom = function()
|
||||
|
||||
/**
|
||||
* Automatically sets center and zoom level to show all polylines
|
||||
* Takes into account radious of polyline
|
||||
* Takes into account radius of polyline
|
||||
* @param {Int} radius
|
||||
*/
|
||||
Mapstraction.prototype.polylineCenterAndZoom = function(radius)
|
||||
@@ -2478,6 +2481,8 @@ Mapstraction.prototype.polylineCenterAndZoom = function(radius)
|
||||
return;
|
||||
}
|
||||
|
||||
radius = (radius == null) ? 0 : radius;
|
||||
|
||||
var lat_max = -90;
|
||||
var lat_min = 90;
|
||||
var lon_max = -180;
|
||||
@@ -4546,6 +4551,48 @@ Marker.prototype.openBubble = function() {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* closeBubble closes the infoBubble
|
||||
*/
|
||||
Marker.prototype.closeBubble = function() {
|
||||
if(this.mapstraction.loaded[this.api] === false) {
|
||||
var my_marker = this;
|
||||
this.mapstraction.onload[this.api].push( function() {
|
||||
my_marker.closeBubble();
|
||||
} );
|
||||
return;
|
||||
}
|
||||
|
||||
if( this.api) {
|
||||
switch (this.api) {
|
||||
case 'yahoo':
|
||||
var ypin = this.proprietary_marker;
|
||||
ypin.closeSmartWindow();
|
||||
break;
|
||||
case 'google':
|
||||
case 'openstreetmap':
|
||||
var gpin = this.proprietary_marker;
|
||||
gpin.closeInfoWindow();
|
||||
break;
|
||||
case 'microsoft':
|
||||
// The following works with v6.2, but need to first update way Mapstraction adds MS markers
|
||||
var pin = this.proprietary_marker;
|
||||
this.map.HideInfoBox();
|
||||
break;
|
||||
case 'multimap':
|
||||
//closeInfoBox?
|
||||
break;
|
||||
case 'mapquest':
|
||||
// ???
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if(this.debug) {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* hide the marker
|
||||
*/
|
||||
@@ -4866,7 +4913,7 @@ Polyline.prototype.toMap24 = function() {
|
||||
var m24poly;
|
||||
var m24longs = "";
|
||||
var m24lats = "";
|
||||
for (var i=0; i<this.points.length; i++) {
|
||||
for (var i=0, length = this.points.length; i<length; i++) {
|
||||
if(i) {
|
||||
m24longs += "|";
|
||||
m24lats += "|";
|
||||
@@ -4874,7 +4921,7 @@ Polyline.prototype.toMap24 = function() {
|
||||
m24longs += (this.points[i].lon*60);
|
||||
m24lats += (this.points[i].lat*60);
|
||||
}
|
||||
if (this.closed || this.gpoints[0].equals(this.gpoints[length-1])) {
|
||||
if (this.closed || this.points[0].equals(this.points[length-1])) {
|
||||
m24poly = new Map24.Polygon({
|
||||
Longitudes: m24longs,
|
||||
Latitudes: m24lats,
|
||||
@@ -4934,7 +4981,7 @@ Polyline.prototype.toMultiMap = function() {
|
||||
* @returns a LineOverlay/PolygonOverlay
|
||||
*/
|
||||
Polyline.prototype.toMapQuest = function() {
|
||||
if (this.closed || this.points[0].equals(this.points[length-1])) {
|
||||
if (this.closed || this.points[0].equals(this.points[this.points.length-1])) {
|
||||
var mqpoly = new MQA.PolygonOverlay();
|
||||
mqpoly.setFillColor(this.color || "#E90000");
|
||||
mqpoly.setFillColorAlpha(this.opacity || 0.3);
|
||||
@@ -5091,8 +5138,8 @@ Polyline.prototype.simplify = function(tolerance) {
|
||||
reduced[0] = this.points[0];
|
||||
|
||||
var markerPoint = 0;
|
||||
|
||||
for (var i = 1; i < this.points.length-1; i++)
|
||||
var length = this.points.length;
|
||||
for (var i = 1; i < length-1; i++)
|
||||
if (this.points[i].distance(this.points[markerPoint]) >= tolerance)
|
||||
{
|
||||
reduced[reduced.length] = this.points[i];
|
||||
@@ -5211,40 +5258,40 @@ Mapstraction.prototype.enableScrollWheelZoom = function() {
|
||||
* Currently only implemented in Google
|
||||
* @param {object} polygon
|
||||
*/
|
||||
Mapstraction.prototype.addPolygon = function(polygon) {
|
||||
if(this.loaded[this.api] == false)
|
||||
{
|
||||
myself = this;
|
||||
this.onload[this.api].push(function()
|
||||
{
|
||||
myself.addPolygon(polygon);
|
||||
});
|
||||
return;
|
||||
}
|
||||
Mapstraction.prototype.addPolygon = function(polygon) {
|
||||
if(this.loaded[this.api] == false)
|
||||
{
|
||||
myself = this;
|
||||
this.onload[this.api].push(function()
|
||||
{
|
||||
myself.addPolygon(polygon);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var map = this.maps[this.api];
|
||||
var map = this.maps[this.api];
|
||||
|
||||
switch (this.api)
|
||||
{
|
||||
case 'google':
|
||||
case 'openstreetmap':
|
||||
var gpoints = [];
|
||||
switch (this.api)
|
||||
{
|
||||
case 'google':
|
||||
case 'openstreetmap':
|
||||
var gpoints = [];
|
||||
|
||||
for (var i = 0; i < polygon.points.length; i++)
|
||||
gpoints.push(polygon.points[i].toGoogle());
|
||||
for (var i = 0; i < polygon.points.length; i++)
|
||||
gpoints.push(polygon.points[i].toGoogle());
|
||||
|
||||
gpolygon = new GPolygon(gpoints, polygon.color, 0, polygon.opacity, polygon.color, polygon.opacity);
|
||||
polygon.setChild(gpolygon);
|
||||
map.addOverlay(gpolygon);
|
||||
this.polylines.push(polygon);
|
||||
break;
|
||||
default:
|
||||
if(this.debug) {
|
||||
alert(api + ' not supported by Mapstration.addPolygon');
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
gpolygon = new GPolygon(gpoints, polygon.color, 0, polygon.opacity, polygon.color, polygon.opacity);
|
||||
polygon.setChild(gpolygon);
|
||||
map.addOverlay(gpolygon);
|
||||
this.polylines.push(polygon);
|
||||
break;
|
||||
default:
|
||||
if(this.debug) {
|
||||
alert(api + ' not supported by Mapstration.addPolygon');
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
///////////////
|
||||
// Radius //
|
||||
|
||||
+24
-11
@@ -106,27 +106,30 @@ def _initialize_options(options, dbstate):
|
||||
menu: The Menu class
|
||||
dbase: the database the options will be applied to
|
||||
"""
|
||||
dbase = dbstate.get_database()
|
||||
if not hasattr(options, "menu"):
|
||||
return
|
||||
dbase = dbstate.get_database()
|
||||
menu = options.menu
|
||||
|
||||
for name in menu.get_all_option_names():
|
||||
option = menu.get_option_by_name(name)
|
||||
value = option.get_value()
|
||||
|
||||
if isinstance(option, PersonOption):
|
||||
person = dbstate.get_active_person()
|
||||
option.set_value(person.get_gramps_id())
|
||||
if not dbase.get_person_from_gramps_id(value):
|
||||
person = dbstate.get_active_person()
|
||||
option.set_value(person.get_gramps_id())
|
||||
|
||||
elif isinstance(option, FamilyOption):
|
||||
person = dbstate.get_active_person()
|
||||
family_list = person.get_family_handle_list()
|
||||
if family_list:
|
||||
family_handle = family_list[0]
|
||||
else:
|
||||
family_handle = dbase.get_family_handles()[0]
|
||||
family = dbase.get_family_from_handle(family_handle)
|
||||
option.set_value(family.get_gramps_id())
|
||||
if not dbase.get_family_from_gramps_id(value):
|
||||
person = dbstate.get_active_person()
|
||||
family_list = person.get_family_handle_list()
|
||||
if family_list:
|
||||
family_handle = family_list[0]
|
||||
else:
|
||||
family_handle = dbase.get_family_handles()[0]
|
||||
family = dbase.get_family_from_handle(family_handle)
|
||||
option.set_value(family.get_gramps_id())
|
||||
|
||||
def _get_subject(options, dbase):
|
||||
"""
|
||||
@@ -794,6 +797,16 @@ class BookReportSelector(ManagedWindow.ManagedWindow):
|
||||
name = saved_item.get_name()
|
||||
item = BookItem(self.db, name)
|
||||
item.option_class = saved_item.option_class
|
||||
|
||||
# The option values were loaded magically by the book parser.
|
||||
# But they still need to be applied to the menu options.
|
||||
opt_dict = item.option_class.handler.options_dict
|
||||
menu = item.option_class.menu
|
||||
for optname in opt_dict:
|
||||
menu_option = menu.get_option_by_name(optname)
|
||||
if menu_option:
|
||||
menu_option.set_value(opt_dict[optname])
|
||||
|
||||
_initialize_options(item.option_class, self.dbstate)
|
||||
item.set_style_name(saved_item.get_style_name())
|
||||
self.book.append_item(item)
|
||||
|
||||
+16
-15
@@ -34,7 +34,8 @@ from TransUtils import sgettext as _
|
||||
# GRAMPS modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gen.lib import ChildRefType, Date, EventType, Name
|
||||
import gen.lib
|
||||
from gen.lib import ChildRefType, Date, EventType, Name, EventRoleType
|
||||
import BaseDoc
|
||||
from BasicUtils import name_displayer
|
||||
from DataViews import register, Gramplet
|
||||
@@ -142,9 +143,13 @@ def _find_records(db, filter, callname):
|
||||
divorce_date = None
|
||||
for event_ref in family.get_event_ref_list():
|
||||
event = db.get_event_from_handle(event_ref.ref)
|
||||
if event.get_type() == EventType.MARRIAGE:
|
||||
if event.get_type() == gen.lib.EventType.MARRIAGE and \
|
||||
(event_ref.get_role() == gen.lib.EventRoleType.FAMILY or
|
||||
event_ref.get_role() == gen.lib.EventRoleType.PRIMARY ):
|
||||
marriage_date = event.get_date_object()
|
||||
elif event.get_type() == EventType.DIVORCE:
|
||||
elif event.get_type() == gen.lib.EventType.DIVORCE and \
|
||||
(event_ref.get_role() == gen.lib.EventRoleType.FAMILY or
|
||||
event_ref.get_role() == gen.lib.EventRoleType.PRIMARY ):
|
||||
divorce_date = event.get_date_object()
|
||||
|
||||
if _good_date(marriage_date):
|
||||
@@ -226,9 +231,13 @@ def _find_records(db, filter, callname):
|
||||
divorce_date = None
|
||||
for event_ref in family.get_event_ref_list():
|
||||
event = db.get_event_from_handle(event_ref.ref)
|
||||
if event.get_type() == EventType.MARRIAGE:
|
||||
if event.get_type() == gen.lib.EventType.MARRIAGE and \
|
||||
(event_ref.get_role() == gen.lib.EventRoleType.FAMILY or
|
||||
event_ref.get_role() == gen.lib.EventRoleType.PRIMARY ):
|
||||
marriage_date = event.get_date_object()
|
||||
elif event.get_type() == EventType.DIVORCE:
|
||||
if event and event.get_type() == gen.lib.EventType.DIVORCE and \
|
||||
(event_ref.get_role() == gen.lib.EventRoleType.FAMILY or
|
||||
event_ref.get_role() == gen.lib.EventRoleType.PRIMARY ):
|
||||
divorce_date = event.get_date_object()
|
||||
|
||||
father_death_date = _find_death_date(db, father)
|
||||
@@ -326,19 +335,11 @@ class RecordsGramplet(Gramplet):
|
||||
self.set_tooltip(_("Double-click name for details"))
|
||||
self.set_text(_("No Family Tree loaded."))
|
||||
|
||||
|
||||
def db_changed(self):
|
||||
self.update()
|
||||
#self.dbstate.db.connect('person-add', self.update)
|
||||
#self.dbstate.db.connect('person-delete', self.update)
|
||||
#self.dbstate.db.connect('person-update', self.update)
|
||||
#self.dbstate.db.connect('family-add', self.update)
|
||||
#self.dbstate.db.connect('family-delete', self.update)
|
||||
#self.dbstate.db.connect('family-update', self.update)
|
||||
|
||||
self.dbstate.db.connect('person-rebuild', self.update)
|
||||
self.dbstate.db.connect('family-rebuild', self.update)
|
||||
|
||||
def main(self):
|
||||
|
||||
self.set_text(_("Processing...") + "\n")
|
||||
yield True
|
||||
records = _find_records(self.dbstate.db, None,
|
||||
|
||||
@@ -134,7 +134,7 @@ class ODFDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc):
|
||||
self.cntnt.write('xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" ')
|
||||
self.cntnt.write('xmlns:dom="http://www.w3.org/2001/xml-events" ')
|
||||
self.cntnt.write('xmlns:xforms="http://www.w3.org/2002/xforms" ')
|
||||
self.cntnt.write('office:class="text" office:version="1.0">\n')
|
||||
self.cntnt.write('office:version="1.0">\n')
|
||||
self.cntnt.write('<office:scripts/>\n')
|
||||
self.cntnt.write('<office:font-face-decls>\n')
|
||||
self.cntnt.write('<style:font-face style:name="Courier" svg:font-family="Courier" ')
|
||||
@@ -187,7 +187,7 @@ class ODFDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc):
|
||||
self.cntnt.write('svg:fill-color="#%02x%02x%02x" ' % style.get_color())
|
||||
self.cntnt.write('draw:fill-color="#%02x%02x%02x" ' % style.get_fill_color())
|
||||
self.cntnt.write('draw:shadow="hidden" ')
|
||||
self.cntnt.write('style:run-through="background" ')
|
||||
self.cntnt.write('style:run-through="foreground" ')
|
||||
self.cntnt.write('style:vertical-pos="from-top" ')
|
||||
self.cntnt.write('style:vertical-rel="paragraph" ')
|
||||
self.cntnt.write('style:horizontal-pos="from-left" ')
|
||||
@@ -206,7 +206,7 @@ class ODFDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc):
|
||||
self.cntnt.write('draw:textarea-horizontal-align="center" ')
|
||||
self.cntnt.write('draw:textarea-vertical-align="middle" ')
|
||||
self.cntnt.write('draw:shadow="hidden" ')
|
||||
self.cntnt.write('style:run-through="background" ')
|
||||
self.cntnt.write('style:run-through="foreground" ')
|
||||
self.cntnt.write('style:vertical-pos="from-top" ')
|
||||
self.cntnt.write('style:vertical-rel="paragraph" ')
|
||||
self.cntnt.write('style:horizontal-pos="from-left" ')
|
||||
@@ -221,7 +221,7 @@ class ODFDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc):
|
||||
self.cntnt.write('style:family="graphic">\n')
|
||||
self.cntnt.write('\t<style:graphic-properties draw:stroke="none" ')
|
||||
self.cntnt.write('draw:fill="none" draw:shadow="hidden" ')
|
||||
self.cntnt.write('style:run-through="background" ')
|
||||
self.cntnt.write('style:run-through="foreground" ')
|
||||
self.cntnt.write('style:vertical-pos="from-top" ')
|
||||
self.cntnt.write('style:vertical-rel="paragraph" ')
|
||||
self.cntnt.write('style:horizontal-pos="from-left" ')
|
||||
@@ -961,8 +961,6 @@ class ODFDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc):
|
||||
self.meta.write('<dc:date>')
|
||||
self.meta.write(self.time)
|
||||
self.meta.write('</dc:date>\n')
|
||||
self.meta.write('<dc:keyword>')
|
||||
self.meta.write('</dc:keyword>\n')
|
||||
self.meta.write('<meta:print-date>0-00-00T00:00:00</meta:print-date>\n')
|
||||
self.meta.write('<dc:language>%s</dc:language>\n' % self.lang)
|
||||
self.meta.write('<meta:editing-cycles>1</meta:editing-cycles>\n')
|
||||
@@ -1023,10 +1021,10 @@ class ODFDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc):
|
||||
|
||||
self.cntnt.write('<draw:polygon draw:style-name="%s" draw:layer="layout" ' % style)
|
||||
self.cntnt.write('draw:z-index="1" ')
|
||||
x = int((minx)*1000)
|
||||
y = int((miny)*1000)
|
||||
x = float(minx)
|
||||
y = float(miny)
|
||||
|
||||
self.cntnt.write('svg:x="%d" svg:y="%d" ' % (x, y))
|
||||
self.cntnt.write('svg:x="%2fcm" svg:y="%2fcm" ' % (x, y))
|
||||
self.cntnt.write('svg:viewBox="0 0 %d %d" ' % (int((maxx-minx)*1000), int((maxy-miny)*1000)))
|
||||
self.cntnt.write('svg:width="%.4fcm" ' % (maxx-minx))
|
||||
self.cntnt.write('svg:height="%.4fcm" ' % (maxy-miny))
|
||||
@@ -1072,10 +1070,10 @@ class ODFDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc):
|
||||
self.cntnt.write('svg:y="%.2fcm">' % float(y))
|
||||
self.cntnt.write('<draw:text-box> ' )
|
||||
self.cntnt.write('<text:p text:style-name="F%s">' % para_name)
|
||||
self.cntnt.write('<text:span text:style-name="F%s"' % para_name)
|
||||
self.cntnt.write(' fo:max-height="%.2f">' % font.get_size() )
|
||||
self.cntnt.write('<text:span text:style-name="F%s">' % para_name)
|
||||
self.cntnt.write(escape(text, _esc_map))
|
||||
self.cntnt.write('</text:span></text:p>')
|
||||
self.cntnt.write('</text:span>')
|
||||
self.cntnt.write('</text:p>')
|
||||
self.cntnt.write('</draw:text-box>\n')
|
||||
self.cntnt.write('</draw:frame>\n')
|
||||
|
||||
|
||||
@@ -466,7 +466,7 @@ class AncestorTreeOptions(MenuReportOptions):
|
||||
pid.set_help(_("The center person for the tree"))
|
||||
menu.add_option(category_name, "pid", pid)
|
||||
|
||||
max_gen = NumberOption(_("Generations"), 10, 1, 15)
|
||||
max_gen = NumberOption(_("Generations"), 10, 1, 50)
|
||||
max_gen.set_help(_("The number of generations to include in the tree"))
|
||||
menu.add_option(category_name, "maxgen", max_gen)
|
||||
|
||||
|
||||
@@ -319,11 +319,15 @@ class Calendar(Report):
|
||||
for event_ref in fam.get_event_ref_list():
|
||||
event = self.database.get_event_from_handle(event_ref.ref)
|
||||
if event.type in [gen.lib.EventType.MARRIAGE,
|
||||
gen.lib.EventType.MARR_ALT]:
|
||||
gen.lib.EventType.MARR_ALT] and \
|
||||
(event_ref.get_role() == gen.lib.EventRoleType.FAMILY or
|
||||
event_ref.get_role() == gen.lib.EventRoleType.PRIMARY ):
|
||||
are_married = event
|
||||
elif event.type in [gen.lib.EventType.DIVORCE,
|
||||
gen.lib.EventType.ANNULMENT,
|
||||
gen.lib.EventType.DIV_FILING]:
|
||||
gen.lib.EventType.ANNULMENT,
|
||||
gen.lib.EventType.DIV_FILING] and \
|
||||
(event_ref.get_role() == gen.lib.EventRoleType.FAMILY or
|
||||
event_ref.get_role() == gen.lib.EventRoleType.PRIMARY ):
|
||||
are_married = None
|
||||
if are_married is not None:
|
||||
for event_ref in fam.get_event_ref_list():
|
||||
@@ -402,8 +406,13 @@ class CalendarOptions(MenuReportOptions):
|
||||
|
||||
country = EnumeratedListOption(_("Country for holidays"), 0)
|
||||
holiday_table = libholiday.HolidayTable()
|
||||
countries = holiday_table.get_countries()
|
||||
countries.sort()
|
||||
if (len(countries) == 0 or
|
||||
(len(countries) > 0 and countries[0] != '')):
|
||||
countries.insert(0, '')
|
||||
count = 0
|
||||
for c in holiday_table.get_countries():
|
||||
for c in countries:
|
||||
country.add_item(count, c)
|
||||
count += 1
|
||||
country.set_help(_("Select the country to see associated holidays"))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user