Fixed local flag not being set on image import

svn: r677
This commit is contained in:
Don Allingham 2002-01-03 18:09:32 +00:00
parent e92213f4ed
commit 15eff9c683
7 changed files with 8 additions and 11 deletions

View File

@ -114,6 +114,7 @@ class AddMediaObject:
if external.get_active() == 0:
path = self.db.getSavePath()
name = RelImage.import_media_object(filename,path,mobj.getId())
mobj.setLocal(1)
else:
name = filename
mobj.setPath(name)

View File

@ -169,11 +169,13 @@ class ImageSelect:
if type[0:5] == "image":
if self.external.get_active() == 0:
name = RelImage.import_media_object(filename,self.path,mobj.getId())
mobj.setLocal(1)
else:
if self.external.get_active() == 1:
name = filename
else:
name = RelImage.import_media_object(filename,self.path,mobj.getId())
mobj.setLocal(1)
mobj.setPath(name)
utils.modified()
@ -291,9 +293,7 @@ class Gallery(ImageSelect):
photo.setDescription(root)
self.savephoto(photo)
if Config.mediaref == 0:
name = RelImage.import_media_object(name,
self.path,
photo.getId())
name = RelImage.import_media_object(name,self.path,photo.getId())
photo.setPath(name)
photo.setLocal(1)
utils.modified()
@ -322,6 +322,7 @@ class Gallery(ImageSelect):
try:
id = photo.getId()
name = RelImage.import_media_object(tfile,self.path,id)
photo.setLocal(1)
photo.setPath(name)
except:
photo.setPath(tfile)
@ -458,7 +459,6 @@ class Gallery(ImageSelect):
photo = self.dataobj.getPhotoList()[self.selectedIcon]
object = photo.getReference()
name = RelImage.import_media_object(object.getPath(),self.path,object.getId())
object.setPath(name)
object.setLocal(1)

View File

@ -332,6 +332,7 @@ class MediaView:
id = photo.getId()
path = self.db.getSavePath()
name = RelImage.import_media_object(tfile,path,id)
photo.setLocal(1)
photo.setPath(name)
except:
photo.setPath(tfile)

View File

@ -82,7 +82,6 @@ def import_media_object(filename,path,base):
try:
path = "%s/%s" % (thumb,base)
print "Making",path,"from",filename
mk_thumb(filename,path,const.thumbScale)
shutil.copy(filename,name)
except:
@ -123,8 +122,6 @@ def scale_image(path,size):
#-------------------------------------------------------------------------
def mk_thumb(source,dest,size):
print "making a thumbnail",source,dest
dir = os.path.dirname(dest)
try:
if not os.path.exists(dir):

View File

@ -7,13 +7,12 @@ import gtk
import gnome.ui
import locale
intl.textdomain("gramps")
if os.environ.has_key("GRAMPSI18N"):
loc = os.environ["GRAMPSI18N"]
else:
loc = "locale"
intl.textdomain("gramps")
intl.bindtextdomain("gramps",loc)
locale.setlocale(locale.LC_NUMERIC,"C")

View File

@ -561,7 +561,7 @@ def get_xpm_image():
" +........@@@@@@@@@@@@@@@@@@@@@...+ ",
" +................................+ ",
" +................................+ ",
" +.....@@@@@@@@@@@@@@@@@@@@@@@@...+ ",
" +.....@@@@@@@@@@@@@@@@@@@@@@@@...+ ",
" +................................+ ",
" +........@@@@@@@@@@@@@@@@@@@@@...+ ",
" +................................+ ",

View File

@ -70,7 +70,6 @@ for val in const.familyConstantEvents.keys():
lineRE = re.compile(r"\s*(\d+)\s+(\S+)\s*(.*)$")
headRE = re.compile(r"\s*(\d+)\s+HEAD")
nameRegexp= re.compile(r"/?([^/]*)(/([^/]*)(/([^/]*))?)?")
#nameRegexp = re.compile(r"([\S\s]*\S)?\s*/([^/]+)?/\s*,?\s*([\S]+)?")
calRegexp = re.compile(r"\s*@#D([^@]+)@\s*(.*)$")
fromtoRegexp = re.compile(r"\s*FROM\s+@#D([^@]+)@\s*(.*)\s+TO\s+@#D([^@]+)@\s*(.*)$")