~kelemeng/software-center/bug640969

« back to all changes in this revision

Viewing changes to softwarecenter/view/appdetailsview_gtk.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt, Gary Lasker, Kiwinote, Matthew Paul Thomas, Colin Watson, Michael Vogt
  • Date: 2010-09-14 12:16:47 UTC
  • Revision ID: james.westby@ubuntu.com-20100914121647-jz0ixmgytxxvgojr
Tags: 2.1.19
[ Gary Lasker ]
* softwarecenter/view/widgets/mkit.py:
  - fix crash during action_bar refresh (LP: #635044)
* softwarecenter/backend/channel.py:
  - always display the partner channel, even if its
    source is not enabled (LP: #635003) 
* softwarecenter/db/application.py,
  softwarecenter/db/database.py,
  softwarecenter/view/appview.py,
  softwarecenter/view/softwarepane.py:
  - make StoreDatabase.get_appname return None if the
    name is not defined in the xapian doc
  - consolidate code to generate application name and
    summary for display in the UI to a single place
  - wire applist, appdetails and the navigation bar
    to use it (LP: #636004)

[ Kiwinote ]
* data/software-center.menu.in:
  - fix typo to now use applications-ocaml icon, thanks mpt (LP: #635732)
* softwarecenter/backend/channel.py:
  - allow 'for purchase' to have an icon in non-English locales (LP: #636242)
* softwarecenter/db/application.py:
  - try to open deb file, except on any sort of error (LP: #633379)
  - simplify when we use which warnings for deb files (LP: #635015)
  - reload pkg cache object and xapian doc if it turns out that the pkgname
    of a deb file is different than what we guessed on basis of the file name
* softwarecenter/utils.py:
  - fix crash when desktop_file is None (LP: #635596)
* softwarecenter/view/appdetailsview_gtk.py:
  - use the display name for app entry in 'where is it' (LP: #635464)
  - restore correct padding in addons status bar (LP: #625230)
* minor tweaks to lp:~gary-lasker/software-center/title-summary-fixes
  - use installed state in status bar for reinstallable debs (LP: #635015)

[ Matthew Paul Thomas ]
* data/software-center.menu.in:
  - fix incorrect Category value in the xml for the Debugging
    subcategory of Developer Tools (LP: #538911)

[ Colin Watson ]
* Fix update-apt-xapian-index crashes when the Dir::Cache::pkgcache file
  doesn't exist (LP: #267330).
  
[ Michael Vogt ]
* softwarecenter/backend/aptd.py:
  - fix "reload()" in enable_channel() and only update the particular
    channel file
* softwarecenter/distro/Ubuntu.py:
  - fix crash for icons loaded from extras.ubuntu.com
* merged lp:~mmcg069/software-center/Bug635375 (LP: #635375)
* merged lp:~mmcg069/software-center/tiny-pathbar-tweak
* merged lp:~mmcg069/software-center/Bug625443 (LP: #625443)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import dialogs
21
21
import gio
22
22
import glib
 
23
import gmenu
23
24
import gobject
24
25
import gtk
25
26
import logging
83
84
                         mkit.SPACING_SMALL+2,
84
85
                         mkit.SPACING_SMALL)
85
86
 
86
 
        self.hbox = gtk.HBox(spacing=mkit.SPACING_LARGE)
 
87
        self.hbox = gtk.HBox(spacing=mkit.SPACING_SMALL)
87
88
        self.add(self.hbox)
88
89
 
89
90
        self.view = view
194
195
                     PKG_STATE_REMOVING,
195
196
                     PKG_STATE_UPGRADING,
196
197
                     APP_ACTION_APPLY):
197
 
            self.button.hide()
198
198
            self.show()
199
199
        elif state == PKG_STATE_NOT_FOUND:
200
200
            self.hide()
215
215
        #         and the associated callback.
216
216
        if state == PKG_STATE_INSTALLING:
217
217
            self.set_label(_('Installing...'))
218
 
            #self.set_button_label(_('Install'))
 
218
            self.button.set_sensitive(False)
 
219
            self.progress.set_fraction(0)
219
220
        elif state == PKG_STATE_INSTALLING_PURCHASED:
220
221
            self.set_label(_(u'Installing purchase\u2026'))
221
222
            #self.set_button_label(_('Install'))
222
223
        elif state == PKG_STATE_REMOVING:
223
224
            self.set_label(_('Removing...'))
224
 
            #self.set_button_label(_('Remove'))
 
225
            self.button.set_sensitive(False)
 
226
            self.progress.set_fraction(0)
225
227
        elif state == PKG_STATE_UPGRADING:
226
228
            self.set_label(_('Upgrading...'))
227
 
            #self.set_button_label(_('Upgrade Available'))
228
 
        elif state == PKG_STATE_INSTALLED:
 
229
            self.button.set_sensitive(False)
 
230
            self.progress.set_fraction(0)
 
231
        elif state == PKG_STATE_INSTALLED or state == PKG_STATE_REINSTALLABLE:
229
232
            if app_details.purchase_date:
230
233
                purchase_date = str(app_details.purchase_date).split()[0]
231
234
                self.set_label(_('Purchased on %s' % purchase_date))
234
237
                self.set_label(_('Installed on %s' % installation_date))
235
238
            else:
236
239
                self.set_label(_('Installed'))
237
 
            self.set_button_label(_('Remove'))
 
240
            if state == PKG_STATE_REINSTALLABLE: # only deb files atm
 
241
                self.set_button_label(_('Reinstall'))
 
242
            elif state == PKG_STATE_INSTALLED:
 
243
                self.set_button_label(_('Remove'))
238
244
        elif state == PKG_STATE_NEEDS_PURCHASE:
239
245
            # FIXME:  need to determine the currency dynamically once we can
240
246
            #         get that info from the software-center-agent/payments service.
253
259
            else:
254
260
                self.set_label(_("Free"))
255
261
            self.set_button_label(_('Install'))
256
 
        elif state == PKG_STATE_REINSTALLABLE:
257
 
            if app_details.price:
258
 
                self.set_label(app_details.price)
259
 
            else:
260
 
                self.set_label("")
261
 
            self.set_button_label(_('Reinstall'))
262
262
        elif state == PKG_STATE_UPGRADABLE:
263
263
            self.set_label(_('Upgrade Available'))
264
264
            self.set_button_label(_('Upgrade'))
265
265
        elif state == APP_ACTION_APPLY:
266
266
            self.set_label(_(u'Changing Add-ons\u2026'))
 
267
            self.button.set_sensitive(False)
 
268
            self.progress.set_fraction(0)
267
269
        elif state == PKG_STATE_UNKNOWN:
268
270
            self.set_button_label("")
269
271
            self.set_label(_("Error"))
1406
1408
                    self.desc_installed_where.pack_start(image, False, False)
1407
1409
 
1408
1410
                label_name = gtk.Label()
1409
 
                label_name.set_text(item.get_name())
 
1411
                if item.get_type() == gmenu.TYPE_ENTRY:
 
1412
                    label_name.set_text(item.get_display_name())
 
1413
                else:
 
1414
                    label_name.set_text(item.get_name())
1410
1415
                self.desc_installed_where.pack_start(label_name, False, False)
1411
1416
                if i+1 < len(where):
1412
1417
                    right_arrow = gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_NONE)
1490
1495
 
1491
1496
 
1492
1497
    def _on_transaction_started(self, backend):
1493
 
        self.action_bar.button.hide()
1494
 
        
1495
1498
        if self.addons_bar.get_applying():
1496
1499
            self.action_bar.configure(self.app_details, APP_ACTION_APPLY)
1497
1500
            return
1526
1529
    def _on_transaction_progress_changed(self, backend, pkgname, progress):
1527
1530
        if self.app_details and self.app_details.pkgname and self.app_details.pkgname == pkgname:
1528
1531
            if not self.action_bar.progress.get_property('visible'):
1529
 
                gobject.idle_add(self._show_prog_idle_cb)
 
1532
                self.action_bar.button.hide()
 
1533
                self.action_bar.progress.show()
1530
1534
            if pkgname in backend.pending_transactions:
1531
1535
                self.action_bar.progress.set_fraction(progress/100.0)
1532
1536
            if progress == 100:
1533
1537
                self.action_bar.progress.set_fraction(1)
1534
1538
        return
1535
1539
 
1536
 
    def _show_prog_idle_cb(self):
1537
 
        # without using an idle callback, the progressbar suffers from
1538
 
        # gitter as it gets allocated on show().  This approach either eliminates
1539
 
        # the issue or makes it unnoticeable... 
1540
 
        self.action_bar.progress.show()
1541
 
        return False
1542
 
 
1543
1540
    #def _draw_icon_inset_frame(self, cr):
1544
1541
        ## draw small or no icon background
1545
1542
        #a = self.app_info.image.allocation