- Make sure there are enough ink level values (bug #541882).

This commit is contained in:
Tim Waugh 2010-01-06 15:54:23 +00:00
parent a29d1fb03e
commit e4712e86bc
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,31 @@
diff -up system-config-printer-1.1.16/system-config-printer.py.ink-levels system-config-printer-1.1.16/system-config-printer.py
--- system-config-printer-1.1.16/system-config-printer.py.ink-levels 2010-01-06 15:49:08.433408576 +0000
+++ system-config-printer-1.1.16/system-config-printer.py 2010-01-06 15:50:54.892284445 +0000
@@ -2505,6 +2505,7 @@ class GUI(GtkGUI, monitor.Watcher):
self.vboxMarkerLevels.remove (widget)
marker_info = dict()
+ num_markers = 0
for (attr, typ) in [('marker-colors', str),
('marker-names', str),
('marker-types', str),
@@ -2521,10 +2522,18 @@ class GUI(GtkGUI, monitor.Watcher):
except TypeError, s:
debugprint ("%s value not coercible to %s: %s" %
(attr, typ, s))
- val = []
+ val = map (lambda x: 0.0, val)
marker_info[attr] = val
+ if num_markers == 0 or len (val) < num_markers:
+ num_markers = len (val)
+ for attr in ['marker-colors', 'marker-names',
+ 'marker-types', 'marker-levels']:
+ if len (marker_info[attr]) > num_markers:
+ debugprint ("Trimming %s from %s" %
+ (marker_info[attr][num_markers:], attr))
+ del marker_info[attr][num_markers:]
markers = map (lambda color, name, type, level:
(color, name, type, level),

View File

@ -23,6 +23,7 @@ Patch5: system-config-printer-jobviewer-exit.patch
Patch6: system-config-printer-npinit-traceback.patch
Patch7: system-config-printer-notification-timeouts.patch
Patch8: system-config-printer-select-nonexistent-printer.patch
Patch9: system-config-printer-ink-levels.patch
BuildRequires: cups-devel >= 1.2
BuildRequires: python-devel >= 2.4
@ -90,6 +91,7 @@ printers.
%patch6 -p1 -b .npinit-traceback
%patch7 -p1 -b .notification-timeouts
%patch8 -p1 -b .select-nonexistent-printer
%patch9 -p1 -b .ink-levels
%build
%configure --with-udev-rules --with-polkit-1
@ -207,6 +209,7 @@ exit 0
%changelog
* Wed Jan 6 2010 Tim Waugh <twaugh@redhat.com> - 1.1.16-3
- Make sure there are enough ink level values (bug #541882).
- Make sure the printer we added still exists before selecting it
(bug #551436).
- Set notification timeouts appropriately (bug #550829).