mirror of https://gitlab.com/pamhyr/pamhyr2
IC: Add windows title translate and minor change.
parent
e4eee1c29e
commit
e1f5628a4f
|
|
@ -36,10 +36,11 @@ class DischargeDialog(PamhyrDialog):
|
|||
_pamhyr_ui = "InitialConditions_Dialog_Generator_Discharge"
|
||||
_pamhyr_name = "Discharge"
|
||||
|
||||
def __init__(self, title="Discharge", parent=None):
|
||||
def __init__(self, title="Discharge", trad=None, parent=None):
|
||||
super(DischargeDialog, self).__init__(
|
||||
title=self._pamhyr_name,
|
||||
title=trad[self._pamhyr_name],
|
||||
options=[],
|
||||
trad=trad,
|
||||
parent=parent
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -36,10 +36,11 @@ class HeightDialog(PamhyrDialog):
|
|||
_pamhyr_ui = "InitialConditions_Dialog_Generator_Height"
|
||||
_pamhyr_name = "Height"
|
||||
|
||||
def __init__(self, parent=None):
|
||||
def __init__(self, trad=None, parent=None):
|
||||
super(HeightDialog, self).__init__(
|
||||
title=self._pamhyr_name,
|
||||
title=trad[self._pamhyr_name],
|
||||
options=[],
|
||||
trad=trad,
|
||||
parent=parent
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -68,13 +68,15 @@ class InitialConditionsWindow(PamhyrWindow):
|
|||
_pamhyr_name = "Initial condition"
|
||||
|
||||
def __init__(self, study=None, config=None, reach=None, parent=None):
|
||||
trad = ICTranslate()
|
||||
|
||||
if reach is not None:
|
||||
self._reach = reach
|
||||
else:
|
||||
self._reach = study.river.current_reach()
|
||||
|
||||
name = (
|
||||
self._pamhyr_name +
|
||||
trad[self._pamhyr_name] +
|
||||
" - " + study.name +
|
||||
" - " + self._reach.name
|
||||
)
|
||||
|
|
@ -83,7 +85,7 @@ class InitialConditionsWindow(PamhyrWindow):
|
|||
title=name,
|
||||
study=study,
|
||||
config=config,
|
||||
trad=ICTranslate(),
|
||||
trad=trad,
|
||||
parent=parent
|
||||
)
|
||||
|
||||
|
|
@ -243,14 +245,14 @@ class InitialConditionsWindow(PamhyrWindow):
|
|||
self._update_plot()
|
||||
|
||||
def generate_growing_constante_height(self):
|
||||
dlg = HeightDialog(parent=self)
|
||||
dlg = HeightDialog(trad=self._trad, parent=self)
|
||||
if dlg.exec():
|
||||
value = dlg.value
|
||||
self._table.generate("growing", value)
|
||||
self._update_plot()
|
||||
|
||||
def generate_discharge(self):
|
||||
dlg = DischargeDialog(parent=self)
|
||||
dlg = DischargeDialog(trad=self._trad, parent=self)
|
||||
if dlg.exec():
|
||||
value = dlg.value
|
||||
self._table.generate("discharge", value)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,13 @@ class ICTranslate(PamhyrTranslate):
|
|||
def __init__(self):
|
||||
super(ICTranslate, self).__init__()
|
||||
|
||||
self._dict["Initial condition"] = _translate(
|
||||
"InitialCondition", "Initial condition")
|
||||
self._dict["Discharge"] = _translate(
|
||||
"InitialCondition", "Discharge")
|
||||
self._dict["Height"] = _translate(
|
||||
"InitialCondition", "Height")
|
||||
|
||||
self._dict["elevation"] = _translate(
|
||||
"InitialCondition", "Elevation (m)")
|
||||
self._dict["discharge"] = _translate(
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Heigth</string>
|
||||
<string>Height</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
|||
Loading…
Reference in New Issue