~evfool/software-center/fix506419

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk/appdetailsview_gtk.py

  • Committer: Michael Vogt
  • Date: 2011-05-18 07:15:50 UTC
  • mfrom: (1773.1.8 refactor)
  • Revision ID: michael.vogt@ubuntu.com-20110518071550-83l1wzso1jdgelkb
merged from lp:~mvo/software-center/refactor 

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
from softwarecenter.config import get_config
51
51
from softwarecenter.backend.weblive import get_weblive_backend
52
52
 
53
 
from softwarecenter.view.dialogs import error
 
53
from dialogs import error
54
54
 
55
55
from appdetailsview import AppDetailsViewBase
56
56
 
75
75
# default socket timeout to deal with unreachable screenshot site
76
76
DEFAULT_SOCKET_TIMEOUT=4
77
77
 
78
 
LOG = logging.getLogger("softwarecenter.view.appdetailsview")
 
78
LOG = logging.getLogger(__name__)
 
79
LOG_ALLOCATION = logging.getLogger("softwarecenter.ui.gtk.allocation")
79
80
 
80
81
 
81
82
# fixed black for action bar label, taken from Ambiance gtk-theme
419
420
 
420
421
    def _on_allocate(self, widget, allocation, value_label, space_consumed):
421
422
        if self._allocation == allocation:
422
 
            logging.getLogger("softwarecenter.view.allocation").debug("PackageInfoAllocate skipped!")
 
423
            LOG_ALLOCATION.debug("PackageInfoAllocate skipped!")
423
424
            return True
424
425
        self._allocation = allocation
425
426
 
426
 
        logging.getLogger("softwarecenter.view.allocation").debug("on_alloc widget=%s, allocation=%s" % (widget, allocation))
 
427
        LOG_ALLOCATION.debug("on_alloc widget=%s, allocation=%s" % (widget, allocation))
427
428
 
428
429
        value_label.set_size_request(max(10, allocation.width-space_consumed), -1)
429
430
        return True
500
501
 
501
502
    def _on_allocate(self, widget, allocation, title):
502
503
        if self._allocation == allocation:
503
 
            logging.getLogger("softwarecenter.view.allocation").debug("AddonAllocate skipped!")
 
504
            LOG_ALLOCATION.debug("AddonAllocate skipped!")
504
505
            return True
505
506
        self._allocation = allocation
506
507
 
507
 
        logging.getLogger("softwarecenter.view.allocation").debug("on_alloc widget=%s, allocation=%s" % (widget, allocation))
 
508
        LOG_ALLOCATION.debug("on_alloc widget=%s, allocation=%s" % (widget, allocation))
508
509
        hw = widget.allocation.width
509
510
        cw = self.checkbutton.allocation.width
510
511
        tw = title.allocation.width
966
967
        self.queue_draw()
967
968
 
968
969
        if allocation == self._allocation:
969
 
            logging.getLogger("softwarecenter.view.allocation").debug("TopAllocate skipped!")
 
970
            LOG_ALLOCATION.debug("TopAllocate skipped!")
970
971
            return True
971
972
 
972
 
        logging.getLogger("softwarecenter.view.allocation").debug("on_alloc widget=%s, allocation=%s" % (widget, allocation))
 
973
        LOG_ALLOCATION.debug("on_alloc widget=%s, allocation=%s" % (widget, allocation))
973
974
 
974
975
        self._allocation = allocation
975
976
 
978
979
        return True
979
980
 
980
981
    def _header_on_allocate(self, widget, allocation, spacing):
981
 
        logging.getLogger("softwarecenter.view.allocation").debug("on_alloc widget=%s, allocation=%s" % (widget, allocation))
 
982
        LOG_ALLOCATION.debug("on_alloc widget=%s, allocation=%s" % (widget, allocation))
982
983
        w = allocation.width - self.icon.allocation.width - 2*spacing
983
984
        if self.review_stats_widget.get_property('visible'):
984
985
            w -= self.review_stats_widget.allocation.width
1805
1806
 
1806
1807
    xapian_base_path = "/var/cache/software-center"
1807
1808
    pathname = os.path.join(xapian_base_path, "xapian")
1808
 
    from softwarecenter.apt.aptcache import AptCache
1809
 
    cache = AptCache()
 
1809
    from softwarecenter.db.pkginfo import get_pkg_info
 
1810
    cache = get_pkg_info()
1810
1811
    cache.open()
1811
1812
 
1812
1813
    from softwarecenter.db.database import StoreDatabase