~mmcg069/software-center/description-improvements

« back to all changes in this revision

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

  • Committer: Michael Vogt
  • Date: 2011-09-16 11:55:24 UTC
  • Revision ID: michael.vogt@ubuntu.com-20110916115524-e8ilh4furkdrdbx1
* softwarecenter/ui/gtk3/panes/installedpane.py,
  test/gtk3/test_installedpane.py:
  - fix show/hide technical items when in search mode in the installed
    pane and add regression test

Show diffs side-by-side

added added

removed removed

Lines of Context:
335
335
            self.app_view._append_appcount(self.installed_count, mode=AppView.INSTALLED_MODE)
336
336
            self.spinner_notebook.set_current_page(InstalledPane.Pages.APPVIEW)
337
337
            self.spinner_view.stop()
 
338
            
 
339
            # reapply search if needed
 
340
            if self.state.search_term:
 
341
                self._do_search(self.state.search_term)
 
342
                self.treefilter.refilter()
 
343
 
338
344
            self.emit("app-list-changed", i)
339
345
            return
340
346
 
430
436
            it = self.treefilter.iter_next(it)
431
437
        return
432
438
 
 
439
    def _do_search(self, terms):
 
440
        self.state.search_term = terms
 
441
        xfilter = AppFilter(self.db, self.cache)
 
442
        xfilter.set_installed_only(True)
 
443
        self.enquirer.set_query(self.get_query(),
 
444
                                nonapps_visible=self.nonapps_visible,
 
445
                                filter=xfilter,
 
446
                                nonblocking_load=True)
 
447
        
 
448
        self.visible_docids = self.enquirer.get_docids()
 
449
        self.visible_cats = self._get_vis_cats(self.visible_docids)
 
450
 
433
451
    def _search(self, terms=None):
434
452
        if not terms:
435
453
            self.visible_docids = None
437
455
            self._clear_search()
438
456
 
439
457
        elif self.state.search_term != terms:
440
 
            self.state.search_term = terms
441
 
            xfilter = AppFilter(self.db, self.cache)
442
 
            xfilter.set_installed_only(True)
443
 
            self.enquirer.set_query(self.get_query(),
444
 
                                    nonapps_visible=self.nonapps_visible,
445
 
                                    filter=xfilter,
446
 
                                    nonblocking_load=True)
447
 
 
448
 
            self.visible_docids = self.enquirer.get_docids()
449
 
            self.visible_cats = self._get_vis_cats(self.visible_docids)
 
458
            self._do_search(terms)
450
459
 
451
460
        self.treefilter.refilter()
452
461
        if terms:
585
594
    w.state.channel = AllInstalledChannel()
586
595
    w.display_overview_page(None, None)
587
596
 
588
 
    win.show_all()
 
597
    win.show()
589
598
    return win
590
599
 
591
600