dialog fixes, replace fork with spawn

svn: r6226
This commit is contained in:
Don Allingham
2006-03-29 22:51:27 +00:00
parent 9d13b0783d
commit 071ae0ac9a
10 changed files with 152 additions and 520 deletions

View File

@@ -188,23 +188,20 @@ class AddMediaObject:
#
#-------------------------------------------------------------------------
def scale_image(path,size):
title_msg = _("Cannot display %s") % path
detail_msg = _('GRAMPS is not able to display the image file. '
'This may be caused by a corrupt file.')
try:
image1 = gtk.gdk.pixbuf_new_from_file(path)
except:
WarningDialog(_("Cannot display %s") % path,
_('GRAMPS is not able to display the image file. '
'This may be caused by a corrupt file.'))
return gtk.gdk.pixbuf_new_from_file(const.icon)
width = image1.get_width()
height = image1.get_height()
scale = size / float(max(width,height))
try:
width = image1.get_width()
height = image1.get_height()
scale = size / float(max(width,height))
return image1.scale_simple(int(scale*width), int(scale*height),
gtk.gdk.INTERP_BILINEAR)
except:
WarningDialog(_("Cannot display %s") % path,
_('GRAMPS is not able to display the image file. '
'This may be caused by a corrupt file.'))
WarningDialog(title_msg, detail_msg)
return gtk.gdk.pixbuf_new_from_file(const.icon)