def populate_treeview(self, sender=None):
        """
        Fill the TreeView with the objects from the given Plot.           
        """
        model = self.main_model
        model.clear()

        if not self._project:
            return

	logger.debug("self._project: %s" % self._project)
	
        # add Plots
        def add_plot_object(plots, model, parent=None):            
            for (key, plot) in pdict.iteritems( self._project.plots ):
                iter = model.append(parent, [unicode(key), plot, 'sloppy-%s' % plot.__class__.__name__])
            # TODO ?
            # We might add Layers here
        add_plot_object(self._project.plots, model)
            
        # add Datasets
        for (key, ds) in pdict.iteritems( self._project.datasets ):
            model.append(None, [unicode(key), ds, 'sloppy-%s' % ds.__class__.__name__])

        self.collapse_all()
 def add_plot_object(plots, model, parent=None):            
     for (key, plot) in pdict.iteritems( self.project.plots ):
         iter = model.append(parent, [unicode(key), plot, 'sloppy-%s' % plot.__class__.__name__])
 def add_plot_object(plots, model, parent=None):            
     for (key, plot) in pdict.iteritems( self._project.plots ):
         iter = model.append(parent, [key, plot, 'sloppy-%s' % plot.getClassName()])