An error occurred while loading the file. Please try again.
-
Pierre-Antoine Rouby authorededc99230
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- coding: utf-8 -*-
from View.ASubWindow import ASubWindow
from View.ListedSubWindow import ListedSubWindow
from PyQt5.QtGui import (
QKeySequence,
)
from PyQt5.QtCore import (
Qt, QVariant, QAbstractTableModel,
)
from PyQt5.QtWidgets import (
QDialogButtonBox, QComboBox, QUndoStack, QShortcut,
QDoubleSpinBox,
)
from View.SedimentLayers.Reach.translate import *
_translate = QCoreApplication.translate
class SLDialog(ASubWindow, ListedSubWindow):
def __init__(self, title="SL", study=None, parent=None):
self._study = study
super(SLDialog, self).__init__(
name=title, ui="SLDialog", parent=parent
)
self.setup_combobox()
self.value = None
def setup_combobox(self):
self.combobox_add_items(
"comboBox",
[_translate("SedimentLayers", "Not defined")] +
list(
map(
lambda sl: str(sl),
self._study.river.sediment_layers.sediment_layers
)
)
)
@property
def sl(self):
return next(
filter(
lambda sl: str(sl) == self.value,
self._study.river.sediment_layers.sediment_layers
)
)
def accept(self):
self.value = self.get_combobox_text("comboBox")
super().accept()