* src/EditSource.py (DelSrcQuery.query_response), src/EditPlace.py (DeletePlaceQuery.query_response), src/ImageSelect.py (DeleteMediaQuery.query_response): Block signals while removing the references of the to be deleted object to get much more speed.
* src/plugins/TestcaseGenerator.py: Add place, media and source references. * src/SourceView.py (button_press): Handle case of no selection. svn: r4681
This commit is contained in:
parent
27e22a5b21
commit
745585d93c
@ -1,3 +1,13 @@
|
||||
2005-05-26 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||
* src/EditSource.py (DelSrcQuery.query_response),
|
||||
src/EditPlace.py (DeletePlaceQuery.query_response),
|
||||
src/ImageSelect.py (DeleteMediaQuery.query_response): Block
|
||||
signals while removing the references of the to be deleted
|
||||
object to get much more speed.
|
||||
* src/plugins/TestcaseGenerator.py: Add place, media and source
|
||||
references.
|
||||
* src/SourceView.py (button_press): Handle case of no selection.
|
||||
|
||||
2005-05-25 Alex Roitman <shura@gramps-project.org>
|
||||
* src/WriteGedcom.py (write_person): Typo.
|
||||
|
||||
|
@ -577,9 +577,9 @@ class DeletePlaceQuery:
|
||||
|
||||
def query_response(self):
|
||||
trans = self.db.transaction_begin()
|
||||
self.db.disable_signals()
|
||||
|
||||
place_handle = self.place.get_handle()
|
||||
self.db.remove_place(place_handle,trans)
|
||||
|
||||
for handle in self.db.get_person_handles(sort_handles=False):
|
||||
person = self.db.get_person_from_handle(handle)
|
||||
@ -599,5 +599,7 @@ class DeletePlaceQuery:
|
||||
event.remove_handle_references('Place',place_handle)
|
||||
self.db.commit_event(event,trans)
|
||||
|
||||
self.db.enable_signals()
|
||||
self.db.remove_place(place_handle,trans)
|
||||
self.db.transaction_commit(trans,
|
||||
_("Delete Place (%s)") % self.place.get_title())
|
||||
|
@ -420,6 +420,7 @@ class DelSrcQuery:
|
||||
|
||||
def query_response(self):
|
||||
trans = self.db.transaction_begin()
|
||||
self.db.disable_signals()
|
||||
|
||||
(person_list,family_list,event_list,
|
||||
place_list,source_list,media_list) = self.the_lists
|
||||
@ -456,6 +457,7 @@ class DelSrcQuery:
|
||||
media.remove_source_references(src_handle_list)
|
||||
self.db.commit_media_object(media,trans)
|
||||
|
||||
self.db.enable_signals()
|
||||
self.db.remove_source(self.source.get_handle(),trans)
|
||||
self.db.transaction_commit(
|
||||
trans,_("Delete Source (%s)") % self.source.get_title())
|
||||
|
@ -1243,6 +1243,7 @@ class DeleteMediaQuery:
|
||||
|
||||
def query_response(self):
|
||||
trans = self.db.transaction_begin()
|
||||
self.db.disable_signals()
|
||||
|
||||
(person_list,family_list,event_list,
|
||||
place_list,source_list) = self.the_lists
|
||||
@ -1282,6 +1283,7 @@ class DeleteMediaQuery:
|
||||
source.set_media_list(new_list)
|
||||
self.db.commit_source(source,trans)
|
||||
|
||||
self.db.enable_signals()
|
||||
self.db.remove_object(self.media_handle,trans)
|
||||
self.db.transaction_commit(trans,_("Remove Media Object"))
|
||||
|
||||
|
@ -154,11 +154,13 @@ class SourceView:
|
||||
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
||||
mlist = []
|
||||
self.selection.selected_foreach(self.blist,mlist)
|
||||
handle = mlist[0]
|
||||
source = self.parent.db.get_source_from_handle(handle)
|
||||
EditSource.EditSource(source,self.parent.db,self.parent,
|
||||
self.topWindow)
|
||||
return True
|
||||
if mlist:
|
||||
handle = mlist[0]
|
||||
source = self.parent.db.get_source_from_handle(handle)
|
||||
EditSource.EditSource(source,self.parent.db,self.parent,
|
||||
self.topWindow)
|
||||
return True
|
||||
return False
|
||||
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
||||
self.build_context_menu(event)
|
||||
return True
|
||||
|
@ -144,7 +144,6 @@ class TestcaseGenerator:
|
||||
if not self.multiple_transactions:
|
||||
self.trans.set_batch(True)
|
||||
self.db.disable_signals()
|
||||
|
||||
|
||||
if self.multiple_transactions:
|
||||
|
||||
@ -248,6 +247,23 @@ class TestcaseGenerator:
|
||||
print "DONE."
|
||||
|
||||
|
||||
if generate_bugs or generate_dates or generate_families:
|
||||
self.default_source = RelLib.Source()
|
||||
self.default_source.set_title("TestcaseGenerator")
|
||||
self.db.add_source(self.default_source, self.trans)
|
||||
self.default_sourceref = RelLib.SourceRef()
|
||||
self.default_sourceref.set_base_handle(self.default_source.get_handle())
|
||||
self.default_place = RelLib.Place()
|
||||
self.default_place.set_title("TestcaseGenerator place")
|
||||
self.db.add_place(self.default_place, self.trans)
|
||||
self.default_media = RelLib.MediaObject()
|
||||
self.default_media.set_description("TestcaseGenerator media")
|
||||
self.default_media.set_path("/tmp/TestcaseGenerator.png")
|
||||
self.default_media.set_mime_type("image/png")
|
||||
self.db.add_object(self.default_media, self.trans)
|
||||
self.default_mediaref = RelLib.MediaRef()
|
||||
self.default_mediaref.set_reference_handle(self.default_media.get_handle())
|
||||
|
||||
if generate_bugs:
|
||||
self.generate_broken_relations()
|
||||
|
||||
@ -607,6 +623,8 @@ class TestcaseGenerator:
|
||||
|
||||
np = RelLib.Person()
|
||||
|
||||
self.add_defaults(np)
|
||||
|
||||
# Note
|
||||
if note:
|
||||
np.set_note(note)
|
||||
@ -662,6 +680,7 @@ class TestcaseGenerator:
|
||||
self.parents_todo.append(person2_h)
|
||||
|
||||
fam = RelLib.Family()
|
||||
self.add_defaults(fam)
|
||||
fam.set_father_handle(person1_h)
|
||||
fam.set_mother_handle(person2_h)
|
||||
fam.set_relationship(RelLib.Family.MARRIED)
|
||||
@ -721,6 +740,15 @@ class TestcaseGenerator:
|
||||
self.db.commit_person(child,self.trans)
|
||||
self.commit_transaction() # COMMIT TRANSACTION STEP
|
||||
|
||||
def add_defaults(self,object,ref_text = ""):
|
||||
object.add_source_reference(self.default_sourceref)
|
||||
object.add_media_reference(self.default_mediaref)
|
||||
e = RelLib.Event()
|
||||
e.set_name("TestcaseGenerator")
|
||||
e.set_place_handle(self.default_place.get_handle())
|
||||
self.db.add_event(e, self.trans)
|
||||
object.add_event_handle(e.get_handle())
|
||||
|
||||
def commit_transaction(self):
|
||||
if self.multiple_transactions:
|
||||
self.db.transaction_commit(self.trans,_("Testcase generator step %d") % self.transaction_count)
|
||||
|
Loading…
Reference in New Issue
Block a user