mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[improvement][ui] new 'updates ignored' category to filter packages with ignored updates
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user