not adding flathub remote when it is not set

This commit is contained in:
Vinicius Moreira
2019-07-30 17:35:46 -03:00
parent bfc13c1c01
commit 2f631ca903
8 changed files with 20 additions and 9 deletions

View File

@@ -8,10 +8,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Improvements ### Improvements
- new environment variable / argument to enable / disable the tray icon and update-check daemon: FPAKMAN_TRAY (--tray) - new environment variable / argument to enable / disable the tray icon and update-check daemon: FPAKMAN_TRAY (--tray)
- search results sorting takes an average of 35% less time, reaching 60% in some scenarios - search results sorting takes an average of 35% less time, reaching 60% in some scenarios
- app boot takes an average of 80% less time
- showing a warning popup when no Flatpak remotes are set after initialization.
### Fixes: ### Fixes:
- apps table not showing empty descriptions - apps table not showing empty descriptions
- replacing default app icons by null icons - replacing default app icons by null icons
- i18n fixes - i18n fixes
### Comments:
- not adding Flatpak default remote (flathub) when initializing. It requires root actions, and will be addressed in a different way in future releases.
## [0.4.2] - 2019-07-28 ## [0.4.2] - 2019-07-28
### Improvements ### Improvements

View File

@@ -108,6 +108,7 @@ caches.append(icon_cache)
disk_loader_factory = DiskCacheLoaderFactory(disk_cache=args.disk_cache, cache_map=cache_map) disk_loader_factory = DiskCacheLoaderFactory(disk_cache=args.disk_cache, cache_map=cache_map)
manager = GenericApplicationManager(managers, disk_loader_factory=disk_loader_factory, app_args=args) manager = GenericApplicationManager(managers, disk_loader_factory=disk_loader_factory, app_args=args)
manager.prepare()
app = QApplication(sys.argv) app = QApplication(sys.argv)
app.setApplicationName(__app_name__) app.setApplicationName(__app_name__)
@@ -136,12 +137,11 @@ else:
manage_window.refresh_apps() manage_window.refresh_apps()
manage_window.show() manage_window.show()
CacheCleaner(caches).start()
warnings = manager.list_warnings() warnings = manager.list_warnings()
if warnings: if warnings:
for warning in warnings: for warning in warnings:
dialog.show_warning(title=locale_keys['warning'].capitalize(), body=warning) dialog.show_warning(title=locale_keys['warning'].capitalize(), body=warning)
CacheCleaner(caches).start()
sys.exit(app.exec_()) sys.exit(app.exec_())

View File

@@ -99,7 +99,6 @@ class GenericApplicationManager(ApplicationManager):
self.map = {m.get_app_type(): m for m in self.managers} self.map = {m.get_app_type(): m for m in self.managers}
self.disk_loader_factory = disk_loader_factory self.disk_loader_factory = disk_loader_factory
self._enabled_map = {} if app_args.check_packaging_once else None self._enabled_map = {} if app_args.check_packaging_once else None
self.prepare()
def _sort(self, apps: List[Application], word: str) -> List[Application]: def _sort(self, apps: List[Application], word: str) -> List[Application]:
exact_name_matches, contains_name_matches, others = [], [], [] exact_name_matches, contains_name_matches, others = [], [], []

View File

@@ -147,7 +147,7 @@ class FlatpakManager(ApplicationManager):
raise Exception("'refresh' is not supported for {}".format(app.__class__.__name__)) raise Exception("'refresh' is not supported for {}".format(app.__class__.__name__))
def prepare(self): def prepare(self):
flatpak.set_default_remotes() pass
def list_updates(self) -> List[ApplicationUpdate]: def list_updates(self) -> List[ApplicationUpdate]:
updates = [] updates = []
@@ -179,4 +179,5 @@ class FlatpakManager(ApplicationManager):
return updates return updates
def list_warnings(self) -> List[str]: def list_warnings(self) -> List[str]:
return None if not flatpak.has_remotes_set():
return [self.locale_keys['flatpak.notification.no_remotes']]

View File

@@ -1,6 +1,6 @@
import re import re
import subprocess import subprocess
from typing import List, Set from typing import List
from fpakman.core import system from fpakman.core import system
from fpakman.core.exception import NoInternetException from fpakman.core.exception import NoInternetException
@@ -219,3 +219,7 @@ def install_and_stream(app_id: str, origin: str):
def set_default_remotes(): def set_default_remotes():
system.run_cmd('flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo') system.run_cmd('flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo')
def has_remotes_set() -> bool:
return bool(system.run_cmd('{} remotes'.format(BASE_CMD)).strip())

View File

@@ -103,3 +103,4 @@ version.unknown=not informed
app.name=application name app.name=application name
warning=warning warning=warning
snap.notification.snapd_unavailable=snapd seems not to be enabled. snap packages will not be available. snap.notification.snapd_unavailable=snapd seems not to be enabled. snap packages will not be available.
flatpak.notification.no_remotes=No Flatpak remotes set. It will not be possible to search for Flatpak apps.

View File

@@ -104,3 +104,4 @@ version.unknown=versión no informada
app.name=nombre del aplicativo app.name=nombre del aplicativo
warning=aviso warning=aviso
snap.notification.snapd_unavailable=snapd no parece estar habilitado. los paquetes snap estarán indisponibles. snap.notification.snapd_unavailable=snapd no parece estar habilitado. los paquetes snap estarán indisponibles.
flatpak.notification.no_remotes=No hay repositorios (remotes) Flatpak configurados. No será posible buscar aplicativos Flatpak.

View File

@@ -104,3 +104,4 @@ version.unknown=versão não informada
app.name=nome do aplicativo app.name=nome do aplicativo
warning=aviso warning=aviso
snap.notification.snapd_unavailable=snapd não parece estar habilitado. os pacotes snap estarão indisponíveis. snap.notification.snapd_unavailable=snapd não parece estar habilitado. os pacotes snap estarão indisponíveis.
flatpak.notification.no_remotes=Não há repositórios (remotes) Flatpak configurados. Não será possível buscar aplicativos Flatpak.