Reservoir: Allow to select only internal node.

setup.py
Pierre-Antoine Rouby 2023-11-29 16:41:05 +01:00
parent 4f91de4c97
commit 65c1163a55
1 changed files with 14 additions and 1 deletions

View File

@ -56,9 +56,22 @@ class ComboBoxDelegate(QItemDelegate):
def createEditor(self, parent, option, index):
self.editor = QComboBox(parent)
nodes = list(
map(
lambda n: n.name,
filter(
lambda n: not (
self._data.is_upstream_node(n)
or self._data.is_downstream_node(n)
),
self._data.nodes()
)
)
)
self.editor.addItems(
[_translate("Reservoir", "Not associated")] +
self._data.nodes_names()
nodes
)
self.editor.setCurrentText(index.data(Qt.DisplayRole))