diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 2fd1bae3..4ef6d0c8 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -212,9 +212,6 @@ class AddMetadataWidget(QWidget): self.list_view.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) self.list_model = QtGui.QStandardItemModel(self.list_view) self.list_view.setModel(self.list_model) - def from_metadata(self): - for inventory_path in self.metadata.inventories: - self.add_item(inventory_path, from_metadata=True) self.list_layout.insertWidget(1, self.list_view, 1) def refresh_list(self): @@ -235,6 +232,14 @@ class AddMetadataWidget(QWidget): self.remove_button.clicked.connect(self.remove_item) self.close_button.clicked.connect(self.hide) + def from_metadata(self): + """ + already existing metadata folders are added to the visual list of metadata folders + """ + for inventory_path in self.metadata.inventories: + item = QtGui.QStandardItem(inventory_path) + self.list_model.appendRow(item) + def open_directory(self): """ choosing a directory in the dialog window and returning the path