mirror of https://gitlab.com/pamhyr/pamhyr2
Config: Add windows title translate.
parent
6340d9ea0b
commit
8895d0d565
|
|
@ -20,6 +20,8 @@ from View.Tools.PamhyrWindow import PamhyrDialog
|
|||
from Solver.Solvers import solver_type_list
|
||||
from Solver.GenericSolver import GenericSolver
|
||||
|
||||
from View.Configure.Translate import ConfigureTranslate
|
||||
|
||||
from PyQt5.QtWidgets import (
|
||||
QPushButton,
|
||||
)
|
||||
|
|
@ -30,15 +32,19 @@ class ConfigureSolverWindow(PamhyrDialog):
|
|||
_pamhyr_name = "Add/Edit Solver"
|
||||
|
||||
def __init__(self, data=None, config=None, parent=None):
|
||||
trad = ConfigureTranslate()
|
||||
|
||||
if data is not None:
|
||||
name = f"Edit Solver - {data.name}"
|
||||
name = trad["edit_solver"]
|
||||
name += f" - {data.name}"
|
||||
else:
|
||||
name = "Add a new Solver"
|
||||
name = trad["add_solver"]
|
||||
|
||||
super(ConfigureSolverWindow, self).__init__(
|
||||
title=name,
|
||||
config=config,
|
||||
options=[],
|
||||
trad=trad,
|
||||
parent=parent
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,20 @@ class ConfigureTranslate(PamhyrTranslate):
|
|||
def __init__(self):
|
||||
super(ConfigureTranslate, self).__init__()
|
||||
|
||||
self._dict["Configure"] = _translate(
|
||||
"Configure", "Configure"
|
||||
)
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("Configure", "Name"),
|
||||
"type": _translate("Configure", "Type"),
|
||||
"description": _translate("Configure", "Description"),
|
||||
}
|
||||
|
||||
# Solvers
|
||||
self._dict["edit_solver"] = _translate(
|
||||
"Configure", "Edit solver"
|
||||
)
|
||||
self._dict["add_solver"] = _translate(
|
||||
"Configure", "Add a new solver"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -83,10 +83,12 @@ class ConfigureWindow(PamhyrDialog):
|
|||
if config is None:
|
||||
config = Config()
|
||||
|
||||
trad = ConfigureTranslate()
|
||||
|
||||
super(ConfigureWindow, self).__init__(
|
||||
title=self._pamhyr_name,
|
||||
title=trad[self._pamhyr_name],
|
||||
config=config,
|
||||
trad=ConfigureTranslate(),
|
||||
trad=trad,
|
||||
options=[],
|
||||
parent=parent
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue