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