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.Solvers import solver_type_list
|
||||||
from Solver.GenericSolver import GenericSolver
|
from Solver.GenericSolver import GenericSolver
|
||||||
|
|
||||||
|
from View.Configure.Translate import ConfigureTranslate
|
||||||
|
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QPushButton,
|
QPushButton,
|
||||||
)
|
)
|
||||||
|
|
@ -30,15 +32,19 @@ class ConfigureSolverWindow(PamhyrDialog):
|
||||||
_pamhyr_name = "Add/Edit Solver"
|
_pamhyr_name = "Add/Edit Solver"
|
||||||
|
|
||||||
def __init__(self, data=None, config=None, parent=None):
|
def __init__(self, data=None, config=None, parent=None):
|
||||||
|
trad = ConfigureTranslate()
|
||||||
|
|
||||||
if data is not None:
|
if data is not None:
|
||||||
name = f"Edit Solver - {data.name}"
|
name = trad["edit_solver"]
|
||||||
|
name += f" - {data.name}"
|
||||||
else:
|
else:
|
||||||
name = "Add a new Solver"
|
name = trad["add_solver"]
|
||||||
|
|
||||||
super(ConfigureSolverWindow, self).__init__(
|
super(ConfigureSolverWindow, self).__init__(
|
||||||
title=name,
|
title=name,
|
||||||
config=config,
|
config=config,
|
||||||
options=[],
|
options=[],
|
||||||
|
trad=trad,
|
||||||
parent=parent
|
parent=parent
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,20 @@ class ConfigureTranslate(PamhyrTranslate):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(ConfigureTranslate, self).__init__()
|
super(ConfigureTranslate, self).__init__()
|
||||||
|
|
||||||
|
self._dict["Configure"] = _translate(
|
||||||
|
"Configure", "Configure"
|
||||||
|
)
|
||||||
|
|
||||||
self._sub_dict["table_headers"] = {
|
self._sub_dict["table_headers"] = {
|
||||||
"name": _translate("Configure", "Name"),
|
"name": _translate("Configure", "Name"),
|
||||||
"type": _translate("Configure", "Type"),
|
"type": _translate("Configure", "Type"),
|
||||||
"description": _translate("Configure", "Description"),
|
"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:
|
if config is None:
|
||||||
config = Config()
|
config = Config()
|
||||||
|
|
||||||
|
trad = ConfigureTranslate()
|
||||||
|
|
||||||
super(ConfigureWindow, self).__init__(
|
super(ConfigureWindow, self).__init__(
|
||||||
title=self._pamhyr_name,
|
title=trad[self._pamhyr_name],
|
||||||
config=config,
|
config=config,
|
||||||
trad=ConfigureTranslate(),
|
trad=trad,
|
||||||
options=[],
|
options=[],
|
||||||
parent=parent
|
parent=parent
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue