From eedcd2aaa5d4741d60f26ac78ad1739b39b788bc Mon Sep 17 00:00:00 2001 From: Sally Date: Thu, 18 Oct 2018 12:54:11 +0200 Subject: [PATCH] Anpassung der from_metadata Funktion an neue Programmstruktur --- pylot/core/util/widgets.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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