Handle media files on Save As...
svn: r1514
This commit is contained in:
parent
c938b9b1f6
commit
3058db9d18
@ -836,11 +836,26 @@ class Gramps:
|
||||
filename = os.path.normpath(os.path.abspath(filename))
|
||||
if filename:
|
||||
Utils.destroy_passed_object(obj)
|
||||
self.save_media(filename)
|
||||
if GrampsCfg.usevc and GrampsCfg.vc_comment:
|
||||
self.display_comment_box(filename)
|
||||
else:
|
||||
self.save_file(filename,_("No Comment Provided"))
|
||||
|
||||
def save_media(self,filename):
|
||||
import RelImage
|
||||
ObjectMap = self.db.getObjectMap()
|
||||
for ObjectId in ObjectMap.keys():
|
||||
if ObjectMap[ObjectId].getLocal():
|
||||
oldfile = ObjectMap[ObjectId].getPath()
|
||||
(base,ext) = os.path.splitext(os.path.basename(oldfile))
|
||||
newfile = os.path.join(filename,os.path.basename(oldfile))
|
||||
try:
|
||||
RelImage.import_media_object(oldfile,filename,base)
|
||||
ObjectMap[ObjectId].setPath(newfile)
|
||||
except:
|
||||
pass
|
||||
|
||||
def save_file(self,filename,comment):
|
||||
|
||||
path = filename
|
||||
|
Loading…
Reference in New Issue
Block a user