mirror of https://gitlab.com/pamhyr/pamhyr2
Reservoir: Allow to select only internal node.
parent
4f91de4c97
commit
65c1163a55
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue