From 016d29ca8c32c5fc70b3db998f2e00d7d366003d Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Feb 11 2010 17:08:37 +0000 Subject: - Avoid clearing device settings when adding printer (bug #563989). --- diff --git a/.cvsignore b/.cvsignore index 7fe4d60..4b8820e 100644 --- a/.cvsignore +++ b/.cvsignore @@ -210,3 +210,4 @@ system-config-printer-1.1.15.tar.xz pycups-1.9.47.tar.bz2 system-config-printer-1.1.16.tar.xz pycups-1.9.48.tar.bz2 +system-config-printer-1.1.17.tar.xz diff --git a/sources b/sources index 9eb3ce9..e2ad3f6 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ ac8f98a40b0fc4b6ab4470f10489887a pysmbc-1.0.6.tar.bz2 -8c2643d8a670eaadc3fa6890149b753b system-config-printer-1.1.16.tar.xz 2e9ed692c75328e7fb88f8c230f70990 pycups-1.9.48.tar.bz2 +b3430b605e5c3e793fdea6899454897f system-config-printer-1.1.17.tar.xz diff --git a/system-config-printer-1.1.16.tar.xz.sig b/system-config-printer-1.1.16.tar.xz.sig deleted file mode 100644 index 1b65b53..0000000 Binary files a/system-config-printer-1.1.16.tar.xz.sig and /dev/null differ diff --git a/system-config-printer-1.1.17.tar.xz.sig b/system-config-printer-1.1.17.tar.xz.sig new file mode 100644 index 0000000..ab48ae8 Binary files /dev/null and b/system-config-printer-1.1.17.tar.xz.sig differ diff --git a/system-config-printer-async-fallback-2.patch b/system-config-printer-async-fallback-2.patch deleted file mode 100644 index 6a89c63..0000000 --- a/system-config-printer-async-fallback-2.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff -up system-config-printer-1.1.16/asyncpk0.py.async-fallback-2 system-config-printer-1.1.16/asyncpk0.py ---- system-config-printer-1.1.16/asyncpk0.py.async-fallback-2 2010-01-24 10:54:59.873184145 +0000 -+++ system-config-printer-1.1.16/asyncpk0.py 2010-01-24 11:04:13.158307567 +0000 -@@ -122,15 +122,16 @@ class PK0Connection(asyncpk1.PK1Connecti - def _call_with_pk (self, use_pycups, pk_method_name, pk_args, - reply_handler, error_handler, unpack_fn, - fallback_fn, args, kwds): -+ asyncmethodcall = _PK0AsyncMethodCall (self._system_bus, self, -+ pk_method_name, pk_args, -+ reply_handler, -+ error_handler, -+ unpack_fn, fallback_fn, -+ args, kwds, -+ self._parent) -+ - if not use_pycups: - try: -- asyncmethodcall = _PK0AsyncMethodCall (self._system_bus, self, -- pk_method_name, pk_args, -- reply_handler, -- error_handler, -- unpack_fn, fallback_fn, -- args, kwds, -- self._parent) - debugprint ("Calling PK method %s" % pk_method_name) - asyncmethodcall.call () - except dbus.DBusException, e: -diff -up system-config-printer-1.1.16/asyncpk1.py.async-fallback-2 system-config-printer-1.1.16/asyncpk1.py ---- system-config-printer-1.1.16/asyncpk1.py.async-fallback-2 2010-01-24 10:54:59.855184707 +0000 -+++ system-config-printer-1.1.16/asyncpk1.py 2010-01-24 11:04:13.160307392 +0000 -@@ -288,15 +288,15 @@ class PK1Connection: - def _call_with_pk (self, use_pycups, pk_method_name, pk_args, - reply_handler, error_handler, unpack_fn, - fallback_fn, args, kwds): -+ asyncmethodcall = _PK1AsyncMethodCall (self._system_bus, self, -+ pk_method_name, pk_args, -+ reply_handler, -+ error_handler, -+ unpack_fn, fallback_fn, -+ args, kwds) -+ - if not use_pycups: - try: -- asyncmethodcall = _PK1AsyncMethodCall (self._system_bus, self, -- pk_method_name, pk_args, -- reply_handler, -- error_handler, -- unpack_fn, fallback_fn, -- args, kwds) -- - debugprint ("Calling PK method %s" % pk_method_name) - asyncmethodcall.call () - except dbus.DBusException, e: diff --git a/system-config-printer-async-fallback.patch b/system-config-printer-async-fallback.patch deleted file mode 100644 index 0739367..0000000 --- a/system-config-printer-async-fallback.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -up system-config-printer-1.1.16/asyncpk1.py.async-fallback system-config-printer-1.1.16/asyncpk1.py ---- system-config-printer-1.1.16/asyncpk1.py.async-fallback 2009-12-22 14:27:37.000000000 +0000 -+++ system-config-printer-1.1.16/asyncpk1.py 2010-01-18 16:53:36.820434799 +0000 -@@ -288,18 +288,24 @@ class PK1Connection: - def _call_with_pk (self, use_pycups, pk_method_name, pk_args, - reply_handler, error_handler, unpack_fn, - fallback_fn, args, kwds): -- asyncmethodcall = _PK1AsyncMethodCall (self._system_bus, self, -- pk_method_name, pk_args, -- reply_handler, error_handler, -- unpack_fn, fallback_fn, -- args, kwds) -+ if not use_pycups: -+ try: -+ asyncmethodcall = _PK1AsyncMethodCall (self._system_bus, self, -+ pk_method_name, pk_args, -+ reply_handler, -+ error_handler, -+ unpack_fn, fallback_fn, -+ args, kwds) -+ -+ debugprint ("Calling PK method %s" % pk_method_name) -+ asyncmethodcall.call () -+ except dbus.DBusException, e: -+ debugprint ("D-Bus call failed: %s" % repr (e)) -+ use_pycups = True - - if use_pycups: - return asyncmethodcall.call_fallback_fn () - -- debugprint ("Calling PK method %s" % pk_method_name) -- asyncmethodcall.call () -- - def _nothing_to_unpack (self): - return None - diff --git a/system-config-printer-asyncpk0-fallback.patch b/system-config-printer-asyncpk0-fallback.patch deleted file mode 100644 index 3f87a51..0000000 --- a/system-config-printer-asyncpk0-fallback.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -up system-config-printer-1.1.16/asyncpk0.py.asyncpk0-fallback system-config-printer-1.1.16/asyncpk0.py ---- system-config-printer-1.1.16/asyncpk0.py.asyncpk0-fallback 2009-12-22 14:44:19.000000000 +0000 -+++ system-config-printer-1.1.16/asyncpk0.py 2010-01-22 11:11:15.604057182 +0000 -@@ -1,6 +1,6 @@ - #!/usr/bin/env python - --## Copyright (C) 2007, 2008, 2009 Red Hat, Inc. -+## Copyright (C) 2007, 2008, 2009, 2010 Red Hat, Inc. - ## Copyright (C) 2008 Novell, Inc. - ## Authors: Tim Waugh , Vincent Untz - -@@ -122,18 +122,24 @@ class PK0Connection(asyncpk1.PK1Connecti - def _call_with_pk (self, use_pycups, pk_method_name, pk_args, - reply_handler, error_handler, unpack_fn, - fallback_fn, args, kwds): -- asyncmethodcall = _PK0AsyncMethodCall (self._system_bus, self, -- pk_method_name, pk_args, -- reply_handler, error_handler, -- unpack_fn, fallback_fn, -- args, kwds, self._parent) -+ if not use_pycups: -+ try: -+ asyncmethodcall = _PK0AsyncMethodCall (self._system_bus, self, -+ pk_method_name, pk_args, -+ reply_handler, -+ error_handler, -+ unpack_fn, fallback_fn, -+ args, kwds, -+ self._parent) -+ debugprint ("Calling PK method %s" % pk_method_name) -+ asyncmethodcall.call () -+ except dbus.DBusException, e: -+ debugprint ("D-Bus call failed: %s" % repr (e)) -+ use_pycups = True - - if use_pycups: - return asyncmethodcall.call_fallback_fn () - -- debugprint ("Calling PK method %s" % pk_method_name) -- asyncmethodcall.call () -- - if __name__ == '__main__': - import gobject - import gtk diff --git a/system-config-printer-auth-no-pw.patch b/system-config-printer-auth-no-pw.patch deleted file mode 100644 index 17510ed..0000000 --- a/system-config-printer-auth-no-pw.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -up system-config-printer-1.1.16/jobviewer.py.auth-no-pw system-config-printer-1.1.16/jobviewer.py ---- system-config-printer-1.1.16/jobviewer.py.auth-no-pw 2009-12-22 14:44:19.000000000 +0000 -+++ system-config-printer-1.1.16/jobviewer.py 2010-01-07 15:40:43.517049465 +0000 -@@ -1,6 +1,6 @@ - --## Copyright (C) 2007, 2008, 2009 Tim Waugh --## Copyright (C) 2007, 2008, 2009 Red Hat, Inc. -+## Copyright (C) 2007, 2008, 2009, 2010 Red Hat, Inc. -+## Author: Tim Waugh - - ## This program is free software; you can redistribute it and/or modify - ## it under the terms of the GNU General Public License as published by -@@ -599,13 +599,12 @@ class JobViewer (GtkGUI, monitor.Watcher - - # Find out which auth-info is required. - try_keyring = USE_KEYRING -- keyring_attrs = None -+ keyring_attrs = dict() - auth_info = None - if try_keyring and 'password' in auth_info_required: - auth_info_required = data.get ('auth-info-required', []) - device_uri = data.get ("device-uri") - (scheme, rest) = urllib.splittype (device_uri) -- keyring_attrs = dict () - if scheme == 'smb': - uri = smburi.SMBURI (uri=device_uri) - (group, server, share, diff --git a/system-config-printer-auto_make.patch b/system-config-printer-auto_make.patch deleted file mode 100644 index 554e4b3..0000000 --- a/system-config-printer-auto_make.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -up system-config-printer-1.1.16/system-config-printer.py.auto_make system-config-printer-1.1.16/system-config-printer.py ---- system-config-printer-1.1.16/system-config-printer.py.auto_make 2010-02-07 10:41:54.920037762 +0000 -+++ system-config-printer-1.1.16/system-config-printer.py 2010-02-07 10:42:18.683912304 +0000 -@@ -6375,10 +6375,14 @@ class NewPrinterGUI(GtkGUI): - model = self.tvNPMakes.get_model() - model.clear() - found = False -- auto_make_lower = self.auto_make.lower () -+ if self.auto_make: -+ auto_make_lower = self.auto_make.lower () -+ else: -+ auto_make_lower = None -+ - for make in makes: - iter = model.append((make,)) -- if make.lower() == auto_make_lower: -+ if auto_make_lower != None and make.lower() == auto_make_lower: - path = model.get_path(iter) - self.tvNPMakes.set_cursor (path) - self.tvNPMakes.scroll_to_cell(path, None, diff --git a/system-config-printer-check-still-connecting.patch b/system-config-printer-check-still-connecting.patch deleted file mode 100644 index 880ad64..0000000 --- a/system-config-printer-check-still-connecting.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up system-config-printer-1.1.16/monitor.py.check-still-connecting system-config-printer-1.1.16/monitor.py ---- system-config-printer-1.1.16/monitor.py.check-still-connecting 2009-12-22 14:44:19.000000000 +0000 -+++ system-config-printer-1.1.16/monitor.py 2010-01-18 16:31:05.664560326 +0000 -@@ -1,7 +1,7 @@ - #!/usr/bin/env python - --## Copyright (C) 2007, 2008, 2009 Tim Waugh --## Copyright (C) 2007, 2008, 2009 Red Hat, Inc. -+## Copyright (C) 2007, 2008, 2009, 2010 Red Hat, Inc. -+## Author: Tim Waugh - - ## This program is free software; you can redistribute it and/or modify - ## it under the terms of the GNU General Public License as published by -@@ -208,7 +208,9 @@ class Monitor: - self.connecting_timers[printer] = timer - return False - -- del self.connecting_timers[printer] -+ if self.connecting_timers.has_key (printer): -+ del self.connecting_timers[printer] -+ - debugprint ("Still-connecting timer fired for `%s'" % printer) - (printer_jobs, my_printers) = self.sort_jobs_by_printer () - self.update_connecting_devices (printer_jobs) diff --git a/system-config-printer-copy-crash.patch b/system-config-printer-copy-crash.patch deleted file mode 100644 index c85d29f..0000000 --- a/system-config-printer-copy-crash.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff -up system-config-printer-1.1.16/options.py.copy-crash system-config-printer-1.1.16/options.py ---- system-config-printer-1.1.16/options.py.copy-crash 2009-12-22 14:44:19.000000000 +0000 -+++ system-config-printer-1.1.16/options.py 2010-01-11 16:05:04.352909594 +0000 -@@ -1,8 +1,9 @@ - ## system-config-printer - --## Copyright (C) 2006, 2007, 2008 Red Hat, Inc. --## Copyright (C) 2008 Tim Waugh --## Copyright (C) 2006 Florian Festi -+## Copyright (C) 2006, 2007, 2008, 2010 Red Hat, Inc. -+## Authors: -+## Tim Waugh -+## Florian Festi - - ## This program is free software; you can redistribute it and/or modify - ## it under the terms of the GNU General Public License as published by -@@ -63,6 +64,9 @@ def OptionWidget(name, v, s, on_change): - # --------------------------------------------------------------------------- - - class OptionInterface: -+ def get_default(self): -+ return None -+ - def get_current_value(self): - raise NotImplemented - -@@ -105,6 +109,9 @@ class OptionAlwaysShown(OptionInterface) - self.use_supported = use_supported - self.reinit (None) - -+ def get_default(self): -+ return self.system_default -+ - def set_default(self, system_default): - # For the media option, the system default depends on the printer's - # PageSize setting. This method allows the main module to tell us -diff -up system-config-printer-1.1.16/system-config-printer.py.copy-crash system-config-printer-1.1.16/system-config-printer.py ---- system-config-printer-1.1.16/system-config-printer.py.copy-crash 2010-01-11 16:05:04.342910797 +0000 -+++ system-config-printer-1.1.16/system-config-printer.py 2010-01-11 16:05:22.957910696 +0000 -@@ -2069,8 +2069,8 @@ class GUI(GtkGUI, monitor.Watcher): - printer.unsetOption(option) - for option in self.server_side_options.itervalues(): - if (option.is_changed() or -- saveall and -- option.get_current_value () != option.system_default): -+ (saveall and -+ option.get_current_value () != option.get_default())): - printer.setOption(option.name, option.get_current_value()) - - except cups.IPPError, (e, s): diff --git a/system-config-printer-device-settings.patch b/system-config-printer-device-settings.patch new file mode 100644 index 0000000..53554e4 --- /dev/null +++ b/system-config-printer-device-settings.patch @@ -0,0 +1,19 @@ +diff -up system-config-printer-1.1.17/system-config-printer.py.device-settings system-config-printer-1.1.17/system-config-printer.py +--- system-config-printer-1.1.17/system-config-printer.py.device-settings 2010-02-09 11:41:44.000000000 +0000 ++++ system-config-printer-1.1.17/system-config-printer.py 2010-02-11 16:56:44.120583145 +0000 +@@ -5312,11 +5312,13 @@ class NewPrinterGUI(GtkGUI): + iter = model.iter_next (iter) + i += 1 + elif not self.device_selected: ++ # Select the device. + column = self.tvNPDevices.get_column (0) + self.tvNPDevices.set_cursor ((0,), column) + +- column = self.tvNPDeviceURIs.get_column (0) +- self.tvNPDeviceURIs.set_cursor (connection_select_path, column) ++ # Select the connection. ++ column = self.tvNPDeviceURIs.get_column (0) ++ self.tvNPDeviceURIs.set_cursor (connection_select_path, column) + + def on_entNPTDevice_changed(self, entry): + self.setNPButtons() diff --git a/system-config-printer-driver-pre-selection.patch b/system-config-printer-driver-pre-selection.patch deleted file mode 100644 index 67b9e2a..0000000 --- a/system-config-printer-driver-pre-selection.patch +++ /dev/null @@ -1,138 +0,0 @@ -diff -up system-config-printer-1.1.16/system-config-printer.py.driver-pre-selection system-config-printer-1.1.16/system-config-printer.py ---- system-config-printer-1.1.16/system-config-printer.py.driver-pre-selection 2010-01-11 14:58:14.392910996 +0000 -+++ system-config-printer-1.1.16/system-config-printer.py 2010-01-11 14:58:23.834909684 +0000 -@@ -3913,6 +3913,7 @@ class NewPrinterGUI(GtkGUI): - self.rbtnChangePPDKeepSettings.set_active(True) - - self.auto_model = "" -+ self.auto_driver = None - ppd = self.mainapp.ppd - #self.mainapp.devid = "MFG:Samsung;MDL:ML-3560;DES:;CMD:GDI;" - devid = self.mainapp.devid -@@ -3968,38 +3969,41 @@ class NewPrinterGUI(GtkGUI): - else: - self.auto_make = devid_dict["MFG"] - self.auto_model = devid_dict["MDL"] -+ self.auto_driver = None - except: - self.auto_make = devid_dict["MFG"] - self.auto_model = devid_dict["MDL"] -+ self.auto_driver = None - if not self.device or not self.device.id: - self.device.id = devid - self.device.id_dict = cupshelpers.parseDeviceID (devid) - self.mainapp.devid = "" - elif ppd: -- attr = ppd.findAttr("Manufacturer") -- if attr: -- mfr = attr.value -- else: -- mfr = "" -- makeandmodel = mfr -- attr = ppd.findAttr("ModelName") -- if not attr: attr = ppd.findAttr("ShortNickName") -- if not attr: attr = ppd.findAttr("NickName") -- if attr: -- if attr.value.startswith(mfr): -- makeandmodel = attr.value -- else: -- makeandmodel += ' ' + attr.value -- else: -- makeandmodel = '' -+ attr = ppd.findAttr("NickName") -+ if not attr: -+ attr = ppd.findAttr("ModelName") -+ -+ if attr.value: -+ mfgmdl = cupshelpers.ppds.ppdMakeModelSplit (attr.value) -+ (self.auto_make, self.auto_model) = mfgmdl - -- (self.auto_make, -- self.auto_model) = \ -- cupshelpers.ppds.ppdMakeModelSplit (makeandmodel) -+ # Search for ppdname with that make-and-model -+ self.loadPPDs () -+ ppds = self.ppds.getInfoFromModel (self.auto_make, -+ self.auto_model) -+ for ppd, info in ppds.iteritems (): -+ if info.get ("ppd-make-and-model") == attr.value: -+ self.auto_driver = ppd -+ break -+ else: -+ self.auto_make = None -+ self.auto_model = None -+ self.auto_driver = None - else: - # Special CUPS names for a raw queue. - self.auto_make = 'Generic' - self.auto_model = 'Raw Queue' -+ self.auto_driver = None - - try: - if self.dialog_mode == "ppd": -@@ -4249,6 +4253,8 @@ class NewPrinterGUI(GtkGUI): - if self.openprinting_query_handle != None: - self.openprinting.cancelOperation (self.openprinting_query_handle) - self.openprinting_query_handle = None -+ -+ self.device = None - return True - - def on_btnNPBack_clicked(self, widget): -@@ -4267,6 +4273,7 @@ class NewPrinterGUI(GtkGUI): - self.busy (self.NewPrinterWindow) - if page_nr == 1: # Device (first page) - self.auto_make, self.auto_model = None, None -+ self.auto_driver = None - self.device.uri = self.getDeviceURI() - if not self.install_hplip_plugin(self.device.uri): - self.on_NPCancel(None) -@@ -4434,6 +4441,7 @@ class NewPrinterGUI(GtkGUI): - cupshelpers.ppds.ppdMakeModelSplit (make_model) - self.auto_make = make - self.auto_model = model -+ self.auto_driver = ppdname - if (status == self.ppds.STATUS_SUCCESS and \ - self.dialog_mode != "ppd"): - self.exactdrivermatch = True -@@ -6414,7 +6422,17 @@ class NewPrinterGUI(GtkGUI): - ppds = self.ppds.getInfoFromModel(pmake, pmodel) - - self.NPDrivers = self.ppds.orderPPDNamesByPreference(ppds.keys(), -- self.jockey_installed_files) -+ self.jockey_installed_files) -+ if self.auto_driver and self.device: -+ drivers = [] -+ for driver in self.NPDrivers: -+ if driver == self.auto_driver: -+ drivers.insert (0, driver) -+ else: -+ drivers.append (driver) -+ -+ self.NPDrivers = drivers -+ - for i in range (len(self.NPDrivers)): - ppd = ppds[self.NPDrivers[i]] - driver = ppd["ppd-make-and-model"] -@@ -6426,7 +6444,12 @@ class NewPrinterGUI(GtkGUI): - except KeyError: - pass - -- if i == 0: -+ if not self.device and self.auto_driver == self.NPDrivers[i]: -+ iter = model.append ((driver + _(" (Current)"),)) -+ path = model.get_path (iter) -+ self.tvNPDrivers.get_selection().select_path(path) -+ self.tvNPDrivers.scroll_to_cell(path, None, True, 0.5, 0.0) -+ elif self.device and i == 0: - iter = model.append ((driver + _(" (recommended)"),)) - path = model.get_path (iter) - self.tvNPDrivers.get_selection().select_path(path) -@@ -6881,6 +6904,7 @@ class NewPrinterGUI(GtkGUI): - checkppd = ppd - - self.NewPrinterWindow.hide() -+ self.device = None - self.mainapp.populateList() - - # Now select it. diff --git a/system-config-printer-duplicate-current.patch b/system-config-printer-duplicate-current.patch deleted file mode 100644 index 9288062..0000000 --- a/system-config-printer-duplicate-current.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -up system-config-printer-1.1.16/system-config-printer.py.duplicate-current system-config-printer-1.1.16/system-config-printer.py ---- system-config-printer-1.1.16/system-config-printer.py.duplicate-current 2010-01-25 16:03:02.859210318 +0000 -+++ system-config-printer-1.1.16/system-config-printer.py 2010-01-25 16:03:38.617208297 +0000 -@@ -4828,7 +4828,7 @@ class NewPrinterGUI(GtkGUI): - gobject.idle_add (self.queryPPDs) - - # Add the network devices to the list. -- self.add_devices (result, current_uri) -+ self.add_devices (result, current_uri, no_more=True) - - def install_hplip_plugin(self, uri): - """ -@@ -5171,16 +5171,18 @@ class NewPrinterGUI(GtkGUI): - self.fetchDevices_conn._begin_operation (_("fetching device list")) - self.fetchDevices (network=False, current_uri=current_uri) - -- def add_devices (self, devices, current_uri): -+ def add_devices (self, devices, current_uri, no_more=False): - if current_uri: - if devices.has_key (current_uri): - current = devices.pop(current_uri) - elif devices.has_key (current_uri.replace (":9100", "")): - current_uri = current_uri.replace (":9100", "") - current = devices.pop(current_uri) -- else: -+ elif no_more: - current = cupshelpers.Device (current_uri) - current.info = "Current device" -+ else: -+ current_uri = None - - devices = devices.values() - diff --git a/system-config-printer-foomatic-recommended.patch b/system-config-printer-foomatic-recommended.patch deleted file mode 100644 index 8eb7f92..0000000 --- a/system-config-printer-foomatic-recommended.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -up system-config-printer-1.1.16/cupshelpers/ppds.py.foomatic-recommended system-config-printer-1.1.16/cupshelpers/ppds.py ---- system-config-printer-1.1.16/cupshelpers/ppds.py.foomatic-recommended 2009-12-22 14:27:37.000000000 +0000 -+++ system-config-printer-1.1.16/cupshelpers/ppds.py 2009-12-23 16:13:13.234214808 +0000 -@@ -248,14 +248,25 @@ def _getDriverType (ppdname, ppds=None): - # Foomatic (generated) -- but which driver? - if ppdname.find ("Generic")!= -1: - return DRIVER_TYPE_FOOMATIC_GENERIC -- if (ppds != None and -- ppds.getInfoFromPPDName (ppdname).\ -- get ('ppd-make-and-model', '').find ("(recommended)") != -1): -- if ppds.getInfoFromPPDName (ppdname).\ -- get ('ppd-make-and-model', '').find ("Postscript") != -1: -- return DRIVER_TYPE_FOOMATIC_RECOMMENDED_POSTSCRIPT -- else: -- return DRIVER_TYPE_FOOMATIC_RECOMMENDED_NON_POSTSCRIPT -+ if ppds != None: -+ info = ppds.getInfoFromPPDName (ppdname) -+ device_id = info.get ('ppd-device-id', '') -+ id_dict = parseDeviceID (device_id) -+ drv = id_dict.get ('DRV', '') -+ drvfields = dict() -+ for field in drv.split (','): -+ if len (field) == 0: -+ continue -+ key = field[0] -+ drvfields[key] = field[1:] -+ -+ ppd_make_and_model = info.get ('ppd-make-and-model', '') -+ if (drvfields.get ('R', '0') == '1' or -+ ppd_make_and_model.find ("(recommended)") != -1): -+ if ppd_make_and_model.find ("Postscript") != -1: -+ return DRIVER_TYPE_FOOMATIC_RECOMMENDED_POSTSCRIPT -+ else: -+ return DRIVER_TYPE_FOOMATIC_RECOMMENDED_NON_POSTSCRIPT - if ppdname.find ("-Postscript")!= -1: - return DRIVER_TYPE_FOOMATIC_PS - if ppdname.find ("-hpijs") != -1: diff --git a/system-config-printer-ink-levels.patch b/system-config-printer-ink-levels.patch deleted file mode 100644 index 64116d6..0000000 --- a/system-config-printer-ink-levels.patch +++ /dev/null @@ -1,31 +0,0 @@ -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), diff --git a/system-config-printer-jobviewer-exit.patch b/system-config-printer-jobviewer-exit.patch deleted file mode 100644 index 1d87b23..0000000 --- a/system-config-printer-jobviewer-exit.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up system-config-printer-1.1.16/system-config-printer.py.jobviewer-exit system-config-printer-1.1.16/system-config-printer.py ---- system-config-printer-1.1.16/system-config-printer.py.jobviewer-exit 2010-01-06 15:25:57.525409643 +0000 -+++ system-config-printer-1.1.16/system-config-printer.py 2010-01-06 15:27:03.767283548 +0000 -@@ -2837,7 +2837,8 @@ class GUI(GtkGUI, monitor.Watcher): - def on_quit_activate(self, widget, event=None): - self.monitor.cleanup () - while len (self.jobviewers) > 0: -- self.jobviewers[0].cleanup () # this will call on_jobviewer_exit -+ # this will call on_jobviewer_exit -+ self.jobviewers[0].on_delete_event () - del self.mainlist - del self.printers - gtk.main_quit() diff --git a/system-config-printer-notification-timeouts.patch b/system-config-printer-notification-timeouts.patch deleted file mode 100644 index 2e30e17..0000000 --- a/system-config-printer-notification-timeouts.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up system-config-printer-1.1.16/applet.py.notification-timeouts system-config-printer-1.1.16/applet.py ---- system-config-printer-1.1.16/applet.py.notification-timeouts 2009-12-22 14:44:19.000000000 +0000 -+++ system-config-printer-1.1.16/applet.py 2010-01-06 15:43:24.219409075 +0000 -@@ -126,6 +126,7 @@ class NewPrinterNotification(dbus.servic - n = pynotify.Notification (title, text, 'printer') - if "actions" in pynotify.get_server_caps(): - n.set_urgency (pynotify.URGENCY_CRITICAL) -+ n.set_timeout (pynotify.EXPIRES_NEVER) - n.add_action ("setup-printer", _("Search"), - lambda x, y: - self.setup_printer (x, y, name, devid)) -@@ -182,6 +183,7 @@ class NewPrinterNotification(dbus.servic - if "actions" in pynotify.get_server_caps(): - try: - self.packagekit = installpackage.PackageKit () -+ n.set_timeout (pynotify.EXPIRES_NEVER) - n.add_action ("install-driver", _("Install"), - lambda x, y: - self.install_driver (x, y, diff --git a/system-config-printer-npinit-traceback.patch b/system-config-printer-npinit-traceback.patch deleted file mode 100644 index dc111de..0000000 --- a/system-config-printer-npinit-traceback.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up system-config-printer-1.1.16/system-config-printer.py.npinit-traceback system-config-printer-1.1.16/system-config-printer.py ---- system-config-printer-1.1.16/system-config-printer.py.npinit-traceback 2010-01-06 15:38:44.618286232 +0000 -+++ system-config-printer-1.1.16/system-config-printer.py 2010-01-06 15:38:54.800408801 +0000 -@@ -3974,7 +3974,7 @@ class NewPrinterGUI(GtkGUI): - self.auto_make = devid_dict["MFG"] - self.auto_model = devid_dict["MDL"] - self.auto_driver = None -- if not self.device or not self.device.id: -+ if self.device and not self.device.id: - self.device.id = devid - self.device.id_dict = cupshelpers.parseDeviceID (devid) - self.mainapp.devid = "" diff --git a/system-config-printer-raw-statereason.patch b/system-config-printer-raw-statereason.patch deleted file mode 100644 index 3453d0e..0000000 --- a/system-config-printer-raw-statereason.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up system-config-printer-1.1.16/statereason.py.raw-statereason system-config-printer-1.1.16/statereason.py ---- system-config-printer-1.1.16/statereason.py.raw-statereason 2010-01-24 11:39:59.564183236 +0000 -+++ system-config-printer-1.1.16/statereason.py 2010-01-24 11:40:09.827308551 +0000 -@@ -137,6 +137,7 @@ class StateReason: - except (cups.IPPError, OSError): - pass - -+ reason = self.get_reason () - if self._ppd: - try: - schemes = ["text", "http", "help", "file"] -@@ -148,10 +149,8 @@ class StateReason: - localized_reason = localized_reason + reason + ", " - if localized_reason != "": - reason = localized_reason[:-2] -- else: -- reason = self.get_reason() - except RuntimeError: -- reason = self.get_reason() -+ pass - - text = _("Printer '%s': '%s'.") % (self.get_printer (), reason) - return (title, text) diff --git a/system-config-printer-rename-error-handling.patch b/system-config-printer-rename-error-handling.patch deleted file mode 100644 index 2e2d309..0000000 --- a/system-config-printer-rename-error-handling.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff -up system-config-printer-1.1.16/system-config-printer.py.rename-error-handling system-config-printer-1.1.16/system-config-printer.py ---- system-config-printer-1.1.16/system-config-printer.py.rename-error-handling 2010-02-03 15:18:11.718210457 +0000 -+++ system-config-printer-1.1.16/system-config-printer.py 2010-02-03 15:18:29.283212210 +0000 -@@ -2944,6 +2944,10 @@ class GUI(GtkGUI, monitor.Watcher): - except RuntimeError: - # Perhaps cupsGetPPD2 failed for a browsed printer - pass -+ except cups.IPPError, (e, m): -+ show_IPP_Error (e, m, self.PrintersWindow) -+ self.populateList () -+ return - - if not self.is_rename_possible (old_name): - return -@@ -2969,13 +2973,15 @@ class GUI(GtkGUI, monitor.Watcher): - # Restore original accepting/rejecting state. - if not rejecting: - try: -- self.printers[old_name].setAccepting (True) -+ self.printer.name = old_name -+ self.printer.setAccepting (True) - except cups.HTTPError, (s,): - show_HTTP_Error (s, self.PrintersWindow) - except cups.IPPError, (e, msg): - show_IPP_Error (e, msg, self.PrintersWindow) - - self.cups._end_operation () -+ self.populateList () - return - - # Restore rejecting state. diff --git a/system-config-printer-select-nonexistent-printer.patch b/system-config-printer-select-nonexistent-printer.patch deleted file mode 100644 index 0ef1e34..0000000 --- a/system-config-printer-select-nonexistent-printer.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up system-config-printer-1.1.16/system-config-printer.py.select-nonexistent-printer system-config-printer-1.1.16/system-config-printer.py ---- system-config-printer-1.1.16/system-config-printer.py.select-nonexistent-printer 2010-01-07 12:42:21.062047874 +0000 -+++ system-config-printer-1.1.16/system-config-printer.py 2010-01-07 12:42:33.235047115 +0000 -@@ -6896,6 +6896,8 @@ class NewPrinterGUI(GtkGUI): - self.mainapp.cups.addPrinter(name, ppd=ppd) - except cups.IPPError, (e, msg): - self.show_IPP_Error(e, msg) -+ self.mainapp.cups._end_operation () -+ return - - self.mainapp.cups._end_operation () - -@@ -6923,6 +6925,11 @@ class NewPrinterGUI(GtkGUI): - - iter = model.iter_next (iter) - -+ if not self.mainapp.printers.has_key (name): -+ # At this stage the printer has disappeared even though we -+ # only added it moments ago. -+ return -+ - # Load information about the printer, - # e.g. self.mainapp.server_side_options and self.mainapp.ppd - # (both used below). diff --git a/system-config-printer-serial-widgets.patch b/system-config-printer-serial-widgets.patch deleted file mode 100644 index 044a909..0000000 --- a/system-config-printer-serial-widgets.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up system-config-printer-1.1.16/system-config-printer.py.serial-widgets system-config-printer-1.1.16/system-config-printer.py ---- system-config-printer-1.1.16/system-config-printer.py.serial-widgets 2010-01-18 17:01:04.326559283 +0000 -+++ system-config-printer-1.1.16/system-config-printer.py 2010-01-18 17:01:24.700559444 +0000 -@@ -5949,6 +5949,9 @@ class NewPrinterGUI(GtkGUI): - break - iter = model.iter_next(iter) - nr += 1 -+ -+ if not iter: -+ widget.set_active (0) - else: # use optionvalues - nr = optionvalues.index( - option_dict[name]) diff --git a/system-config-printer-statereason-tmp.patch b/system-config-printer-statereason-tmp.patch deleted file mode 100644 index 9c79111..0000000 --- a/system-config-printer-statereason-tmp.patch +++ /dev/null @@ -1,75 +0,0 @@ -diff -up system-config-printer-1.1.16/statereason.py.statereason-tmp system-config-printer-1.1.16/statereason.py ---- system-config-printer-1.1.16/statereason.py.statereason-tmp 2009-12-22 14:44:19.000000000 +0000 -+++ system-config-printer-1.1.16/statereason.py 2010-01-18 17:24:22.301560654 +0000 -@@ -1,7 +1,9 @@ - #!/usr/bin/env python - --## Copyright (C) 2007, 2008, 2009 Tim Waugh --## Copyright (C) 2007, 2008, 2009 Red Hat, Inc. -+## Copyright (C) 2007, 2008, 2009, 2010 Red Hat, Inc. -+## Authors: -+## Tim Waugh -+## Jiri Popelka - - ## This program is free software; you can redistribute it and/or modify - ## it under the terms of the GNU General Public License as published by -@@ -18,6 +20,7 @@ - ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - import cups -+import os - - _ = lambda x: x - def set_gettext_function (fn): -@@ -41,6 +44,7 @@ class StateReason: - self.level = None - self.canonical_reason = None - self.connection = connection -+ self._ppd = None - - def get_printer (self): - return self.printer -@@ -125,21 +129,29 @@ class StateReason: - elif self.get_level () == self.ERROR: - title = _("Printer error") - -- try: -- f = self.connection.getPPD(self.printer) -- ppd = cups.PPD (f) -- schemes = ["text", "http", "help", "file"] -- localized_reason = "" -- for scheme in schemes: -- reason = ppd.localizeIPPReason(self.reason, scheme) -- if reason != None: -- localized_reason = localized_reason + reason + ", " -- if localized_reason != "": -- reason = localized_reason[:-2] -- else: -+ if not self._ppd: -+ try: -+ f = self.connection.getPPD(self.printer) -+ self._ppd = cups.PPD (f) -+ os.unlink (f) -+ except (cups.IPPError, OSError): -+ pass -+ -+ if self._ppd: -+ try: -+ schemes = ["text", "http", "help", "file"] -+ localized_reason = "" -+ for scheme in schemes: -+ reason = self._ppd.localizeIPPReason(self.reason, -+ scheme) -+ if reason != None: -+ localized_reason = localized_reason + reason + ", " -+ if localized_reason != "": -+ reason = localized_reason[:-2] -+ else: -+ reason = self.get_reason() -+ except RuntimeError: - reason = self.get_reason() -- except (cups.IPPError, RuntimeError): -- reason = self.get_reason() - - text = _("Printer '%s': '%s'.") % (self.get_printer (), reason) - return (title, text) diff --git a/system-config-printer-typo.patch b/system-config-printer-typo.patch deleted file mode 100644 index fb5e2c0..0000000 --- a/system-config-printer-typo.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up system-config-printer-1.1.16/system-config-printer.py.typo system-config-printer-1.1.16/system-config-printer.py ---- system-config-printer-1.1.16/system-config-printer.py.typo 2009-12-22 14:44:19.000000000 +0000 -+++ system-config-printer-1.1.16/system-config-printer.py 2009-12-23 14:54:15.138689711 +0000 -@@ -4564,7 +4564,7 @@ class NewPrinterGUI(GtkGUI): - not self.device.type in ("socket", "lpd", "ipp", - "http", "https", "bluetooth")): - name = "%s %s" % (self.device.id_dict["MFG"], -- elf.device.id_dict["MDL"]) -+ self.device.id_dict["MDL"]) - descr = "%s %s" % (self.device.id_dict["MFG"], - self.device.id_dict["MDL"]) - except: diff --git a/system-config-printer-userdefault-traceback.patch b/system-config-printer-userdefault-traceback.patch deleted file mode 100644 index 5afe283..0000000 --- a/system-config-printer-userdefault-traceback.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -up system-config-printer-1.1.16/userdefault.py.userdefault-traceback system-config-printer-1.1.16/userdefault.py ---- system-config-printer-1.1.16/userdefault.py.userdefault-traceback 2009-09-01 12:08:33.000000000 +0100 -+++ system-config-printer-1.1.16/userdefault.py 2010-01-18 16:58:17.502559206 +0000 -@@ -1,7 +1,7 @@ - #!/usr/bin/env python - --## Copyright (C) 2006, 2007, 2008 Red Hat, Inc. --## Copyright (C) 2007, 2008 Tim Waugh -+## Copyright (C) 2006, 2007, 2008, 2010 Red Hat, Inc. -+## Author: Tim Waugh - - ## This program is free software; you can redistribute it and/or modify - ## it under the terms of the GNU General Public License as published by -@@ -161,7 +161,11 @@ class UserDefaultPrompt: - self.userdef.clear () - self.set_default_fn (self.name) - else: -- self.userdef.set (self.name) -+ try: -+ self.userdef.set (self.name) -+ except Exception, e: -+ print "Error setting default: %s" % repr (e) -+ - self.refresh_fn () - - dialog.destroy () diff --git a/system-config-printer.spec b/system-config-printer.spec index b5875ae..a6bb773 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -6,8 +6,8 @@ Summary: A printer administration tool Name: system-config-printer -Version: 1.1.16 -Release: 15%{?dist} +Version: 1.1.17 +Release: 2%{?dist} License: GPLv2+ URL: http://cyberelk.net/tim/software/system-config-printer/ Group: System Environment/Base @@ -16,27 +16,7 @@ Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2 Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2 Patch1: system-config-printer-no-epydoc.patch -Patch2: system-config-printer-typo.patch -Patch3: system-config-printer-driver-pre-selection.patch -Patch4: system-config-printer-foomatic-recommended.patch -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 -Patch10: system-config-printer-auth-no-pw.patch -Patch11: system-config-printer-copy-crash.patch -Patch12: system-config-printer-check-still-connecting.patch -Patch13: system-config-printer-async-fallback.patch -Patch14: system-config-printer-userdefault-traceback.patch -Patch15: system-config-printer-serial-widgets.patch -Patch16: system-config-printer-statereason-tmp.patch -Patch17: system-config-printer-asyncpk0-fallback.patch -Patch18: system-config-printer-async-fallback-2.patch -Patch19: system-config-printer-raw-statereason.patch -Patch20: system-config-printer-duplicate-current.patch -Patch21: system-config-printer-rename-error-handling.patch -Patch22: system-config-printer-auto_make.patch +Patch2: system-config-printer-device-settings.patch BuildRequires: cups-devel >= 1.2 BuildRequires: python-devel >= 2.4 @@ -96,27 +76,7 @@ printers. %prep %setup -q -a 1 -a 2 %patch1 -p1 -b .no-epydoc -%patch2 -p1 -b .typo -%patch3 -p1 -b .driver-pre-selection -%patch4 -p1 -b .foomatic-recommended -%patch5 -p1 -b .jobviewer-exit -%patch6 -p1 -b .npinit-traceback -%patch7 -p1 -b .notification-timeouts -%patch8 -p1 -b .select-nonexistent-printer -%patch9 -p1 -b .ink-levels -%patch10 -p1 -b .auth-no-pw -%patch11 -p1 -b .copy-crash -%patch12 -p1 -b .check-still-connecting -%patch13 -p1 -b .async-fallback -%patch14 -p1 -b .userdefault-traceback -%patch15 -p1 -b .serial-widgets -%patch16 -p1 -b .statereason-tmp -%patch17 -p1 -b .asyncpk0-fallback -%patch18 -p1 -b .async-fallback-2 -%patch19 -p1 -b .raw-statereason -%patch20 -p1 -b .duplicate-current -%patch21 -p1 -b .rename-error-handling -%patch22 -p1 -b .auto_make +%patch2 -p1 -b .device-settings %build %configure --with-udev-rules --with-polkit-1 @@ -233,6 +193,18 @@ rm -rf %buildroot exit 0 %changelog +* Thu Feb 11 2010 Tim Waugh - 1.1.17-2 +- Avoid clearing device settings when adding printer (bug #563989). + +* Tue Feb 9 2010 Tim Waugh - 1.1.17-1 +- 1.1.17: + - When retrying authentication as another user, forbid PolicyKit. + - Update 'Time submitted' column when clicking Refresh in job viewer. + - udev-add-printer: avoid traceback when no CMD field present. + - Fixed window modality and transience. + - Set D-Bus timeout when calling asynchronously. + - asyncpk1: Handle cancelJob's optional purge_job parameter. + * Mon Feb 8 2010 Tim Waugh - 1.1.16-16 - No longer requires usermode (bug #562270).