~ubuntu-branches/ubuntu/precise/software-center/precise-proposed

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/models/appstore2.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt, Michael Vogt, Gary Lasker, Natalia Bidart
  • Date: 2012-06-28 10:35:55 UTC
  • Revision ID: package-import@ubuntu.com-20120628103555-grvde8fxjyrasdhj
Tags: 5.2.4
[ Michael Vogt ]
* lp:~mvo/software-center/lp970627:
  - fix intermittent crash when expunging the cache (LP: #970627)
* lp:~mvo/software-center/lp971776:
  - fix crash when a downloaded image is invalid for whatever
    reason (network issues, proxy issues, pay-wall in between)
    (LP: #971776)
* lp:~mvo/software-center/lp967036-2:
  - fix unicode error crash for people running with the
    LANGUAGE=zh_CN.UTF-8 or zh_TW.UTF-8 (LP: #967036)
* lp:~mvo/software-center/cookie-jar:
  - fix paypal support in the purchases window (LP: #1018347)

[ Gary Lasker ]
* debian/control:
  - update vcs link to point to the 5.2 branch 
* lp:~gary-lasker/software-center/previous-purchase-sorting-lp873104:
  - return correct results when sorting the list of previous
    purchases (LP: #873104)
* lp:~gary-lasker/software-center/recommendations-string-change-lp986437-for-5.2:
  - switch to the updated recommendations opt-in string now that the 
    corresponding language pack updates are released and available
    (LP: #986437)
* lp:~gary-lasker/software-center/fix-lp920741:
  - fix UnicodeDecodeError when a commercial app's title contains
    a unicode character (LP: #920741)

[ Natalia Bidart ]
* lp:~nataliabidart/software-center/cant-stop-the-music:
  - Stop the video if user navigates away from an app details page
    (LP: #1003954).

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
        else:
122
122
            self.icon_cache = {}
123
123
 
 
124
    def _on_image_download_complete(
 
125
            self, downloader, image_file_path, pkgname):
 
126
        LOG.debug("download for '%s' complete" % image_file_path)
 
127
        try:
 
128
            pb = GdkPixbuf.Pixbuf.new_from_file_at_size(image_file_path,
 
129
                                                        self.icon_size,
 
130
                                                        self.icon_size)
 
131
        except GObject.GError as e:
 
132
            LOG.warn("Failed to get image file for '%s' (%s)",
 
133
                     image_file_path, e)
 
134
            return
 
135
        # replace the icon in the icon_cache now that we've got the real
 
136
        # one
 
137
        icon_file = split_icon_ext(os.path.basename(image_file_path))
 
138
        self.icon_cache[icon_file] = pb
 
139
        self.emit("needs-refresh", pkgname)
 
140
 
124
141
    def _download_icon_and_show_when_ready(self, url, pkgname, icon_file_name):
125
142
        LOG.debug("did not find the icon locally, must download %s" %
126
143
            icon_file_name)
127
144
 
128
 
        def on_image_download_complete(downloader, image_file_path, pkgname):
129
 
            LOG.debug("download for '%s' complete" % image_file_path)
130
 
            pb = GdkPixbuf.Pixbuf.new_from_file_at_size(icon_file_path,
131
 
                                                        self.icon_size,
132
 
                                                        self.icon_size)
133
 
            # replace the icon in the icon_cache now that we've got the real
134
 
            # one
135
 
            icon_file = split_icon_ext(os.path.basename(image_file_path))
136
 
            self.icon_cache[icon_file] = pb
137
 
            self.emit("needs-refresh", pkgname)
138
 
 
139
145
        if url is not None:
140
146
            icon_file_path = os.path.join(SOFTWARE_CENTER_ICON_CACHE_DIR,
141
147
                icon_file_name)
142
148
            image_downloader = SimpleFileDownloader()
143
149
            image_downloader.connect('file-download-complete',
144
 
                on_image_download_complete, pkgname)
 
150
                                     self._on_image_download_complete, pkgname)
145
151
            image_downloader.download_file(url, icon_file_path)
146
152
 
147
153
    @property