[Pkg-hpijs-devel] Bug#521696: hplip-data: Supplies tab in hp-toolbox broken

Michael Lange klappnase at web.de
Sun Mar 29 14:44:43 UTC 2009


Package: hplip-data
Version: 2.8.6.b-4
Severity: normal
Tags: patch

Using the hp-toolbox with a HP Business Inkjet 1000 printer I get this error message when trying to view 
the "Supplies" tab:

Traceback (most recent call last):
  File "/usr/share/hplip/ui/devmgr4.py", line 738, in Tabs_currentChanged
    self.TabIndex[tab]()
  File "/usr/share/hplip/ui/devmgr4.py", line 2193, in UpdateSuppliesTab
    agent_sku, level_pixmap, agent_health_desc)
  File "/usr/share/hplip/ui/devmgr4.py", line 137, in __init__
    self.setPixmap(3, level_pixmap)
TypeError: argument 2 of QListViewItem.setPixmap() has an invalid type

I added a "print type(level_pixmap)" to the self.setPixmap() method and found that it was NoneType which 
QListViewItem.setPixmap() would obviously not accept. So I tried and changed the call to

self.setPixmap(3, level_pixmap)

into

if level_pixmap:
    self.setPixmap(3, level_pixmap)

which fixed the problem. I saw then that the Supplies list contains one line per cartridge plus one line 
per print head. The print heads of course do not have a pixmap showing their ink levels which had caused 
the problem. I attached the patch.

Regards

Michael


-- System Information:
Debian Release: 5.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages hplip-data depends on:
ii  python                        2.5.2-3    An interactive high-level object-o

Versions of packages hplip-data recommends:
ii  hplip                         2.8.6.b-4  HP Linux Printing and Imaging Syst

hplip-data suggests no packages.

-- no debconf information
-------------- next part --------------
--- devmgr4.py_orig	2009-03-29 14:29:20.000000000 +0200
+++ devmgr4.py	2009-03-29 14:30:15.000000000 +0200
@@ -134,7 +134,8 @@
     def __init__(self, parent, pixmap, desc, part_no, level_pixmap, status):
         QListViewItem.__init__(self, parent, '', desc, part_no, '', status)
         self.setPixmap(0, pixmap)
-        self.setPixmap(3, level_pixmap)
+        if level_pixmap:
+            self.setPixmap(3, level_pixmap)
 
     def paintCell(self, p, cg, c, w, a):
         color = QColorGroup(cg)


More information about the Pkg-hpijs-devel mailing list