~mmcg069/software-center/mkit-theme-tweaks

« back to all changes in this revision

Viewing changes to softwarecenter/view/catview.py

  • Committer: Andrew
  • Date: 2009-10-19 16:51:47 UTC
  • mfrom: (407 trunk)
  • mto: This revision was merged to the branch mainline in revision 442.
  • Revision ID: rugby471@jaunty-toaster-20091019165147-hrqitfl8sa4k6s4p
(merge with trunk)

software-center (1.0) karmic; urgency=low

  - use screenshots.ubuntu.com as screenshot url
* softwarecenter/view/catview.py:
  - do not crash for unavailable categories with <OnlyUnallocated>
    (LP: #451922)

 -- Michael Vogt <michael.vogt@ubuntu.com>Thu, 15 Oct 2009 18:35:58 +0200

software-center (0.5.2) karmic; urgency=low

[ Michael Vogt ]
* softwarecenter/view/appdetailsview.py:
  - deal with connection refused errors properly
  - use shorter default socket timeout to avoid hangs when
    the screenshot site is unavailable
* softwarecenter/db/database.py:
  - require explicit open() to avoid possible race (LP: #449385)
* softwarecenter/view/widgets/imagedialog.py:
  - fix crash when unknown error happend during screenshot download
    (LP: #4479829)
* data/ui/SoftwareCenter.ui:
  - change unicode "..." to three "." to work around bug in 
    gtkbuilder/intltool that makes strings with them untranslatable
    (https://bugzilla.gnome.org/show_bug.cgi?id=596205) (LP: #450600)
* po/*:
  - sync from rosetta and unfuzzy the strings that move
    from &#2026; to "..." (LP: #450600)
* softwarecenter/view/catview.py
  - do not crash if a desktop-directory can not be foudn or is
    invalid (LP: #450842)
* utils/update-software-center:
  - do not crash if glib is not available (e.g. during a upgrade)
    (LP: #450793)
* install the softwarecenter-installed emblem into a private dir
  to make not show up in the nautilus emblems folder (LP: #437385)

[ Josh Holland ]
* Fixed up man page (LP: #448896)

 -- Michael Vogt <michael.vogt@ubuntu.com>Wed, 14 Oct 2009 11:51:26 +0200

software-center (0.5.1) karmic; urgency=low

* icon updates from Kenneth Wimer 
* softwarecenter/db/update.py: 
  - fix index bug in pkgname handling
* make screenshots scrollable (LP: #439420)
* fix reopen() handling by not using xapian.Database.reopen()
  but instead do a full open of the db (LP: #430603)
* softwarecenter/view/appdetailsview.py:
  - add support for http proxies (LP: #446069)
  - fix crash in cdrom handling (LP: #446269)
  - do not show error when a transaction is cancelt 
    (LP: #440941)
* softwarecenter/view/widgets/imagedialog.py:
  - change default window size to match the default image
    size from screenshots.debian.net (LP: #445938)
* debian/control:
  - depend on the latest aptdaemon for working proxy support

 -- Michael Vogt <michael.vogt@ubuntu.com>Mon, 12 Oct 2009 18:25:10 +0200

software-center (0.5.0) karmic; urgency=low

* softwarecenter/db/update.py:
  - when using getdefaultlocale() change the order of the environment
    variable that are checked to 'LANGUAGE','LANG','LC_CTYPE','LC_ALL'
    LP: #444316
* add support RTL in the webkit widgets
* Merged from Matthew McGowan:
  - better integration of the arrow button with the used theme
  - update arrow button when style changes (supports high contrast
    themes and somesuch now too)
  - support RTL langauges with the arrow button
  - new pathbar can be activated via SOFTWARE_CENTER_NEW_PATHBAR=1
    in the environment (not used by default)

 -- Michael Vogt <michael.vogt@ubuntu.com>Wed, 07 Oct 2009 15:52:40 +0200

software-center (0.4.6) karmic; urgency=low

* debian/control:
  - add versionized dependency to aptdaemon (needs some of the
    latest API for the async calls) LP: #444218
* softwarecenter/view/pendingview.py:
  - display the operation (Install Packages, Remove Packages,
    Applying Changes) for operations that come from outside 
    software-center (LP: #444254)
* softwarecenter/app.py:
  - do not crah on corrupted database
* utils/update-software-center:
  - ignore if dbus can not be imported (e.g. because we are in 
    the middle of a upgrade and python packages are unavailable)
    LP: #443177)
  - do not show full stacktrace if dbus is not available 
    (LP: #444089)
  - add a small delay between dubs rebuild signal and actual rebuild
    (LP: #438639)

 -- Michael Vogt <michael.vogt@ubuntu.com>Tue, 06 Oct 2009 11:27:09 +0200

software-center (0.4.5) karmic; urgency=low

* softwarecenter/view/appdetailsview.py:
  - avoid blocking if the authentication dialog comes up 
    (LP: #436413)
* softwarecenter/view/appdetailsview.py:
  - switch to use urls that return 404 if a package has no
    screenshot
* softwarecenter/view/widgets/imagedialog.py,
  softwarecenter/view/appdetailsview.py:
  - merge lp:~mvo/software-center/ubuntu-404 that implements 404 
    handling and show ubuntu branded dummy image (LP: #425874)
* softwarecenter/view/appview.py:
  - support environment to switch sorting for searches:
    SOFTWARE_CENTER_SEARCHES_SORT_MODE={popcon,alphabetic,xapian}
    (to be able to test the different mode quickly)
* softwarecenter/view/appdetailsview.py:
  - fix crash when no icon can be found (LP: #442040, LP: #440306)
* softwarecenter/view/catview.py:
  - do not crash if no icon can be found (LP: #441171)
* data/templates/CategoriesView.html:
  - disable drag-n-drop (LP: #440446)

 -- Michael Vogt <michael.vogt@ubuntu.com>Mon, 05 Oct 2009 18:23:27 +0200

software-center (0.4.4) karmic; urgency=low

* debian/rules:
  - cleanup, we do not need python-central, all the python code is
    in a private dir
* softwarecenter/view/appview.py:
  - display the package name in parenthesis if the application name
    appears multiple times in the database (e.g. for a generic name
    like "Terminal") LP: #434625
* softwarecenter/app.py, softwarecenter/view/viewswitcher.py:
  - automatically switch back to the previous view if the progress
    view is empty and the user has not navigated away manually
    (LP: #431907)
* po/ro.po:
  - added Romanian translation (thanks to Alex Eftimie)

 -- Michael Vogt <michael.vogt@ubuntu.com>Fri, 02 Oct 2009 18:18:16 +0200

software-center (0.4.3) karmic; urgency=low

* debian/rules:
  - remove .PHONY again, it breaks building with DH7

 -- Michael Vogt <michael.vogt@ubuntu.com>Tue, 29 Sep 2009 09:26:32 +0200

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
                              )
59
59
        }
60
60
 
61
 
    def __init__(self, datadir, desktopdir, xapiandb, icons):
 
61
    def __init__(self, datadir, desktopdir, db, icons):
62
62
        """ init the widget, takes
63
63
        
64
64
        datadir - the base directory of the app-store data
65
65
        desktopdir - the dir where the applications.menu file can be found
66
 
        xapiandb - a xapian.Database object
 
66
        db - a Database object
67
67
        icons - a gtk.IconTheme
68
68
        """
69
69
        super(CategoriesView, self).__init__(datadir)
105
105
    def wksub_header(self):
106
106
        return _("Departments")
107
107
 
 
108
    def wksub_text_direction(self):
 
109
        direction = gtk.widget_get_default_direction()
 
110
        if direction ==  gtk.TEXT_DIR_RTL:
 
111
            return 'DIR="RTL"'
 
112
        elif direction ==  gtk.TEXT_DIR_LTR:
 
113
            return 'DIR="LTR"'
 
114
 
108
115
    # helper code for menu parsing etc
109
116
    def _cat_sort_cmp(self, a, b):
110
117
        """sort helper for the categories sorting"""
136
143
                        name = element.text
137
144
                    elif element.tag == "Directory":
138
145
                        cp = ConfigParser()
139
 
                        cp.read("/usr/share/desktop-directories/%s" % element.text)
 
146
                        fname = "/usr/share/desktop-directories/%s" % element.text
 
147
                        logging.debug("reading '%s'" % fname)
 
148
                        cp.read(fname)
 
149
                        try:
 
150
                            untranslated_name = cp.get("Desktop Entry","Name")
 
151
                        except Exception, e:
 
152
                            logging.warn("'%s' has no name" % fname)
 
153
                            continue
140
154
                        try:
141
155
                            gettext_domain = cp.get("Desktop Entry", "X-Ubuntu-Gettext-Domain")
142
156
                        except:
143
157
                            gettext_domain = None
144
 
                        icon = cp.get("Desktop Entry","Icon")
145
 
                        untranslated_name = cp.get("Desktop Entry","Name")
 
158
                        # sometimes there is no icon?
 
159
                        try:
 
160
                            icon = cp.get("Desktop Entry","Icon")
 
161
                        except Exception, e:
 
162
                            icon = "applications-other"
146
163
                        if gettext_domain:
147
164
                            name = gettext.dgettext(gettext_domain, untranslated_name)
148
165
                    elif element.tag == "Include":
168
185
                        categories[untranslated_name] = Category(untranslated_name, name, icon, query)
169
186
        # post processing for <OnlyUnallocated>
170
187
        for unalloc in only_unallocated:
 
188
            if not unalloc in categories:
 
189
                logging.debug("not category '%s' in the unalloced ones" % unalloc)
 
190
                continue
171
191
            cat_unalloc = categories[unalloc]
172
192
            for key in categories:
173
193
                if key != unalloc:
185
205
 
186
206
 
187
207
# test code
188
 
def category_activated(iconview, name, query, xapiandb):
 
208
def category_activated(iconview, name, query, db):
189
209
    #(name, pixbuf, query) = iconview.get_model()[path]
190
 
    enquire = xapian.Enquire(xapiandb)
 
210
    enquire = xapian.Enquire(db)
191
211
    enquire.set_query(query)
192
212
    matches = enquire.get_mset(0, 2000)
193
213
    for m in matches: