mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Pamhyr: Factorize some translate.
This commit is contained in:
1 parent
b3a7e7f465
commit
2e158f4c1b
38 files changed
+274
-239
No files matched your search
+8
-17
@@ -42,6 +42,8 @@ from View.Tools.ASubWindow import WindowToolKit
|
||||
from View.Tools.ListedSubWindow import ListedSubWindow
|
||||
from View.DummyWindow import DummyWindow
|
||||
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
from View.Configure.Window import ConfigureWindow
|
||||
from View.Study.Window import NewStudyWindow
|
||||
from View.About.Window import AboutWindow
|
||||
@@ -73,8 +75,6 @@ except Exception as e:
|
||||
|
||||
from Model.Study import Study
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
no_model_action = [
|
||||
@@ -128,6 +128,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
# Model
|
||||
self._study = None
|
||||
|
||||
# Translate
|
||||
self._trad = MainTranslate()
|
||||
|
||||
# Results
|
||||
self._last_solver = None
|
||||
self._last_results = None
|
||||
@@ -145,9 +148,6 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
self.setup_results()
|
||||
self.setup_timer()
|
||||
|
||||
self.trans = QTranslator(self)
|
||||
# self.ui.retranslateUi()
|
||||
|
||||
if not self.conf.close_correctly:
|
||||
if self.conf.last_study != "":
|
||||
self.dialog_reopen_study()
|
||||
@@ -305,18 +305,11 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
|
||||
if init:
|
||||
self.debug_action = QAction("Debug", self)
|
||||
self.debug_action.setToolTip(
|
||||
_translate("MainWindow", "Open debug window")
|
||||
)
|
||||
self.debug_action.setToolTip(self._trad["open_debug"])
|
||||
self.debug_action.triggered.connect(self.open_debug)
|
||||
|
||||
self.debug_sqlite_action = QAction("Debug SQLite", self)
|
||||
self.debug_sqlite_action.setToolTip(
|
||||
_translate(
|
||||
"MainWindow",
|
||||
"Open SQLite debuging tool ('sqlitebrowser')"
|
||||
)
|
||||
)
|
||||
self.debug_sqlite_action.setToolTip(self._trad["open_debug_sql"])
|
||||
self.debug_sqlite_action.triggered.connect(self.open_sqlite)
|
||||
|
||||
if self.conf.debug:
|
||||
@@ -635,9 +628,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
return lambda: self._activate_window(h)
|
||||
|
||||
action = QAction(window._title, self)
|
||||
action.setToolTip(
|
||||
_translate("MainWindow", "Activate this window")
|
||||
)
|
||||
action.setToolTip(self._trad["active_window"])
|
||||
h = window.hash()
|
||||
fn = lambda_generator(h)
|
||||
action.triggered.connect(fn)
|
||||
|
||||
Reference in new issue
Block a user