system-config-printer/system-config-printer-self.printers.patch

49 lines
2.0 KiB
Diff

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']: