Merge branch 'staging' into modules

# Conflicts:
#	CHANGELOG.md
#	fpakman/__init__.py
#	fpakman/app.py
#	fpakman/core/flatpak/controller.py
#	fpakman/core/flatpak/flatpak.py
#	fpakman/core/flatpak/model.py
#	fpakman/core/snap/controller.py
#	fpakman/core/snap/snap.py
#	fpakman/resources/locale/en
#	fpakman/resources/locale/es
#	fpakman/resources/locale/pt
#	fpakman/view/qt/apps_table.py
#	fpakman/view/qt/window.py
This commit is contained in:
Vinicius Moreira
2019-08-06 18:18:36 -03:00
25 changed files with 683 additions and 421 deletions

View File

@@ -9,6 +9,8 @@ from fpakman_api.util.system import FpakmanProcess
from fpakman import ROOT_DIR
SUGGESTIONS_LIMIT = 6
class GenericApplicationManager(ApplicationManager):
@@ -207,3 +209,14 @@ class GenericApplicationManager(ApplicationManager):
warnings.extend(man_warnings)
return warnings
def list_suggestions(self, limit: int) -> List[Application]:
if self.managers:
suggestions = []
for man in self.managers:
if self._is_enabled(man):
man_suggestions = man.list_suggestions(SUGGESTIONS_LIMIT)
if man_suggestions:
man_suggestions = man_suggestions[0:SUGGESTIONS_LIMIT] if len(man_suggestions) > SUGGESTIONS_LIMIT else man_suggestions
suggestions.extend(man_suggestions)
return suggestions