~mmcg069/software-center/bug855666

« back to all changes in this revision

Viewing changes to softwarecenter/view/installedpane.py

merged (and fixed conflicts) from  lp:~gary-lasker/software-center/sourcesview  

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        self.navigation_bar.remove_id("details")
63
63
        self.notebook.set_current_page(self.PAGE_APPLIST)
64
64
        #self.searchentry.show()
 
65
        
 
66
    def _clear_search(self):
 
67
        # remove the details and clear the search
 
68
        self.searchentry.clear()
 
69
        self.navigation_bar.remove_id("search")
65
70
 
66
71
    @wait_for_apt_cache_ready
67
72
    def refresh_apps(self):
96
101
        """callback when the search entry widget changes"""
97
102
        logging.debug("on_search_terms_changed: '%s'" % terms)
98
103
        self.search_terms = terms
 
104
        if not self.search_terms:
 
105
            self._clear_search()
99
106
        self.refresh_apps()
100
107
        self.notebook.set_current_page(self.PAGE_APPLIST)
101
108
    def on_db_reopen(self, db):
108
115
        """callback when the navigation button with id 'list' is clicked"""
109
116
        if not pathbar.get_active():
110
117
            return
111
 
        # remove the details and clear the search
112
 
        self.searchentry.clear()
113
 
        self.navigation_bar.remove_id("search")
 
118
        self._clear_search()
114
119
        self._show_installed_overview()
115
120
        # only emit something if the model is there
116
121
        model = self.app_view.get_model()