MediaView integrity after add

svn: r6127
This commit is contained in:
Don Allingham 2006-03-10 04:29:08 +00:00
parent 99cd0fe2dc
commit e338c13d75
3 changed files with 3 additions and 12 deletions

View File

@ -1,4 +1,5 @@
2006-03-09 Don Allingham <don@gramps-project.org>
* src/AddMedia.py: avoid double commit
* src/GrampsDb/_GrampsDbBase.py: fix add of places in internal map
* src/Editors/_EditEventRef.py: commit place properly
* src/DataViews/_FamilyView.py: avoid reentry

View File

@ -30,7 +30,6 @@ Provides the interface to allow a person to add a media object to the database.
#
#-------------------------------------------------------------------------
import os
import gc
#-------------------------------------------------------------------------
#
@ -109,7 +108,6 @@ class AddMediaObject:
Callback function called with the save button is pressed.
A new media object is created, and added to the database.
"""
description = unicode(self.description.get_text())
if self.internal.get_active():
@ -136,13 +134,13 @@ class AddMediaObject:
description = os.path.basename(filename)
mobj = RelLib.MediaObject()
mobj.set_handle(Utils.create_id())
mobj.set_description(description)
mobj.set_mime_type(mtype)
name = filename
mobj.set_path(name)
trans = self.db.transaction_begin()
self.db.add_object(mobj,trans)
self.object = mobj
self.db.commit_media_object(mobj,trans)
self.db.transaction_commit(trans,_("Add Media Object"))
@ -178,12 +176,10 @@ class AddMediaObject:
if val == gtk.RESPONSE_OK:
self.on_savephoto_clicked()
self.window.destroy()
gc.collect()
return self.object
elif val == gtk.RESPONSE_HELP:
self.on_help_imagesel_clicked(None)
else:
self.window.destroy()
gc.collect()
return None
return None

View File

@ -105,11 +105,6 @@ class MediaView(PageView.ListView):
self.image = gtk.Image()
self.image.set_size_request(int(const.thumbScale),
int(const.thumbScale))
# label = gtk.Label('<b>%s</b>' % _('Preview'))
# label.set_use_markup(True)
# frame = gtk.Frame()
# frame.set_label_widget(label)
# frame.add(self.image)
vbox.pack_start(self.image,False)
vbox.pack_start(base,True)
@ -153,8 +148,7 @@ class MediaView(PageView.ListView):
def on_double_click(self,obj,event):
handle = self.first_selected()
if handle:
place = self.dbstate.db.get_place_from_handle(handle)
#EditPlace.EditPlace(place,self.dbstate, self.uistate)
media_obj = self.dbstate.db.get_object_from_handle(handle)
def add(self,obj):
"""Add a new media object to the media list"""