2007-10-06 Benny Malengier <benny.malengier@gramps-project.org>
* src/DataViews/_RelationView.py: don't crash on missing media ref * src/DisplayTabs/_GalleryTab.py: on missing media ref, notify to run check tool * src/plugins/Check.py: add code to remove missing media ref in person, family, event, place, source. svn: r9089
This commit is contained in:
		@@ -213,10 +213,16 @@ class GalleryTab(ButtonTab):
 | 
			
		||||
        for ref in self.media_list:
 | 
			
		||||
            handle = ref.get_reference_handle()
 | 
			
		||||
            obj = self.dbstate.db.get_object_from_handle(handle)
 | 
			
		||||
            pixbuf = ThumbNails.get_thumbnail_image(obj.get_path(), 
 | 
			
		||||
            if obj is None :
 | 
			
		||||
                #notify user of error
 | 
			
		||||
                from QuestionDialog import RunDatabaseRepair
 | 
			
		||||
                RunDatabaseRepair(
 | 
			
		||||
                            _('Unexisting media found in the Gallery'))
 | 
			
		||||
            else :
 | 
			
		||||
                pixbuf = ThumbNails.get_thumbnail_image(obj.get_path(), 
 | 
			
		||||
                                                    obj.get_mime_type(),
 | 
			
		||||
                                                    ref.get_rectangle())
 | 
			
		||||
            self.iconmodel.append(row=[pixbuf, obj.get_description(), ref])
 | 
			
		||||
                self.iconmodel.append(row=[pixbuf, obj.get_description(), ref])
 | 
			
		||||
        self._connect_icon_model()
 | 
			
		||||
        self._set_label()
 | 
			
		||||
        self._selection_changed()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user