mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 10:54:16 +02:00
AppImage info
This commit is contained in:
@@ -9,17 +9,17 @@ IGNORED_ATTRS = {'name', '__app__'}
|
||||
|
||||
class InfoDialog(QDialog):
|
||||
|
||||
def __init__(self, app: dict, icon_cache: MemoryCache, locale_keys: dict, screen_size: QSize()):
|
||||
def __init__(self, app: dict, icon_cache: MemoryCache, i18n: dict, screen_size: QSize()):
|
||||
super(InfoDialog, self).__init__()
|
||||
self.setWindowTitle(str(app['__app__']))
|
||||
self.screen_size = screen_size
|
||||
self.i18n = locale_keys
|
||||
self.i18n = i18n
|
||||
layout = QVBoxLayout()
|
||||
self.setLayout(layout)
|
||||
self.full_vals = []
|
||||
|
||||
self.toolbar_field = QToolBar()
|
||||
self.bt_back = QPushButton(locale_keys['back'].capitalize())
|
||||
self.bt_back = QPushButton(i18n['back'].capitalize())
|
||||
self.bt_back.clicked.connect(self.back_to_info)
|
||||
self.toolbar_field.addWidget(self.bt_back)
|
||||
self.layout().addWidget(self.toolbar_field)
|
||||
@@ -46,14 +46,14 @@ class InfoDialog(QDialog):
|
||||
|
||||
for idx, attr in enumerate(sorted(app.keys())):
|
||||
if attr not in IGNORED_ATTRS and app[attr]:
|
||||
i18n_key = app['__app__'].model.get_type() + '.info.' + attr.lower()
|
||||
i18n_key = app['__app__'].model.get_type().lower() + '.info.' + attr.lower()
|
||||
|
||||
if isinstance(app[attr], list):
|
||||
val = '\n'.join(['* ' + str(e.strip()) for e in app[attr] if e])
|
||||
else:
|
||||
val = str(app[attr]).strip()
|
||||
|
||||
i18n_val = locale_keys.get('{}.{}'.format(i18n_key, val.lower()))
|
||||
i18n_val = i18n.get('{}.{}'.format(i18n_key, val.lower()))
|
||||
|
||||
if i18n_val:
|
||||
val = i18n_val
|
||||
@@ -65,7 +65,7 @@ class InfoDialog(QDialog):
|
||||
text.setStyleSheet("width: 400px")
|
||||
text.setReadOnly(True)
|
||||
|
||||
label = QLabel("{}: ".format(locale_keys.get(i18n_key, attr)).capitalize())
|
||||
label = QLabel("{}: ".format(i18n.get(i18n_key, i18n.get(attr.lower(), attr))).capitalize())
|
||||
label.setStyleSheet("font-weight: bold")
|
||||
|
||||
self.gbox_info_layout.addWidget(label, idx, 0)
|
||||
|
||||
@@ -820,7 +820,7 @@ class ManageWindow(QWidget):
|
||||
|
||||
def _finish_get_info(self, app_info: dict):
|
||||
self.finish_action()
|
||||
dialog_info = InfoDialog(app=app_info, icon_cache=self.icon_cache, locale_keys=self.i18n, screen_size=self.screen_size)
|
||||
dialog_info = InfoDialog(app=app_info, icon_cache=self.icon_cache, i18n=self.i18n, screen_size=self.screen_size)
|
||||
dialog_info.exec_()
|
||||
|
||||
def _finish_get_history(self, res: dict):
|
||||
|
||||
@@ -116,4 +116,6 @@ style.change.title=Style change
|
||||
style.change.question=To change the current style is necessary to restart {}. Proceed ?
|
||||
manage_window.bt_settings.tooltip=Click here to open extra actions
|
||||
downloading=Downloading
|
||||
console.install_logs.path=Installation logs can be found at {}
|
||||
console.install_logs.path=Installation logs can be found at {}
|
||||
author=author
|
||||
source=source
|
||||
@@ -118,4 +118,6 @@ style.change.title=Cambio de estilo
|
||||
style.change.question=Para cambiar el estilo actual es necesario reiniciar {}. ¿Proceder?
|
||||
manage_window.bt_settings.tooltip=Haga clic aquí para abrir acciones adicionales
|
||||
downloading=Descargando
|
||||
console.install_logs.path=Los registros de instalación se pueden encontrar en {}
|
||||
console.install_logs.path=Los registros de instalación se pueden encontrar en {}
|
||||
author=autor
|
||||
source=origen
|
||||
@@ -118,4 +118,6 @@ style.change.title=Mudança de estilo
|
||||
style.change.question=Para alterar o estilo atual é necessário reiniciar o {}. Continuar ?
|
||||
manage_window.bt_settings.tooltip=Clique aqui para abrir ações adicionais
|
||||
downloading=Baixando
|
||||
console.install_logs.path=Os registros de instalação podem ser encontrados em {}
|
||||
console.install_logs.path=Os registros de instalação podem ser encontrados em {}
|
||||
author=autor
|
||||
source=fonte
|
||||
Reference in New Issue
Block a user