~ubuntu-branches/ubuntu/karmic/software-store/karmic

« back to all changes in this revision

Viewing changes to softwarestore/view/appdetailsview.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2009-09-04 17:33:33 UTC
  • Revision ID: james.westby@ubuntu.com-20090904173333-7gosux5f7swimyr5
Tags: 0.2.1
* data/ui/SoftwareStore.ui:
  - add menu shortcuts (thanks to seb128)
* show loading animation when fetching screenshots 
  (thanks to rugby471)
* softwarestore/app.py:
  - fix crash when searching in sub-categories
* softwarestore/view/appdetailsview.py:
  - add workaround for missing xpm rendering with webkit
  - scale icons to default icon size
  - fix icon loading from the custom icon path
* softwarestore/app.py:
  - when started multiple times, focus the already running 
    one

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
import string
30
30
import subprocess
31
31
import sys
 
32
import tempfile
32
33
import time
33
34
import xapian
34
35
 
150
151
        description = description.replace("\n\n","</p><p>")
151
152
        return description
152
153
    def wksub_iconpath_loading(self):
153
 
        # FIXME: looks ugly right now, gives a black rectangle on fade-in
154
 
        #return self.datadir+"/status/loading.gif"
155
 
        return ""
 
154
        # FIXME: use relative path here
 
155
        return "/usr/share/icons/hicolor/32x32/animations/software-store-loading.gif"
156
156
    def wksub_iconpath(self):
157
 
        iconinfo = self.icons.lookup_icon(self.iconname, self.APP_ICON_SIZE, 0)
 
157
        iconinfo = self.icons.lookup_icon(os.path.splitext(self.iconname)[0], 
 
158
                                          self.APP_ICON_SIZE, 0)
158
159
        if iconinfo:
159
160
            iconpath = iconinfo.get_filename()
160
161
        else:
161
162
            iconpath = self.MISSING_ICON_PATH
 
163
        # *meh* if not png -> convert
 
164
        # FIXME: make webkit understand xpm files instead
 
165
        if iconpath.endswith(".xpm"):
 
166
            self.tf = tempfile.NamedTemporaryFile()
 
167
            pix = self.icons.load_icon(self.iconname, self.APP_ICON_SIZE, 0)
 
168
            pix.save(self.tf.name, "png")
 
169
            iconpath = self.tf.name
162
170
        return iconpath
163
171
    def wksub_software_installed_icon(self):
164
172
        # FIXME: use relative path here
165
 
        iconpath = "/usr/share/icons/hicolor/24x24/emblems/softwarestore_installed.png"
166
 
        return iconpath
167
 
    def wksub_width(self):
 
173
        return "/usr/share/icons/hicolor/24x24/emblems/software-store-installed.png"
 
174
    def wksub_icon_width(self):
168
175
        return self.APP_ICON_SIZE
169
 
    def wksub_height(self):
 
176
    def wksub_icon_height(self):
170
177
        return self.APP_ICON_SIZE
171
178
    def wksub_action_button_label(self):
172
179
        return self._get_action_button_label_and_value()[0]
384
391
    #view.show_app("AMOR")
385
392
    #view.show_app("3D Chess")
386
393
    #view.show_app("Configuration Editor")
387
 
    view.show_app("ACE")
 
394
    #view.show_app("ACE")
 
395
    #view.show_app("Artha")
 
396
    view.show_app("cournol")
388
397
 
389
398
    win = gtk.Window()
390
399
    scroll.add(view)