From 27aa4ec6a2a20058d6fddc6610eaf0db7d64db96 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 31 Aug 2007 03:18:38 +0000 Subject: [PATCH] 2007-08-30 Don Allingham * src/BasicUtils/_UpdateCallback.py: add support for text in progressbar * src/ExportAssistant.py: add support for text in progressbar * src/ExportOptions.py: add support for text in progressbar * src/GrampsDbUtils/_WriteGedcom.py: add support for text in progressbar 2007-08-30 Don Allingham * src/GrampsDb/_GrampsDBDir.py: use types.InstanceType * src/RelLib/_SourceBase.py: use types.InstanceType * src/RelLib/_Source.py: use types.InstanceType * src/RelLib/_MediaObject.py: use types.InstanceType * src/RelLib/_Person.py: use types.InstanceType * src/RelLib/_DateBase.py: use types.InstanceType * src/RelLib/_ChildRef.py: use types.InstanceType * src/RelLib/_Family.py: use types.InstanceType * src/RelLib/_Place.py: use types.InstanceType * src/RelLib/_RepoRef.py: use types.InstanceType * src/RelLib/_Note.py: use types.InstanceType * src/RelLib/_EventRef.py: use types.InstanceType * src/RelLib/_Repository.py: use types.InstanceType * src/RelLib/_Event.py: use types.InstanceType svn: r8900 --- ChangeLog | 38 ++++++++++++++++++------------- src/BasicUtils/_UpdateCallback.py | 15 ++++++++---- src/ExportAssistant.py | 4 ++-- src/ExportOptions.py | 26 +-------------------- src/GrampsDbUtils/_WriteGedcom.py | 4 ++-- 5 files changed, 37 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1807929a3..b9333e0c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2007-08-30 Don Allingham + * src/BasicUtils/_UpdateCallback.py: add support for text in progressbar + * src/ExportAssistant.py: add support for text in progressbar + * src/ExportOptions.py: add support for text in progressbar + * src/GrampsDbUtils/_WriteGedcom.py: add support for text in progressbar + +2007-08-30 Don Allingham + * src/GrampsDb/_GrampsDBDir.py: use types.InstanceType + * src/RelLib/_SourceBase.py: use types.InstanceType + * src/RelLib/_Source.py: use types.InstanceType + * src/RelLib/_MediaObject.py: use types.InstanceType + * src/RelLib/_Person.py: use types.InstanceType + * src/RelLib/_DateBase.py: use types.InstanceType + * src/RelLib/_ChildRef.py: use types.InstanceType + * src/RelLib/_Family.py: use types.InstanceType + * src/RelLib/_Place.py: use types.InstanceType + * src/RelLib/_RepoRef.py: use types.InstanceType + * src/RelLib/_Note.py: use types.InstanceType + * src/RelLib/_EventRef.py: use types.InstanceType + * src/RelLib/_Repository.py: use types.InstanceType + * src/RelLib/_Event.py: use types.InstanceType + 2007-08-30 Benny Malengier * src/ExportAssistant.py: request Don, progressbar in exportassistant. @@ -54,22 +76,6 @@ count filters * po/POTFILES.in: new reference count filters -2007-08-29 Don Allingham - * src/GrampsDb/_GrampsDBDir.py: use types.InstanceType - * src/RelLib/_SourceBase.py: use types.InstanceType - * src/RelLib/_Source.py: use types.InstanceType - * src/RelLib/_MediaObject.py: use types.InstanceType - * src/RelLib/_Person.py: use types.InstanceType - * src/RelLib/_DateBase.py: use types.InstanceType - * src/RelLib/_ChildRef.py: use types.InstanceType - * src/RelLib/_Family.py: use types.InstanceType - * src/RelLib/_Place.py: use types.InstanceType - * src/RelLib/_RepoRef.py: use types.InstanceType - * src/RelLib/_Note.py: use types.InstanceType - * src/RelLib/_EventRef.py: use types.InstanceType - * src/RelLib/_Repository.py: use types.InstanceType - * src/RelLib/_Event.py: use types.InstanceType - 2007-08-29 Don Allingham * src/RelLib/_Source.py: fix fast unserialize() * src/RelLib/_Place.py: fix fast unserialize() diff --git a/src/BasicUtils/_UpdateCallback.py b/src/BasicUtils/_UpdateCallback.py index 0b7d96f6c..4cd2b7c8e 100644 --- a/src/BasicUtils/_UpdateCallback.py +++ b/src/BasicUtils/_UpdateCallback.py @@ -60,19 +60,21 @@ class UpdateCallback: self.reset() else: self.update = self.update_empty + self.text = "" - def reset(self): + def reset(self, text=""): self.count = 0 self.oldval = 0 self.oldtime = 0 + self.text = text - def set_total(self,total): + def set_total(self, total): self.total = total - def update_empty(self,count=None): + def update_empty(self, count=None): pass - def update_real(self,count=None): + def update_real(self, count=None): self.count += 1 if not count: count = self.count @@ -81,6 +83,9 @@ class UpdateCallback: time_has_come = self.interval and (newtime-self.oldtime>self.interval) value_changed = newval!=self.oldval if value_changed or time_has_come: - self.callback(newval) + if self.text: + self.callback(newval, text=self.text) + else: + self.callback(newval) self.oldval = newval self.oldtime = newtime diff --git a/src/ExportAssistant.py b/src/ExportAssistant.py index cded33c17..f2b2d82f2 100644 --- a/src/ExportAssistant.py +++ b/src/ExportAssistant.py @@ -578,9 +578,9 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) : while gtk.events_pending(): gtk.main_iteration() - def pulse_progressbar(self, value): + def pulse_progressbar(self, value, text): self.progressbar.set_fraction(min(value/100.0, 1.0)) - self.progressbar.set_text("%d%%" % value) + self.progressbar.set_text("%s: %d%%" % (text, value)) while gtk.events_pending(): gtk.main_iteration() diff --git a/src/ExportOptions.py b/src/ExportOptions.py index 355d99fdc..dbe83fc18 100644 --- a/src/ExportOptions.py +++ b/src/ExportOptions.py @@ -24,31 +24,7 @@ import RelLib import Config from BasicUtils import name_displayer -from Filters import GenericFilter, Rules, build_filter_menu - -def restrict_living(person): - newperson = RelLib.Person() - name = RelLib.Name() - - # copy name info - source = person.get_primary_name() - name.first_name = _(u'Living') - name.surname = source.surname - name.title = source.title - name.type = source.type - name.prefix = source.prefix - name.patronymic = source.patronymic - name.group_as = source.group_as - name.sort_as = source.sort_as - name.display_as = source.display_as - name.call = "" - newperson.set_primary_name(name) - - newperson.parent_family_list = person.parent_family_list[:] - newperson.family_list = person.family_list[:] - newperson.gender = person.gender - - return newperson +from Filters import GenericFilter, Rules #------------------------------------------------------------------------- # diff --git a/src/GrampsDbUtils/_WriteGedcom.py b/src/GrampsDbUtils/_WriteGedcom.py index ae0a2d3ea..ebb160a17 100644 --- a/src/GrampsDbUtils/_WriteGedcom.py +++ b/src/GrampsDbUtils/_WriteGedcom.py @@ -438,7 +438,7 @@ class GedcomWriter(UpdateCallback): hcnt = len(phandles) - self.reset() + self.reset(_("Sorting")) self.set_total(hcnt) sorted = [] for handle in phandles: @@ -449,7 +449,7 @@ class GedcomWriter(UpdateCallback): sorted.sort() self.set_total(hcnt + len(self.db.get_family_handles())) - self.reset() + self.reset(_("Writing")) for data in sorted: self.__write_person(self.db.get_person_from_handle(data[1])) self.update()