Fixed local flag not being set on image import
svn: r677
This commit is contained in:
parent
e92213f4ed
commit
15eff9c683
@ -114,6 +114,7 @@ class AddMediaObject:
|
|||||||
if external.get_active() == 0:
|
if external.get_active() == 0:
|
||||||
path = self.db.getSavePath()
|
path = self.db.getSavePath()
|
||||||
name = RelImage.import_media_object(filename,path,mobj.getId())
|
name = RelImage.import_media_object(filename,path,mobj.getId())
|
||||||
|
mobj.setLocal(1)
|
||||||
else:
|
else:
|
||||||
name = filename
|
name = filename
|
||||||
mobj.setPath(name)
|
mobj.setPath(name)
|
||||||
|
@ -169,11 +169,13 @@ class ImageSelect:
|
|||||||
if type[0:5] == "image":
|
if type[0:5] == "image":
|
||||||
if self.external.get_active() == 0:
|
if self.external.get_active() == 0:
|
||||||
name = RelImage.import_media_object(filename,self.path,mobj.getId())
|
name = RelImage.import_media_object(filename,self.path,mobj.getId())
|
||||||
|
mobj.setLocal(1)
|
||||||
else:
|
else:
|
||||||
if self.external.get_active() == 1:
|
if self.external.get_active() == 1:
|
||||||
name = filename
|
name = filename
|
||||||
else:
|
else:
|
||||||
name = RelImage.import_media_object(filename,self.path,mobj.getId())
|
name = RelImage.import_media_object(filename,self.path,mobj.getId())
|
||||||
|
mobj.setLocal(1)
|
||||||
mobj.setPath(name)
|
mobj.setPath(name)
|
||||||
|
|
||||||
utils.modified()
|
utils.modified()
|
||||||
@ -291,9 +293,7 @@ class Gallery(ImageSelect):
|
|||||||
photo.setDescription(root)
|
photo.setDescription(root)
|
||||||
self.savephoto(photo)
|
self.savephoto(photo)
|
||||||
if Config.mediaref == 0:
|
if Config.mediaref == 0:
|
||||||
name = RelImage.import_media_object(name,
|
name = RelImage.import_media_object(name,self.path,photo.getId())
|
||||||
self.path,
|
|
||||||
photo.getId())
|
|
||||||
photo.setPath(name)
|
photo.setPath(name)
|
||||||
photo.setLocal(1)
|
photo.setLocal(1)
|
||||||
utils.modified()
|
utils.modified()
|
||||||
@ -322,6 +322,7 @@ class Gallery(ImageSelect):
|
|||||||
try:
|
try:
|
||||||
id = photo.getId()
|
id = photo.getId()
|
||||||
name = RelImage.import_media_object(tfile,self.path,id)
|
name = RelImage.import_media_object(tfile,self.path,id)
|
||||||
|
photo.setLocal(1)
|
||||||
photo.setPath(name)
|
photo.setPath(name)
|
||||||
except:
|
except:
|
||||||
photo.setPath(tfile)
|
photo.setPath(tfile)
|
||||||
@ -458,7 +459,6 @@ class Gallery(ImageSelect):
|
|||||||
photo = self.dataobj.getPhotoList()[self.selectedIcon]
|
photo = self.dataobj.getPhotoList()[self.selectedIcon]
|
||||||
object = photo.getReference()
|
object = photo.getReference()
|
||||||
name = RelImage.import_media_object(object.getPath(),self.path,object.getId())
|
name = RelImage.import_media_object(object.getPath(),self.path,object.getId())
|
||||||
|
|
||||||
object.setPath(name)
|
object.setPath(name)
|
||||||
object.setLocal(1)
|
object.setLocal(1)
|
||||||
|
|
||||||
|
@ -332,6 +332,7 @@ class MediaView:
|
|||||||
id = photo.getId()
|
id = photo.getId()
|
||||||
path = self.db.getSavePath()
|
path = self.db.getSavePath()
|
||||||
name = RelImage.import_media_object(tfile,path,id)
|
name = RelImage.import_media_object(tfile,path,id)
|
||||||
|
photo.setLocal(1)
|
||||||
photo.setPath(name)
|
photo.setPath(name)
|
||||||
except:
|
except:
|
||||||
photo.setPath(tfile)
|
photo.setPath(tfile)
|
||||||
|
@ -82,7 +82,6 @@ def import_media_object(filename,path,base):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
path = "%s/%s" % (thumb,base)
|
path = "%s/%s" % (thumb,base)
|
||||||
print "Making",path,"from",filename
|
|
||||||
mk_thumb(filename,path,const.thumbScale)
|
mk_thumb(filename,path,const.thumbScale)
|
||||||
shutil.copy(filename,name)
|
shutil.copy(filename,name)
|
||||||
except:
|
except:
|
||||||
@ -123,8 +122,6 @@ def scale_image(path,size):
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
def mk_thumb(source,dest,size):
|
def mk_thumb(source,dest,size):
|
||||||
|
|
||||||
print "making a thumbnail",source,dest
|
|
||||||
|
|
||||||
dir = os.path.dirname(dest)
|
dir = os.path.dirname(dest)
|
||||||
try:
|
try:
|
||||||
if not os.path.exists(dir):
|
if not os.path.exists(dir):
|
||||||
|
@ -7,13 +7,12 @@ import gtk
|
|||||||
import gnome.ui
|
import gnome.ui
|
||||||
import locale
|
import locale
|
||||||
|
|
||||||
intl.textdomain("gramps")
|
|
||||||
|
|
||||||
if os.environ.has_key("GRAMPSI18N"):
|
if os.environ.has_key("GRAMPSI18N"):
|
||||||
loc = os.environ["GRAMPSI18N"]
|
loc = os.environ["GRAMPSI18N"]
|
||||||
else:
|
else:
|
||||||
loc = "locale"
|
loc = "locale"
|
||||||
|
|
||||||
|
intl.textdomain("gramps")
|
||||||
intl.bindtextdomain("gramps",loc)
|
intl.bindtextdomain("gramps",loc)
|
||||||
|
|
||||||
locale.setlocale(locale.LC_NUMERIC,"C")
|
locale.setlocale(locale.LC_NUMERIC,"C")
|
||||||
|
@ -70,7 +70,6 @@ for val in const.familyConstantEvents.keys():
|
|||||||
lineRE = re.compile(r"\s*(\d+)\s+(\S+)\s*(.*)$")
|
lineRE = re.compile(r"\s*(\d+)\s+(\S+)\s*(.*)$")
|
||||||
headRE = re.compile(r"\s*(\d+)\s+HEAD")
|
headRE = re.compile(r"\s*(\d+)\s+HEAD")
|
||||||
nameRegexp= re.compile(r"/?([^/]*)(/([^/]*)(/([^/]*))?)?")
|
nameRegexp= re.compile(r"/?([^/]*)(/([^/]*)(/([^/]*))?)?")
|
||||||
#nameRegexp = re.compile(r"([\S\s]*\S)?\s*/([^/]+)?/\s*,?\s*([\S]+)?")
|
|
||||||
calRegexp = re.compile(r"\s*@#D([^@]+)@\s*(.*)$")
|
calRegexp = re.compile(r"\s*@#D([^@]+)@\s*(.*)$")
|
||||||
fromtoRegexp = re.compile(r"\s*FROM\s+@#D([^@]+)@\s*(.*)\s+TO\s+@#D([^@]+)@\s*(.*)$")
|
fromtoRegexp = re.compile(r"\s*FROM\s+@#D([^@]+)@\s*(.*)\s+TO\s+@#D([^@]+)@\s*(.*)$")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user