~ubuntuone-control-tower/software-center/trunk

« back to all changes in this revision

Viewing changes to softwarecenter/view/appview.py

  • Committer: Kiwinote
  • Date: 2011-03-21 19:21:41 UTC
  • mto: (1615.2.1 software-center)
  • mto: This revision was merged to the branch mainline in revision 1626.
  • Revision ID: kiwinote@gmail.com-20110321192141-h6cqve1hikoxshjr
  * data/new.menu.in,
    softwarecenter/view/appview.py,
    softwarecenter/view/availablepane.py,
    softwarecenter/view/catview_gtk.py:
    - only display available items in what's new (LP: #739276)
    - don't display installed items in what's new (LP: #627114)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1074
1074
        self.distro = get_distro()
1075
1075
        self.db = db
1076
1076
        self.cache = cache
 
1077
        self.available_only = False
1077
1078
        self.supported_only = False
1078
1079
        self.installed_only = False
1079
1080
        self.not_installed_only = False
1080
1081
    @property
1081
1082
    def required(self):
1082
1083
        """ True if the filter is in a state that it should be part of a query """
1083
 
        return (self.supported_only or
 
1084
        return (self.available_only or
 
1085
                self.supported_only or
1084
1086
                self.installed_only or 
1085
1087
                self.not_installed_only)
 
1088
    def set_available_only(self, v):
 
1089
        self.available_only = v
1086
1090
    def set_supported_only(self, v):
1087
1091
        self.supported_only = v
1088
1092
    def set_installed_only(self, v):
1107
1111
        #logging.debug(
1108
1112
        #    "filter: supported_only: %s installed_only: %s '%s'" % (
1109
1113
        #        self.supported_only, self.installed_only, pkgname))
 
1114
        if self.available_only:
 
1115
            if not pkgname in self.cache:
 
1116
                return False
1110
1117
        if self.installed_only:
1111
1118
            # use the lowlevel cache here, twice as fast
1112
1119
            lowlevel_cache = self.cache._cache._cache