[system-config-printer] Fixed traceback in newprinter.py (bug #680683).

Tim Waugh twaugh at fedoraproject.org
Tue Mar 22 17:16:41 UTC 2011


commit bf408f9e4876dbf1427a873978bf1dcabba76743
Author: Tim Waugh <twaugh at redhat.com>
Date:   Tue Mar 22 17:03:50 2011 +0000

    Fixed traceback in newprinter.py (bug #680683).

 system-config-printer-self.printers.patch |   48 +++++++++++++++++++++++++++++
 system-config-printer.spec                |    5 +++
 2 files changed, 53 insertions(+), 0 deletions(-)
---
diff --git a/system-config-printer-self.printers.patch b/system-config-printer-self.printers.patch
new file mode 100644
index 0000000..5c5f327
--- /dev/null
+++ b/system-config-printer-self.printers.patch
@@ -0,0 +1,48 @@
+diff -up system-config-printer-1.3.2/newprinter.py.self.printers system-config-printer-1.3.2/newprinter.py
+--- system-config-printer-1.3.2/newprinter.py.self.printers	2011-03-16 17:44:09.000000000 +0000
++++ system-config-printer-1.3.2/newprinter.py	2011-03-22 17:02:56.972108028 +0000
+@@ -186,6 +186,7 @@ class NewPrinterGUI(GtkGUI):
+         self.installable_options = False
+         self.ppdsloader = None
+         self.jockey_installed_files = []
++        self.printers = {} # set in init()
+ 
+         # Synchronisation objects.
+         self.drivers_lock = thread.allocate_lock()
+@@ -544,16 +545,9 @@ class NewPrinterGUI(GtkGUI):
+         self.ppds = None
+         self.ppdsmatch_result = None
+         self.printer_finder = None
+-        self.lblNetworkFindSearching.hide ()
+-        self.entNPTNetworkHostname.set_sensitive (True)
+-        self.entNPTNetworkHostname.set_text ('')
+-        self.btnNetworkFind.set_sensitive (True)
+-        self.lblNetworkFindNotFound.hide ()
+-
+-        # Clear out any previous list of makes.
+-        model = self.tvNPMakes.get_model()
+-        model.clear()
+ 
++        # Get a current list of printers so that we can know whether
++        # the chosen name is unique.
+         try:
+             self.cups = authconn.Connection (parent=self.NewPrinterWindow,
+                                              host=self._host,
+@@ -574,6 +568,17 @@ class NewPrinterGUI(GtkGUI):
+             show_IPP_Error (e, m, parent=self.parent)
+             return False
+ 
++        # Initialise widgets.
++        self.lblNetworkFindSearching.hide ()
++        self.entNPTNetworkHostname.set_sensitive (True)
++        self.entNPTNetworkHostname.set_text ('')
++        self.btnNetworkFind.set_sensitive (True)
++        self.lblNetworkFindNotFound.hide ()
++
++        # Clear out any previous list of makes.
++        model = self.tvNPMakes.get_model()
++        model.clear()
++
+         if device_uri == None and dialog_mode in ['printer_with_uri',
+                                                   'device',
+                                                   'ppd']:
diff --git a/system-config-printer.spec b/system-config-printer.spec
index 6220e25..9c3f1e3 100644
--- a/system-config-printer.spec
+++ b/system-config-printer.spec
@@ -12,6 +12,7 @@ Group: System Environment/Base
 Source0: http://cyberelk.net/tim/data/system-config-printer/1.2/%{name}-%{version}.tar.xz
 Patch1: system-config-printer-no-applet-in-gnome.patch
 Patch2: system-config-printer-check-device-ids.patch
+Patch3: system-config-printer-self.printers.patch
 BuildRequires: cups-devel >= 1.2
 BuildRequires: desktop-file-utils >= 0.2.92
 BuildRequires: gettext-devel
@@ -75,6 +76,9 @@ printers.
 # Improvements for check-device-ids from upstream.
 %patch2 -p1 -b .check-device-ids
 
+# Fixed traceback in newprinter.py (bug #680683).
+%patch3 -p1 -b .self.printers
+
 %build
 %configure --with-udev-rules
 
@@ -184,6 +188,7 @@ exit 0
 
 %changelog
 * Tue Mar 22 2011 Tim Waugh <twaugh at redhat.com> 1.3.2-2
+- Fixed traceback in newprinter.py (bug #680683).
 - Improvements for check-device-ids from upstream.
 - Don't start the applet in GNOME at all (bug #677676), now that GNOME
   Shell is capable of handling New Printer notifications. (Note that


More information about the scm-commits mailing list