~mvo/software-center/new-apps-icons

« back to all changes in this revision

Viewing changes to softwarecenter/db/application.py

* merged lp:~kiwinote/software-center/getting-the-small-things-right
  and tweaked it a little bit
* softwarecenter/app.py:
  - save/restore sidebar width (LP: #567128)
  - don't crash if active_pane doesn't have a searchentry (LP: #611718)
* softwarecenter/db/application.py:
  - add new "display_name" and "display_summary" - when app has no appname, 
    display the summary as primary text (per spec)
    LP: #537436
* softwarecenter/view/appdetailsview_gtk.py:
  - use "display_name" and "display_summary" (LP: #537436)
* softwarecenter/view/availablepane.py:
  - correctly update the status bar after filtering by support status 
    LP: #528062
* softwarecenter/view/basepane.py:
  - basepane doesn't contain a searchentry

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
    @property
186
186
    def maintenance_status(self):
187
187
        return self._distro.get_maintenance_status(
188
 
            self._cache, self.name, self.pkgname, self.component, 
 
188
            self._cache, self.display_name, self.pkgname, self.component, 
189
189
            self.channelname)
190
190
 
191
191
    @property
192
192
    def name(self):
193
193
        return self._app.name
 
194
    
 
195
    @property
 
196
    def display_name(self):
 
197
        """ Return the name as it should be displayed in the UI
 
198
 
 
199
            Note that this may not corespond to the Appname as the
 
200
            spec says the name should be the summary for packages
 
201
            and the summary the pkgname
 
202
        """
 
203
        if self._doc:
 
204
            name = self._db.get_appname(self._doc)
 
205
            if name:
 
206
                return name
 
207
            else:
 
208
                # by spec..
 
209
                return self._db.get_summary(self._doc)
 
210
        return self.name
 
211
 
 
212
    @property
 
213
    def display_summary(self):
 
214
        """ Return the summary as it should be displayed in the UI
 
215
 
 
216
            Note that this may not corespond to the summary value as the
 
217
            spec says the name should be the summary for packages
 
218
            and the summary the pkgname
 
219
        """
 
220
        if self._doc:
 
221
            name = self._db.get_appname(self._doc)
 
222
            if name:
 
223
                return self._db.get_summary(self._doc)
 
224
            else:
 
225
                # by spec..
 
226
                return self._db.get_pkgname(self._doc)
194
227
 
195
228
    @property
196
229
    def pkg(self):