* src/Date.py: Added "set_year" function

* src/Utils.py: qualifiy Date calls, eliminate string
module usage
* src/edit_sm.png: new image
* src/Makefile.am: install edit_sm.png
* src/gramps_main.py: update relationship calculator
on database change
* src/Ancestors.py: initialize born_info


svn: r3687
This commit is contained in:
Don Allingham 2004-10-29 00:49:40 +00:00
parent b8daa8f930
commit 24946bfd7f
8 changed files with 58 additions and 39 deletions

View File

@ -1,3 +1,13 @@
2004-10-28 Don Allingham <dallingham@users.sourceforge.net>
* src/Date.py: Added "set_year" function
* src/Utils.py: qualifiy Date calls, eliminate string
module usage
* src/edit_sm.png: new image
* src/Makefile.am: install edit_sm.png
* src/gramps_main.py: update relationship calculator
on database change
* src/Ancestors.py: initialize born_info
2004-10-28 Alex Roitman <shura@alex.neuro.umn.edu> 2004-10-28 Alex Roitman <shura@alex.neuro.umn.edu>
* src/plugins/DetDescendantReport.py: New Date usage. * src/plugins/DetDescendantReport.py: New Date usage.

View File

@ -29,37 +29,37 @@ import gtk
import gobject import gobject
def fill_combo(combo,data_list): def fill_combo(combo,data_list):
store = gtk.ListStore(gobject.TYPE_STRING) store = gtk.ListStore(gobject.TYPE_STRING)
for data in data_list: for data in data_list:
store.append(row=[data]) store.append(row=[data])
combo.set_model(store) combo.set_model(store)
combo.set_text_column(0) combo.set_text_column(0)
completion = gtk.EntryCompletion() completion = gtk.EntryCompletion()
completion.set_model(store) completion.set_model(store)
completion.set_minimum_key_length(1) completion.set_minimum_key_length(1)
completion.set_text_column(0) completion.set_text_column(0)
combo.child.set_completion(completion) combo.child.set_completion(completion)
def fill_entry(entry,data_list): def fill_entry(entry,data_list):
store = gtk.ListStore(gobject.TYPE_STRING) store = gtk.ListStore(gobject.TYPE_STRING)
for data in data_list: for data in data_list:
store.append(row=[data]) store.append(row=[data])
completion = gtk.EntryCompletion() completion = gtk.EntryCompletion()
completion.set_model(store) completion.set_model(store)
completion.set_minimum_key_length(1) completion.set_minimum_key_length(1)
completion.set_text_column(0) completion.set_text_column(0)
entry.set_completion(completion) entry.set_completion(completion)
def fill_option_text(combobox,data): def fill_option_text(combobox,data):
store = gtk.ListStore(gobject.TYPE_STRING) store = gtk.ListStore(gobject.TYPE_STRING)
for item in data: for item in data:
store.append(row=[item]) store.append(row=[item])
combobox.set_model(store) combobox.set_model(store)
combobox.set_active(0) combobox.set_active(0)
def get_option(combobox): def get_option(combobox):
store = combobox.get_model() store = combobox.get_model()
return store.get_value(combobox.get_active_iter(),0) return store.get_value(combobox.get_active_iter(),0)

View File

@ -317,6 +317,11 @@ class Date:
""" """
return self._get_low_item(_POS_YR) return self._get_low_item(_POS_YR)
def set_year(self,year):
"""
"""
self.dateval = self.dateval[0:2] + (year,) + self.dateval[3:]
def get_year_valid(self): def get_year_valid(self):
return self._get_low_item_valid(_POS_YR) return self._get_low_item_valid(_POS_YR)

View File

@ -122,6 +122,7 @@ GRAPHICS = \
bad.png\ bad.png\
caution.png\ caution.png\
edit.png\ edit.png\
edit_sm.png \
family48.png\ family48.png\
good.png\ good.png\
home.png\ home.png\
@ -154,4 +155,4 @@ pycheck:
docs: docs:
epydoc -o doc --url http://gramps.sourceforge.net --name GRAMPS --html $(docfiles) epydoc -o doc --url http://gramps.sourceforge.net --name GRAMPS --html $(docfiles)
epydoc --pdf $(docfiles) epydoc --pdf $(docfiles)

View File

