3145: improve image subsection, bug with filtered objects (patch by Robert Cheramy)

svn: r18341
This commit is contained in:
Jérôme Rapinat 2011-10-17 14:20:53 +00:00
parent d582966fab
commit dcf5fe856f

View File

@ -99,6 +99,7 @@ class EditMediaRef(EditReference):
self.primtab = RefTab(self.dbstate, self.uistate, self.track, self.primtab = RefTab(self.dbstate, self.uistate, self.track,
_('_General'), tblref) _('_General'), tblref)
self.track_ref_for_deletion("primtab") self.track_ref_for_deletion("primtab")
self.rect_pixbuf = None
def setup_filepath(self): def setup_filepath(self):
self.select = self.top.get_object('file_select') self.select = self.top.get_object('file_select')
@ -478,6 +479,8 @@ class EditMediaRef(EditReference):
self.corner2_y_spinbutton.set_value(100) self.corner2_y_spinbutton.set_value(100)
else: else:
if (self.rect_pixbuf == None):
return
self.subpixmap.set_from_pixbuf(self.rect_pixbuf) self.subpixmap.set_from_pixbuf(self.rect_pixbuf)
# ensure the clicks happened at least 5 pixels away from each other # ensure the clicks happened at least 5 pixels away from each other
@ -542,6 +545,9 @@ class EditMediaRef(EditReference):
self.corner2_x_spinbutton.set_value(new_x2) self.corner2_x_spinbutton.set_value(new_x2)
self.corner2_y_spinbutton.set_value(new_y2) self.corner2_y_spinbutton.set_value(new_y2)
# Free the pixbuf as it is not needed anymore
self.rect_pixbuf = None
def _update_addmedia(self, obj): def _update_addmedia(self, obj):
""" """
Called when the add media dialog has been called. Called when the add media dialog has been called.