mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
Merge branch 'staging' into modules
# Conflicts: # CHANGELOG.md # fpakman/app.py # fpakman/core/controller.py # fpakman/core/snap/controller.py # fpakman/core/snap/snap.py
This commit is contained in:
@@ -8,7 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
### Comments
|
### Comments
|
||||||
- Env variables / arguments FPAKMAN_SNAP / FPAKMAN_FLATPAK were removed. To disable a supported type, just uninstall its module.
|
- Env variables / arguments FPAKMAN_SNAP / FPAKMAN_FLATPAK were removed. To disable a supported type, just uninstall its module.
|
||||||
|
|
||||||
## [0.4.2]
|
## [0.4.2] - 2019-07-28
|
||||||
|
### Improvements
|
||||||
|
- showing a warning dialog when the application starts and **snapd** is unavailable
|
||||||
### Fixes:
|
### Fixes:
|
||||||
- [Snaps read index error](https://github.com/vinifmor/fpakman/issues/30)
|
- [Snaps read index error](https://github.com/vinifmor/fpakman/issues/30)
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ from fpakman.core.flatpak.model import FlatpakApplication
|
|||||||
from fpakman.util import util
|
from fpakman.util import util
|
||||||
from fpakman.util.cache import Cache
|
from fpakman.util.cache import Cache
|
||||||
from fpakman.util.memory import CacheCleaner
|
from fpakman.util.memory import CacheCleaner
|
||||||
|
from fpakman.view.qt import dialog
|
||||||
from fpakman.view.qt.systray import TrayIcon
|
from fpakman.view.qt.systray import TrayIcon
|
||||||
|
|
||||||
|
|
||||||
@@ -81,21 +82,20 @@ managers = []
|
|||||||
if args.flatpak:
|
if args.flatpak:
|
||||||
flatpak_api_cache = Cache(expiration_time=args.cache_exp)
|
flatpak_api_cache = Cache(expiration_time=args.cache_exp)
|
||||||
cache_map[FlatpakApplication] = flatpak_api_cache
|
cache_map[FlatpakApplication] = flatpak_api_cache
|
||||||
managers.append(FlatpakManager(app_args=args, api_cache=flatpak_api_cache, disk_cache=args.disk_cache, http_session=http_session))
|
managers.append(FlatpakManager(app_args=args, api_cache=flatpak_api_cache, disk_cache=args.disk_cache, http_session=http_session, locale_keys=locale_keys))
|
||||||
caches.append(flatpak_api_cache)
|
caches.append(flatpak_api_cache)
|
||||||
|
|
||||||
if args.disk_cache:
|
if args.disk_cache:
|
||||||
Path(FLATPAK_CACHE_PATH).mkdir(parents=True, exist_ok=True)
|
Path(FLATPAK_CACHE_PATH).mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
if args.snap:
|
if args.snap:
|
||||||
pass
|
|
||||||
# snap_api_cache = Cache(expiration_time=args.cache_exp)
|
# snap_api_cache = Cache(expiration_time=args.cache_exp)
|
||||||
# cache_map[SnapApplication] = snap_api_cache
|
# cache_map[SnapApplication] = snap_api_cache
|
||||||
# managers.append(SnapManager(app_args=args, disk_cache=args.disk_cache, api_cache=snap_api_cache, http_session=http_session))
|
# managers.append(SnapManager(app_args=args, disk_cache=args.disk_cache, api_cache=snap_api_cache, http_session=http_session, locale_keys=locale_keys))
|
||||||
# caches.append(snap_api_cache)
|
# caches.append(snap_api_cache)
|
||||||
#
|
#
|
||||||
# if args.disk_cache:
|
# if args.disk_cache:
|
||||||
# Path(SNAP_CACHE_PATH).mkdir(parents=True, exist_ok=True)
|
# Path(SNAP_CACHE_PATH).mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
icon_cache = Cache(expiration_time=args.icon_exp)
|
icon_cache = Cache(expiration_time=args.icon_exp)
|
||||||
caches.append(icon_cache)
|
caches.append(icon_cache)
|
||||||
@@ -121,4 +121,10 @@ trayIcon.show()
|
|||||||
|
|
||||||
CacheCleaner(caches).start()
|
CacheCleaner(caches).start()
|
||||||
|
|
||||||
|
warnings = manager.list_warnings()
|
||||||
|
|
||||||
|
if warnings:
|
||||||
|
for warning in warnings:
|
||||||
|
dialog.show_warning(title=locale_keys['warning'].capitalize(), body=warning)
|
||||||
|
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
|
|||||||
@@ -189,3 +189,18 @@ class GenericApplicationManager(ApplicationManager):
|
|||||||
updates.extend(man.list_updates())
|
updates.extend(man.list_updates())
|
||||||
|
|
||||||
return updates
|
return updates
|
||||||
|
|
||||||
|
def list_warnings(self) -> List[str]:
|
||||||
|
if self.managers:
|
||||||
|
warnings = None
|
||||||
|
|
||||||
|
for man in self.managers:
|
||||||
|
man_warnings = man.list_warnings()
|
||||||
|
|
||||||
|
if man_warnings:
|
||||||
|
if warnings is None:
|
||||||
|
warnings = []
|
||||||
|
|
||||||
|
warnings.extend(man_warnings)
|
||||||
|
|
||||||
|
return warnings
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ from fpakman.util.cache import Cache
|
|||||||
|
|
||||||
class FlatpakManager(ApplicationManager):
|
class FlatpakManager(ApplicationManager):
|
||||||
|
|
||||||
def __init__(self, app_args: Namespace, api_cache: Cache, disk_cache: bool, http_session):
|
def __init__(self, app_args: Namespace, api_cache: Cache, disk_cache: bool, http_session, locale_keys: dict):
|
||||||
super(FlatpakManager, self).__init__(app_args=app_args)
|
super(FlatpakManager, self).__init__(app_args=app_args, locale_keys=locale_keys)
|
||||||
self.api_cache = api_cache
|
self.api_cache = api_cache
|
||||||
self.http_session = http_session
|
self.http_session = http_session
|
||||||
self.disk_cache = disk_cache
|
self.disk_cache = disk_cache
|
||||||
@@ -176,5 +176,7 @@ class FlatpakManager(ApplicationManager):
|
|||||||
updates.append(ApplicationUpdate(app_id='{}:{}'.format(app['id'], app['branch']),
|
updates.append(ApplicationUpdate(app_id='{}:{}'.format(app['id'], app['branch']),
|
||||||
app_type='flatpak',
|
app_type='flatpak',
|
||||||
version=app.get('version')))
|
version=app.get('version')))
|
||||||
|
|
||||||
return updates
|
return updates
|
||||||
|
|
||||||
|
def list_warnings(self) -> List[str]:
|
||||||
|
return None
|
||||||
|
|||||||
@@ -99,4 +99,6 @@ version.installed=installed version
|
|||||||
version.latest=latest version
|
version.latest=latest version
|
||||||
version.installed_outdated=the installed version is outdated
|
version.installed_outdated=the installed version is outdated
|
||||||
version.unknown=not informed
|
version.unknown=not informed
|
||||||
app.name=application name
|
app.name=application name
|
||||||
|
warning=warning
|
||||||
|
snap.notification.snapd_unavailable=snapd seems not to be enabled. snap packages will not be available.
|
||||||
@@ -100,4 +100,6 @@ version.installed=versión instalada
|
|||||||
version.latest=versión más reciente
|
version.latest=versión más reciente
|
||||||
version.installed_outdated=la versión instalada está desactualizada
|
version.installed_outdated=la versión instalada está desactualizada
|
||||||
version.unknown=versión no informada
|
version.unknown=versión no informada
|
||||||
app.name=nombre del aplicativo
|
app.name=nombre del aplicativo
|
||||||
|
warning=aviso
|
||||||
|
snap.notification.snapd_unavailable=snapd no parece estar habilitado. los paquetes snap estarán indisponibles.
|
||||||
@@ -100,4 +100,6 @@ version.installed=versão instalada
|
|||||||
version.latest=versão mais recente
|
version.latest=versão mais recente
|
||||||
version.installed_outdated=a versão instalada está desatualizada
|
version.installed_outdated=a versão instalada está desatualizada
|
||||||
version.unknown=versão não informada
|
version.unknown=versão não informada
|
||||||
app.name=nome do aplicativo
|
app.name=nome do aplicativo
|
||||||
|
warning=aviso
|
||||||
|
snap.notification.snapd_unavailable=snapd não parece estar habilitado. os pacotes snap estarão indisponíveis.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
from PyQt5.QtGui import QIcon
|
from PyQt5.QtGui import QIcon
|
||||||
from PyQt5.QtWidgets import QMessageBox, QSizePolicy
|
from PyQt5.QtWidgets import QMessageBox
|
||||||
|
|
||||||
from fpakman.core import resource
|
from fpakman.core import resource
|
||||||
|
|
||||||
@@ -16,6 +16,18 @@ def show_error(title: str, body: str, icon: QIcon = QIcon(resource.get_path('img
|
|||||||
error_msg.exec_()
|
error_msg.exec_()
|
||||||
|
|
||||||
|
|
||||||
|
def show_warning(title: str, body: str, icon: QIcon = QIcon(resource.get_path('img/logo.svg'))):
|
||||||
|
msg = QMessageBox()
|
||||||
|
msg.setIcon(QMessageBox.Warning)
|
||||||
|
msg.setWindowTitle(title)
|
||||||
|
msg.setText(body)
|
||||||
|
|
||||||
|
if icon:
|
||||||
|
msg.setWindowIcon(icon)
|
||||||
|
|
||||||
|
msg.exec_()
|
||||||
|
|
||||||
|
|
||||||
def ask_confirmation(title: str, body: str, locale_keys: dict, icon: QIcon = QIcon(resource.get_path('img/logo.svg'))):
|
def ask_confirmation(title: str, body: str, locale_keys: dict, icon: QIcon = QIcon(resource.get_path('img/logo.svg'))):
|
||||||
dialog_confirmation = QMessageBox()
|
dialog_confirmation = QMessageBox()
|
||||||
dialog_confirmation.setIcon(QMessageBox.Question)
|
dialog_confirmation.setIcon(QMessageBox.Question)
|
||||||
|
|||||||
Reference in New Issue
Block a user