* src/plugins/ChangeNames.py: Block signal emission during run

* src/plugins/Check.py: Block signal emission during run
* src/plugins/ImportGeneWeb.py: Block signal emission during run
* src/plugins/ImportvCard.py: Block signal emission during run
* src/plugins/TestcaseGenerator.py: Block signal emission during run


svn: r4306
This commit is contained in:
Martin Hawlisch 2005-04-06 10:22:18 +00:00
parent 997d77068c
commit d64fc60c3a
6 changed files with 26 additions and 4 deletions

View File

@ -14,6 +14,12 @@
(change_db): Use supplied database.
* src/SourceView.py (__init__): dont call change_cb because on initialisation
there is no real database and this will be done by the signal.
* src/plugins/ChangeNames.py: Block signal emission during run
* src/plugins/Check.py: Block signal emission during run
* src/plugins/ImportGeneWeb.py: Block signal emission during run
* src/plugins/ImportvCard.py: Block signal emission during run
* src/plugins/TestcaseGenerator.py: Block signal emission during run
2005-04-06 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
* src/plugins/ScratchPad.py: made clear buttons sensitive to contents of

View File

@ -78,8 +78,6 @@ class ChangeNames:
self.parent.child_windows[self.__class__].present(None)
return
self.win_key = self.__class__
self.trans = db.transaction_begin()
self.trans.set_batch(True)
self.name_list = []
for name in self.db.get_surname_list():
@ -164,6 +162,9 @@ class ChangeNames:
self.window.present()
def on_ok_clicked(self,obj):
self.trans = self.db.transaction_begin()
self.trans.set_batch(True)
self.db.disable_signals()
changelist = []
for node in self.iter_list:
if self.model.get_value(node,0):
@ -182,8 +183,9 @@ class ChangeNames:
if change:
self.db.commit_person(person,self.trans)
if anychange:
self.db.transaction_commit(self.trans,_("Capitalization changes"))
self.db.transaction_commit(self.trans,_("Capitalization changes"))
self.db.enable_signals()
self.db.request_rebuild()
self.close(obj)
self.cb(None,1)

View File

@ -59,6 +59,7 @@ def runTool(database,active_person,callback,parent=None):
try:
trans = database.transaction_begin()
trans.set_batch(True)
database.disable_signals()
checker = CheckIntegrity(database,parent,trans)
checker.check_for_broken_family_links()
checker.cleanup_missing_photos(0)
@ -66,6 +67,8 @@ def runTool(database,active_person,callback,parent=None):
checker.cleanup_empty_families(0)
checker.check_events()
database.transaction_commit(trans, _("Check Integrity"))
database.enable_signals()
database.request_rebuild()
errs = checker.build_report(0)
if errs:

View File

@ -106,6 +106,8 @@ class GeneWebParser:
def parse_geneweb_file(self):
self.trans = self.db.transaction_begin()
self.trans.set_batch(True)
self.db.disable_signals()
t = time.time()
self.index = 0
self.fam_count = 0
@ -155,6 +157,8 @@ class GeneWebParser:
msg = _('Import Complete: %d seconds') % t
self.db.transaction_commit(self.trans,_("GeneWeb import"))
self.db.enable_signals()
self.db.request_rebuild()
print msg
print "Families: %d" % len(self.fkeys)

View File

@ -104,6 +104,8 @@ class VCardParser:
def parse_vCard_file(self):
self.trans = self.db.transaction_begin()
self.trans.set_batch(True)
self.db.disable_signals()
t = time.time()
self.person = None
@ -156,6 +158,8 @@ class VCardParser:
msg = _('Import Complete: %d seconds') % t
self.db.transaction_commit(self.trans,_("vCard import"))
self.db.enable_signals()
self.db.request_rebuild()
return None

View File

@ -125,6 +125,7 @@ class TestcaseGenerator:
self.trans = self.db.transaction_begin()
self.trans.set_batch(True)
self.db.disable_signals()
if generate_bugs:
self.generate_broken_relations()
@ -145,6 +146,8 @@ class TestcaseGenerator:
break
self.db.transaction_commit(self.trans,_("Testcase generator"))
self.db.enable_signals()
self.db.request_rebuild()
self.top.destroy()