Automatically load all datasets in the root data directory and add them to
navigator when project is loaded. Recursion down in data hierarchy is not yet implemented.
This commit is contained in:
parent
e21cd7b323
commit
1c0ea0caee
|
@ -32,6 +32,23 @@ class ProjectView:
|
|||
self.selections = []
|
||||
self._last_selection = None
|
||||
self._dataset_iter_map = {}
|
||||
self._load_datasets()
|
||||
|
||||
|
||||
def _load_datasets(self):
|
||||
print "load datasets from project..."
|
||||
print self.project.data.datasets
|
||||
for ds in self.project.data.datasets:
|
||||
if isinstance(ds, dataset.GraphDataset):
|
||||
icon = laydi.icon_factory.get("graph_dataset")
|
||||
elif isinstance(ds, dataset.CategoryDataset):
|
||||
icon = laydi.icon_factory.get("category_dataset")
|
||||
else:
|
||||
icon = laydi.icon_factory.get("dataset")
|
||||
|
||||
self.add_dataset(ds)
|
||||
self.data_tree_insert(None, ds.get_name(), ds, None, "black", icon)
|
||||
print "...loaded"
|
||||
|
||||
def add_selection_observer(self, observer):
|
||||
self._selection_observers.append(observer)
|
||||
|
|
Reference in New Issue