Fix "ADMINISTRATOR_NAME" is not retranslated

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2025-12-13 21:45:21 +08:00
parent 28fa8c12b3
commit ae017d66e0
2 changed files with 8 additions and 2 deletions
+1 -2
View File
@@ -213,5 +213,4 @@ class SystemTrayIcon(
self.setDisconnectedIcon()
def retranslate(self):
# Nothing to do
pass
self.setCustomToolTip()
+7
View File
@@ -111,6 +111,7 @@ class AppMainWindow(AppQMainWindow):
self.setWindowTitle(f'{_(APPLICATION_NAME)} ({_(ADMINISTRATOR_NAME)})')
else:
self.setWindowTitle(f'{_(APPLICATION_NAME)}')
# TODO: Need this?
# self.setAttribute(QtCore.Qt.WidgetAttribute.WA_ShowWithoutActivating)
@@ -579,6 +580,12 @@ class AppMainWindow(AppQMainWindow):
f'{size.toTuple()}'
)
def retranslate(self):
if SystemRuntime.isAdmin():
self.setWindowTitle(f'{_(APPLICATION_NAME)} ({_(ADMINISTRATOR_NAME)})')
else:
self.setWindowTitle(f'{_(APPLICATION_NAME)}')
def cleanup(self):
AppSettings.set('AppMainWindowGeometry', self.saveGeometry())
AppSettings.set('AppMainWindowState', self.saveState())