mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-10 16:44: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)
|
||||
|
||||
Reference in New Issue
Block a user