@ -25,7 +25,6 @@
# Standard python modules # Standard python modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import string
import os import os
import locale import locale
@ -43,7 +42,6 @@ import gnome
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import const import const
import RelImage
import GrampsMime import GrampsMime
import Date import Date
@ -257,7 +255,7 @@ def view_photo(photo):
except: except:
return return
args = string.split(prog) args = prog.split()
args.append(photo.get_path()) args.append(photo.get_path())
if os.fork() == 0: if os.fork() == 0:
@ -269,10 +267,10 @@ def view_photo(photo):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def strip_id(text): def strip_id(text):
index = string.rfind(text,'[') index = text.rfind('[')
if (index > 0): if (index > 0):
text = text[:index] text = text[:index]
text = string.rstrip(text) text = text.rstrip()
return text return text
def nautilus_icon(icon,mime_type): def nautilus_icon(icon,mime_type):
@ -502,8 +500,8 @@ def bold_label(label):
def unbold_label(label): def unbold_label(label):
text = unicode(label.get_text()) text = unicode(label.get_text())
text = string.replace(text,'<b>','') text = text.replace('<b>','')
text = string.replace(text,'</b>','') text = text.replace('</b>','')
label.set_text(text) label.set_text(text)
label.set_use_markup(0) label.set_use_markup(0)
@ -564,15 +562,17 @@ def probably_alive(person,db):
child_birth = db.get_event_from_handle(child.birth_handle) child_birth = db.get_event_from_handle(child.birth_handle)
dobj = child_birth.get_date_object() dobj = child_birth.get_date_object()
if dobj.get_start_date() != Date.EMPTY: if dobj.get_start_date() != Date.EMPTY:
d = Date(dobj) d = Date.Date(dobj)
d.set_year(d.get_year() - years) val = d.get_start_date()
val = (val[0],val[1],d.get_year() - years,val[3])
d.set_year(val)
if not not_too_old (d): if not not_too_old (d):
return True return True
if child.death_handle: if child.death_handle:
child_death = db.get_event_from_handle(child.death_handle) child_death = db.get_event_from_handle(child.death_handle)
dobj = child_death.get_date_object() dobj = child_death.get_date_object()
if dobj.get_start_date != Date.EMPTY: if dobj.get_start_date() != Date.EMPTY:
if not not_too_old (dobj): if not not_too_old (dobj):
return True return True
@ -627,7 +627,7 @@ def probably_alive(person,db):
if sp_birth_handle: if sp_birth_handle:
spouse_birth = db.get_event_from_handle(sp_birth_handle) spouse_birth = db.get_event_from_handle(sp_birth_handle)
if not spouse_birth.get_date().is_empty(): if not spouse_birth.get_date().is_empty():
d = Date(spouse_birth.get_date_object()) d = Date.Date(spouse_birth.get_date_object())
d.set_year(d.get_year() + max_age_difference) d.set_year(d.get_year() + max_age_difference)
if not not_too_old (d): if not not_too_old (d):
return False return False
@ -635,7 +635,7 @@ def probably_alive(person,db):
if sp_death_handle: if sp_death_handle:
spouse_death = db.get_event_from_handle(sp_death_handle) spouse_death = db.get_event_from_handle(sp_death_handle)
if spouse_death.get_date() != "": if spouse_death.get_date() != "":
d = Date(spouse_death.get_date_object()) d = Date.Date(spouse_death.get_date_object())
d.set_year (d.get_year() - min_generation) d.set_year (d.get_year() - min_generation)
if not not_too_old (d): if not not_too_old (d):
return False return False

BIN
src/edit_sm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1329,6 +1329,7 @@ class Gramps:
(name,plist) = self.relationship.get_relationship( (name,plist) = self.relationship.get_relationship(
default_person, default_person,
self.active_person) self.active_person)
if name: if name:
if plist == None: if plist == None:
return name return name
@ -1510,6 +1511,7 @@ class Gramps:
self.place_view.change_db(self.db) self.place_view.change_db(self.db)
self.source_view.change_db(self.db) self.source_view.change_db(self.db)
self.media_view.change_db(self.db) self.media_view.change_db(self.db)
self.relationship = self.RelClass(self.db)
self.change_active_person(self.find_initial_person()) self.change_active_person(self.find_initial_person())
self.statusbar.set_progress_percentage(0.0) self.statusbar.set_progress_percentage(0.0)

View File

@ -513,6 +513,7 @@ class ComprehensiveAncestorsReport (Report.Report):
def long_born_died (self, person): def long_born_died (self, person):
ret = '' ret = ''
born_info = None
birth_handle = person.get_birth_handle () birth_handle = person.get_birth_handle ()
if birth_handle: if birth_handle:
birth = self.database.get_event_from_handle(birth_handle) birth = self.database.get_event_from_handle(birth_handle)