[improvement][ui] new 'updates ignored' category to filter packages with ignored updates

This commit is contained in:
Vinícius Moreira
2020-05-20 11:58:29 -03:00
parent ce7e309799
commit 7f1be2b547
12 changed files with 36 additions and 0 deletions

View File

@@ -213,6 +213,14 @@ class GenericSoftwareManager(SoftwareManager):
disk_loader.stop_working()
disk_loader.join()
if res.installed:
for p in res.installed:
if p.is_update_ignored():
if p.categories is None:
p.categories = ['updates_ignored']
elif 'updates_ignored' not in p.categories:
p.categories.append('updates_ignored')
tf = time.time()
self.logger.info('Took {0:.2f} seconds'.format(tf - ti))
return res
@@ -546,8 +554,17 @@ class GenericSoftwareManager(SoftwareManager):
if manager:
manager.ignore_update(pkg)
if pkg.is_update_ignored():
if pkg.categories is None:
pkg.categories = ['updates_ignored']
elif 'updates_ignored' not in pkg.categories:
pkg.categories.append('updates_ignored')
def revert_ignored_update(self, pkg: SoftwarePackage):
manager = self._get_manager_for(pkg)
if manager:
manager.revert_ignored_update(pkg)
if not pkg.is_update_ignored() and pkg.categories and 'updates_ignored' in pkg.categories:
pkg.categories.remove('updates_ignored')