~gary-lasker/software-center/list-view-stars-gtk3

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/panes/installedpane.py

  • Committer: Michael Vogt
  • Date: 2011-08-02 08:30:26 UTC
  • mfrom: (1917.9.26 the-aesthetics)
  • Revision ID: michael.vogt@ubuntu.com-20110802083026-rvx4cxg7o2j232l8
merged from lp:~mmcg069/software-center/the-aesthetics with some minor tweaks (disable JS and plugins in webkit, set datadir globally in symbolic_icons tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
from softwarecenter.ui.gtk3.views.appview import AppViewFilter
40
40
import softwarecenter.ui.gtk3.dialogs as dialogs
41
41
 
 
42
LOG=logging.getLogger(__name__)
 
43
 
42
44
def interrupt_build_and_wait(f):
43
45
    """ decorator that ensures that a build of the categorised installed apps
44
46
        is interrupted before a new build commences.
47
49
    def wrapper(*args, **kwargs):
48
50
        self = args[0]
49
51
        if self._build_in_progress:
50
 
            print 'Waiting for build to exit...'
 
52
            LOG.debug('Waiting for build to exit...')
51
53
            self._halt_build = True
52
54
            GObject.timeout_add(200, lambda: wrapper(*args, **kwargs))
53
55
            return False
174
176
 
175
177
    #~ @interrupt_build_and_wait
176
178
    def _build_categorised_view(self):
177
 
        print 'Rebuilding categorised installedview...'
 
179
        LOG.debug('Rebuilding categorised installedview...')
178
180
        self.cat_docid_map = {}
179
181
        enq = self.enquirer
180
182
        model = self.base_model # base model not treefilter
187
189
            # node to tree_view
188
190
            if not self._use_category(cat): continue
189
191
            query = self.get_query_for_cat(cat)
 
192
            LOG.debug("filter.instaleld_only: %s" % self.state.filter.installed_only)
190
193
            enq.set_query(query,
191
194
                          sortmode=SortMethods.BY_ALPHABET,
192
195
                          nonapps_visible=self.nonapps_visible,
278
281
                                        self.state.search_term)
279
282
 
280
283
    def get_query_for_cat(self, cat):
281
 
        #~ print self.state.channel
 
284
        LOG.debug("self.state.channel: %s" % self.state.channel)
282
285
        if self.state.channel and self.state.channel.query:
283
286
            query = xapian.Query(xapian.Query.OP_AND,
284
287
                                 cat.query,
384
387
                                    length) % { 'amount' : length, }
385
388
 
386
389
    def display_overview_page(self, page, view_state):
 
390
        LOG.debug("view_state: %s" % view_state)
387
391
        self._build_categorised_view()
388
392
 
389
393
        if self.state.search_term: