mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 22:54:16 +02:00
AppImage info
This commit is contained in:
@@ -74,6 +74,7 @@ class AppImageManager(SoftwareManager):
|
|||||||
if path:
|
if path:
|
||||||
with open(path) as f:
|
with open(path) as f:
|
||||||
app = AppImage(installed=True, **json.loads(f.read()))
|
app = AppImage(installed=True, **json.loads(f.read()))
|
||||||
|
app.icon_url = app.icon_path
|
||||||
|
|
||||||
res.installed.append(app)
|
res.installed.append(app)
|
||||||
|
|
||||||
@@ -108,8 +109,7 @@ class AppImageManager(SoftwareManager):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def get_info(self, pkg: AppImage) -> dict:
|
def get_info(self, pkg: AppImage) -> dict:
|
||||||
# TODO
|
return pkg.get_data_to_cache()
|
||||||
pass
|
|
||||||
|
|
||||||
def get_history(self, pkg: AppImage) -> PackageHistory:
|
def get_history(self, pkg: AppImage) -> PackageHistory:
|
||||||
# TODO
|
# TODO
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from bauh.api.abstract.model import SoftwarePackage
|
|||||||
from bauh.commons import resource
|
from bauh.commons import resource
|
||||||
from bauh.gems.appimage import ROOT_DIR, INSTALLATION_PATH
|
from bauh.gems.appimage import ROOT_DIR, INSTALLATION_PATH
|
||||||
|
|
||||||
CACHED_ATTRS = {'name', 'description', 'version', 'icon_path', 'author'}
|
CACHED_ATTRS = {'name', 'description', 'version', 'url_download', 'author', 'license', 'source', 'icon_path'}
|
||||||
|
|
||||||
|
|
||||||
class AppImage(SoftwarePackage):
|
class AppImage(SoftwarePackage):
|
||||||
@@ -30,8 +30,7 @@ class AppImage(SoftwarePackage):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def has_info(self):
|
def has_info(self):
|
||||||
# TODO
|
return True
|
||||||
return False
|
|
||||||
|
|
||||||
def can_be_downgraded(self):
|
def can_be_downgraded(self):
|
||||||
# TODO
|
# TODO
|
||||||
|
|||||||
@@ -2,4 +2,6 @@ gem.appimage.label=AppImage
|
|||||||
appimage.install.permission=Giving execution permission to {}
|
appimage.install.permission=Giving execution permission to {}
|
||||||
appimage.install.extract=Extracting the content from {}
|
appimage.install.extract=Extracting the content from {}
|
||||||
appimage.install.desktop_entry=Generating a menu shortcut
|
appimage.install.desktop_entry=Generating a menu shortcut
|
||||||
appimage.uninstall.error.remove_folder=Could not remove the application installation directory {}
|
appimage.uninstall.error.remove_folder=Could not remove the application installation directory {}
|
||||||
|
appimage.info.url_download=File URL
|
||||||
|
appimage.info.icon_path=icon
|
||||||
@@ -2,4 +2,6 @@ gem.appimage.label=AppImage
|
|||||||
appimage.install.permission=Concediendo permiso de ejecución a {}
|
appimage.install.permission=Concediendo permiso de ejecución a {}
|
||||||
appimage.install.extract=Extrayendo el contenido de {}
|
appimage.install.extract=Extrayendo el contenido de {}
|
||||||
appimage.install.desktop_entry=Creando un atajo en el menú
|
appimage.install.desktop_entry=Creando un atajo en el menú
|
||||||
appimage.uninstall.error.remove_folder=No se pudo eliminar el directorio de instalación de la aplicación {}
|
appimage.uninstall.error.remove_folder=No se pudo eliminar el directorio de instalación de la aplicación {}
|
||||||
|
appimage.info.url_download=URL del archivo
|
||||||
|
appimage.info.icon_path=icono
|
||||||
@@ -2,4 +2,6 @@ gem.appimage.label=AppImage
|
|||||||
appimage.install.permission=Concedendo permissão de execução para {}
|
appimage.install.permission=Concedendo permissão de execução para {}
|
||||||
appimage.install.extract=Extraindo o conteúdo de {}
|
appimage.install.extract=Extraindo o conteúdo de {}
|
||||||
appimage.install.desktop_entry=Criando um atalho no menu
|
appimage.install.desktop_entry=Criando um atalho no menu
|
||||||
appimage.uninstall.error.remove_folder=Não foi possível remover o diretóri ode instalação do aplicativo {}
|
appimage.uninstall.error.remove_folder=Não foi possível remover o diretóri ode instalação do aplicativo {}
|
||||||
|
appimage.info.url_download=URL do arquivo
|
||||||
|
appimage.info.icon_path=ícone
|
||||||
@@ -9,17 +9,17 @@ IGNORED_ATTRS = {'name', '__app__'}
|
|||||||
|
|
||||||
class InfoDialog(QDialog):
|
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__()
|
super(InfoDialog, self).__init__()
|
||||||
self.setWindowTitle(str(app['__app__']))
|
self.setWindowTitle(str(app['__app__']))
|
||||||
self.screen_size = screen_size
|
self.screen_size = screen_size
|
||||||
self.i18n = locale_keys
|
self.i18n = i18n
|
||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
self.full_vals = []
|
self.full_vals = []
|
||||||
|
|
||||||
self.toolbar_field = QToolBar()
|
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.bt_back.clicked.connect(self.back_to_info)
|
||||||
self.toolbar_field.addWidget(self.bt_back)
|
self.toolbar_field.addWidget(self.bt_back)
|
||||||
self.layout().addWidget(self.toolbar_field)
|
self.layout().addWidget(self.toolbar_field)
|
||||||
@@ -46,14 +46,14 @@ class InfoDialog(QDialog):
|
|||||||
|
|
||||||
for idx, attr in enumerate(sorted(app.keys())):
|
for idx, attr in enumerate(sorted(app.keys())):
|
||||||
if attr not in IGNORED_ATTRS and app[attr]:
|
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):
|
if isinstance(app[attr], list):
|
||||||
val = '\n'.join(['* ' + str(e.strip()) for e in app[attr] if e])
|
val = '\n'.join(['* ' + str(e.strip()) for e in app[attr] if e])
|
||||||
else:
|
else:
|
||||||
val = str(app[attr]).strip()
|
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:
|
if i18n_val:
|
||||||
val = i18n_val
|
val = i18n_val
|
||||||
@@ -65,7 +65,7 @@ class InfoDialog(QDialog):
|
|||||||
text.setStyleSheet("width: 400px")
|
text.setStyleSheet("width: 400px")
|
||||||
text.setReadOnly(True)
|
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")
|
label.setStyleSheet("font-weight: bold")
|
||||||
|
|
||||||
self.gbox_info_layout.addWidget(label, idx, 0)
|
self.gbox_info_layout.addWidget(label, idx, 0)
|
||||||
|
|||||||
@@ -820,7 +820,7 @@ class ManageWindow(QWidget):
|
|||||||
|
|
||||||
def _finish_get_info(self, app_info: dict):
|
def _finish_get_info(self, app_info: dict):
|
||||||
self.finish_action()
|
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_()
|
dialog_info.exec_()
|
||||||
|
|
||||||
def _finish_get_history(self, res: dict):
|
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 ?
|
style.change.question=To change the current style is necessary to restart {}. Proceed ?
|
||||||
manage_window.bt_settings.tooltip=Click here to open extra actions
|
manage_window.bt_settings.tooltip=Click here to open extra actions
|
||||||
downloading=Downloading
|
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?
|
style.change.question=Para cambiar el estilo actual es necesario reiniciar {}. ¿Proceder?
|
||||||
manage_window.bt_settings.tooltip=Haga clic aquí para abrir acciones adicionales
|
manage_window.bt_settings.tooltip=Haga clic aquí para abrir acciones adicionales
|
||||||
downloading=Descargando
|
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 ?
|
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
|
manage_window.bt_settings.tooltip=Clique aqui para abrir ações adicionais
|
||||||
downloading=Baixando
|
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