~gary-lasker/software-center/refactor

« back to all changes in this revision

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

  • Committer: Gary Lasker
  • Date: 2011-05-18 01:53:20 UTC
  • Revision ID: gary.lasker@canonical.com-20110518015320-rdm769bmippjqns7
clean up allocation logger

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
DEFAULT_SOCKET_TIMEOUT=4
77
77
 
78
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