Bug fixes

svn: r1466
This commit is contained in:
Don Allingham 2003-04-20 03:52:54 +00:00
parent d432b3d83a
commit 7978cf7317
9 changed files with 56 additions and 43 deletions

View File

@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
dnl May need to run automake && aclocal first
AC_INIT(src/gramps.py)
AM_INIT_AUTOMAKE(gramps, 0.9.1)
RELEASE=rc1
RELEASE=1
VERSIONSTRING=$VERSION
if test x"$RELEASE" != "x"

View File

@ -143,12 +143,12 @@ class AutoCombo(AutoCompBase):
AutoCompBase.__init__(self,widget,plist,source)
self.entry = widget
widget.entry.connect("insert-text",self.insert_text)
# button1 = widget.get_children()[1]
# button1.connect("pressed",self.build_list)
# button1.connect("released",self.setval)
self.vals = [""]
self.inb = 0
if len(plist) > 0:
widget.set_popdown_strings(plist)
else:
widget.set_popdown_strings([""])
def setval(self,widget):
"""Callback task called on the button release"""
@ -165,10 +165,14 @@ class AutoCombo(AutoCompBase):
"""
self.inb = 1
if len(self.vals) > 0:
if self.vals[0] == "":
self.entry.set_popdown_strings([self.entry.entry.get_text()])
else:
self.entry.set_popdown_strings(self.vals)
else:
self.entry.set_popdown_strings([""])
return 1
def timer_callback(self,entry):

View File

@ -266,8 +266,15 @@ class ChooseParents:
Called with the OK button nis pressed. Saves the selected people as parents
of the main perosn.
"""
try:
mother_rel = const.childRelations[self.mother_rel.get_text()]
except KeyError:
mother_rel = const.childRelations["Birth"]
try:
father_rel = const.childRelations[self.father_rel.get_text()]
except KeyError:
father_rel = const.childRelations["Birth"]
if self.father or self.mother:
if self.mother and not self.father:

View File

@ -1290,6 +1290,7 @@ class EditPerson:
if not self.person.getBirth().are_equal(self.birth):
self.person.setBirth(self.birth)
Utils.modified()
# Update each of the families child lists to reflect any
# change in ordering due to the new birth date
@ -1306,6 +1307,7 @@ class EditPerson:
if not self.person.getDeath().are_equal(self.death):
self.person.setDeath(self.death)
Utils.modified()
male = self.is_male.get_active()
female = self.is_female.get_active()
@ -1382,6 +1384,7 @@ class EditPerson:
self.update_lists()
if self.callback:
self.callback(self,self.add_places)
self.gallery.close()
self.window.destroy()

View File

@ -184,7 +184,6 @@ class PedigreeView:
for n in [GrampsCfg.nameof(t[0]),
u'b. %s' % t[0].getBirth().getDate(),
u'd. %s' % t[0].getDeath().getDate()]:
print n, type(n)
try:
a.set_text(n,len(n))
except TypeError:

View File

@ -72,6 +72,8 @@ def importData(database, filename, callback):
f.close()
except IOError,msg:
use_gzip = 0
except ValueError, msg:
use_gzip = 1
else:
use_gzip = 0
@ -99,18 +101,7 @@ def importData(database, filename, callback):
_("The file is probably either corrupt or not a valid GRAMPS database."))
return 0
except ValueError, msg:
if str(msg)[0:16] == "Incorrect length":
WarningDialog(_("A Data Compression Problem Was Encountered"),
_("Your database has encountered an error in the library "
"that compresses the data. Your data should be okay, but "
"you may want to consider disabling compression. "
"This can be disabled in the Properties dialog. Once you "
"have disabled compression, this error will go away after "
"the next time you save the database."))
else:
import DisplayTrace
DisplayTrace.DisplayTrace()
return 0
pass
except:
import DisplayTrace
DisplayTrace.DisplayTrace()

View File

@ -912,6 +912,8 @@ class Name(DataObj):
return 0
if self.Surname != other.Surname:
return 0
if self.Prefix != other.Prefix:
return 0
if self.Suffix != other.Suffix:
return 0
if self.Title != other.Title:

View File

@ -247,7 +247,6 @@ class SourceEditor:
self.conf_menu.set_history(srcref.getConfidence())
self.list = []
self.title_menu.list.select_item(0)
self.title_menu.list.remove_items(self.title_menu.list.get_selection())
@ -259,7 +258,7 @@ class SourceEditor:
else:
self.active_source = None
self.draw()
self.draw(self.active_source)
self.set_button()
self.sourceDisplay.show()
@ -312,10 +311,13 @@ class SourceEditor:
if self.active_source == src:
sel_child = c
if len(self.list) > 0:
self.title_menu.list.append_items(self.list)
self.title_menu.set_sensitive(1)
if sel_child:
self.title_menu.list.select_child(sel_child)
else:
self.title_menu.set_sensitive(0)
def on_sourceok_clicked(self,obj):

View File

@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000 Donald N. Allingham
# Copyright (C) 2000, 2003 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
@ -31,6 +31,7 @@ import string
import time
import shutil
import os
import codecs
#-------------------------------------------------------------------------
#
@ -100,7 +101,7 @@ class XmlWriter:
def __init__(self,db,callback,strip_photos,compress=1):
"""
Initializes, but nots not write, and XML file.
Initializes, but does not write, an XML file.
db - database to write
callback - function to provide progress indication
@ -114,38 +115,42 @@ class XmlWriter:
def write(self,filename):
"""
Write the database to the specfied file.
Write the database to the specified file.
"""
self.fileroot = os.path.dirname(filename)
if self.compress:
try:
self.g = gzip.open(filename,"wb")
g = gzip.open(filename,"wb")
except:
self.g = open(filename,"w")
g = open(filename,"w")
else:
self.g = open(filename,"w")
g = open(filename,"w")
self.g = codecs.getwriter("utf8")(g)
self.write_xml_data()
self.g.close()
g.close()
def write_handle(self,handle):
"""
Write the database to the specfied file handle.
Write the database to the specified file handle.
"""
use_g = 0
if self.compress:
try:
self.g = gzip.GzipFile(mode="wb",fileobj=handle)
g = gzip.GzipFile(mode="wb",fileobj=handle)
use_g = 1
except:
self.g = handle
g = handle
else:
self.g = handle
g = handle
self.g = codecs.getwriter("utf8")(g)
self.write_xml_data()
if use_g:
self.g.close()
if use_g:
g.close()
def write_xml_data(self):