Skip to content

Commit

Permalink
add show available updates, when newest only is unchecked.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Lauridsen committed Jun 9, 2015
1 parent 64f0059 commit 23dd014
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/yumex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,15 @@ def on_pkg_filter(self, widget, data):
self.current_filter = (widget, data)
pkgs = self.backend.get_packages(data)
if data == 'updates':
if CONFIG.session.newest_only:
pkgs = self.backend.get_packages(data)
else:
pkgs = self.backend.get_packages('updates_all')
obs_pkgs = self.backend.get_packages('obsoletes')
pkgs.extend(obs_pkgs)
self.status.SetUpdateCount(len(pkgs))
else:
pkgs = self.backend.get_packages(data)
self.status.SetUpdateCount(len(pkgs))
self.info.set_package(None)
self.infobar.info(_('Adding packages to view'))
self.package_view.populate(pkgs)
Expand Down
4 changes: 2 additions & 2 deletions src/yumex/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

VERSION = "4.1.3"

NEEDED_DAEMON_API = 1 # The needed dnfdaemon API version
NEEDED_DAEMON_API = 2 # The needed dnfdaemon API version
NEEDED_STATUS_API = 1 # The needed statusicon API version

# find the data dir for resources
Expand Down Expand Up @@ -87,7 +87,7 @@

FILTER_ACTIONS = {'updates': 'u', 'available': 'i', 'installed': 'r',
'obsoletes': 'o', 'downgrade': 'do', 'reinstall': 'ri',
'localinstall': 'li'}
'localinstall': 'li', 'updates_all': 'u'}


PACKAGE_COLORS = {
Expand Down
3 changes: 3 additions & 0 deletions src/yumex/dnf_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ def _build_package_list(self, pkg_ids):
@TimeFunction
def get_packages(self, flt):
"""Get packages for a given pkg filter."""
logger.debug('get-packages : %s ', flt)
if flt == 'all':
filters = ['installed', 'updates', 'available']
else:
Expand All @@ -390,6 +391,8 @@ def get_packages(self, flt):
if not self.cache.is_populated(pkg_flt):
fields = ['summary', 'size'] # fields to get
po_list = self.GetPackages(pkg_flt, fields)
if pkg_flt == 'updates_all':
pkg_flt = 'updates'
pkgs = self._make_pkg_object(po_list, pkg_flt)
self.cache.populate(pkg_flt, pkgs)
result.extend(yumex.backend.Backend.get_packages(self, pkg_flt))
Expand Down

0 comments on commit 23dd014

Please sign in to comment.