2008-02-15 Benny Malengier <benny.malengier@gramps-project.org>
* src/DataViews/RelationView.py * src/DataViews/PedigreeView.py * src/ReportBase/_ReportUtils.py * src/Editors/_EditPerson.py * src/Editors/_EditMediaRef.py * src/DisplayTabs/_GalleryTab.py: also correct wrong popup menu * src/plugins/Summary.py * src/plugins/WriteCD.py * src/plugins/IndivComplete.py * src/plugins/NarrativeWeb.py * src/plugins/WritePkg.py * src/plugins/GVFamilyLines.py * src/plugins/DefaultGramplets.py * src/plugins/SimpleBookTitle.py * src/plugins/Check.py * src/plugins/GVRelGraph.py * src/plugins/FamilyLines.py * src/Selectors/_SelectObject.py * src/GrampsDbUtils/_WriteGedcom.py #1787, #1208: use relative path correctly svn: r10048
This commit is contained in:
@@ -43,6 +43,7 @@ import const
|
||||
import Config
|
||||
import Mime
|
||||
import ThumbNails
|
||||
from Utils import media_path_full
|
||||
from gen.lib import NoteType
|
||||
|
||||
from DisplayTabs import \
|
||||
@@ -98,11 +99,12 @@ class EditMediaRef(EditReference):
|
||||
the path.
|
||||
"""
|
||||
self.mtype = self.source.get_mime_type()
|
||||
self.pix = ThumbNails.get_thumbnail_image(self.source.get_path(),
|
||||
fullpath = media_path_full(self.db, self.source.get_path())
|
||||
self.pix = ThumbNails.get_thumbnail_image(fullpath,
|
||||
self.mtype)
|
||||
self.pixmap.set_from_pixbuf(self.pix)
|
||||
|
||||
self.subpix = ThumbNails.get_thumbnail_image(self.source.get_path(),
|
||||
self.subpix = ThumbNails.get_thumbnail_image(fullpath,
|
||||
self.mtype,
|
||||
self.rectangle)
|
||||
self.subpixmap.set_from_pixbuf(self.subpix)
|
||||
@@ -336,7 +338,8 @@ class EditMediaRef(EditReference):
|
||||
self.subpixmap.hide()
|
||||
else:
|
||||
try:
|
||||
pixbuf = gtk.gdk.pixbuf_new_from_file(path)
|
||||
fullpath = media_path_full(self.db, path)
|
||||
pixbuf = gtk.gdk.pixbuf_new_from_file(fullpath)
|
||||
width = pixbuf.get_width()
|
||||
height = pixbuf.get_height()
|
||||
upper_x = min(self.rectangle[0], self.rectangle[2])/100.
|
||||
@@ -390,8 +393,8 @@ class EditMediaRef(EditReference):
|
||||
mime_type = self.source.get_mime_type()
|
||||
app = Mime.get_application(mime_type)
|
||||
if app:
|
||||
import Utils
|
||||
Utils.launch(app[0],self.source.get_path())
|
||||
from Utils import launch
|
||||
launch(app[0], media_path_full(self.db, self.source.get_path()))
|
||||
|
||||
def _connect_signals(self):
|
||||
self.define_cancel_button(self.top.get_widget('button84'))
|
||||
|
@@ -424,7 +424,8 @@ class EditPerson(EditPrimary):
|
||||
been modified.
|
||||
|
||||
"""
|
||||
self.load_photo(obj.get_path(), ref.get_rectangle())
|
||||
self.load_photo(Utils.media_path_full(self.dbstate.db, obj.get_path()),
|
||||
ref.get_rectangle())
|
||||
|
||||
def _image_button_press(self, obj, event):
|
||||
"""
|
||||
@@ -754,12 +755,13 @@ class EditPerson(EditPrimary):
|
||||
photo = media_list[0]
|
||||
object_handle = photo.get_reference_handle()
|
||||
obj = self.db.get_object_from_handle(object_handle)
|
||||
full_path = Utils.media_path_full(self.dbstate.db, obj.get_path())
|
||||
#reload if different media, or different rectangle
|
||||
if self.load_obj != obj.get_path() or \
|
||||
if self.load_obj != full_path or \
|
||||
self.load_rect != photo.get_rectangle():
|
||||
mime_type = obj.get_mime_type()
|
||||
if mime_type and mime_type.startswith("image"):
|
||||
self.load_photo(obj.get_path(), photo.get_rectangle())
|
||||
self.load_photo(full_path, photo.get_rectangle())
|
||||
else:
|
||||
self.load_photo(None)
|
||||
else:
|
||||
|
Reference in New Issue
Block a user