- Applied patch from 1.1.x (3f45e96):

- Show a 'paused' emblem for rejecting/disabled printers (bug #518020).
- Set appropriate tooltip when configuring printer (bug #518007).
- Use separate thread for verifying IPP queue (part of bug #518065).
- Better driver preference order (bug #518045).
This commit is contained in:
Tim Waugh 2009-08-19 17:05:16 +00:00
parent dba4e31faa
commit 6569ac372d
3 changed files with 2436 additions and 85 deletions

View File

@ -1,79 +0,0 @@
diff -up system-config-printer-1.1.11/cupspk.py.getdevices system-config-printer-1.1.11/cupspk.py
--- system-config-printer-1.1.11/cupspk.py.getdevices 2009-08-05 11:33:24.000000000 +0100
+++ system-config-printer-1.1.11/cupspk.py 2009-08-13 17:39:34.251284301 +0100
@@ -300,7 +300,74 @@ class Connection:
# getPPDs
# getServerPPD
# getDocument
-# getDevices
+
+
+ def getDevices(self, *args, **kwds):
+ use_pycups = False
+
+ timeout = 0
+ include_schemes = ''
+ exclude_schemes = ''
+
+ if len(args) == 3:
+ (use_pycups, timeout, include_schemes, exclude_schemes) = self._args_to_tuple([int, str, str], *args)
+ else:
+ if kwds.has_key('timeout'):
+ timeout = kwds['timeout']
+
+ if kwds.has_key('include_schemes'):
+ include_schemes = kwds['include_schemes']
+
+ if kwds.has_key('exclude_schemes'):
+ exclude_schemes = kwds['exclude_schemes']
+
+ pk_args = (timeout, include_schemes, exclude_schemes)
+
+ result = self._call_with_pk_and_fallback(use_pycups,
+ 'DevicesGet', pk_args,
+ self._connection.getDevices,
+ *args, **kwds)
+
+ # return 'result' if fallback was called
+ if len (result.keys()) > 0 and type (result[result.keys()[0]]) == dict:
+ return result
+
+ result_str = {}
+ if result != None:
+ for i in result.keys():
+ if type(i) == dbus.String:
+ result_str[str(i)] = str(result[i])
+ else:
+ result_str[i] = result[i]
+
+ # cups-pk-helper returns all devices in one dictionary.
+ # Keys of different devices are distinguished by ':n' postfix.
+
+ devices = {}
+ n = 0
+ postfix = ':' + str (n)
+ device_keys = [x for x in result_str.keys() if x.endswith(postfix)]
+ while len (device_keys) > 0:
+
+ device_uri = None
+ device_dict = {}
+ for i in device_keys:
+ key = i[:len(i) - len(postfix)]
+ if key != 'device-uri':
+ device_dict[key] = result_str[i]
+ else:
+ device_uri = result_str[i]
+
+ if device_uri != None:
+ devices[device_uri] = device_dict
+
+ n += 1
+ postfix = ':' + str (n)
+ device_keys = [x for x in result_str.keys() if x.endswith(postfix)]
+
+ return devices
+
+
# getJobs
# getJobAttributes

File diff suppressed because it is too large Load Diff

View File

@ -7,15 +7,14 @@
Summary: A printer administration tool Summary: A printer administration tool
Name: system-config-printer Name: system-config-printer
Version: 1.1.11 Version: 1.1.11
Release: 4%{?dist} Release: 5%{?dist}
License: GPLv2+ License: GPLv2+
URL: http://cyberelk.net/tim/software/system-config-printer/ URL: http://cyberelk.net/tim/software/system-config-printer/
Group: System Environment/Base Group: System Environment/Base
Source0: http://cyberelk.net/tim/data/system-config-printer/1.1/system-config-printer-%{version}.tar.xz Source0: http://cyberelk.net/tim/data/system-config-printer/1.1/system-config-printer-%{version}.tar.xz
Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2 Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2
Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2 Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2
Patch1: system-config-printer-getdevices.patch Patch1: system-config-printer-scp-git.patch
Patch2: system-config-printer-hplip-hack.patch
BuildRequires: cups-devel >= 1.2 BuildRequires: cups-devel >= 1.2
BuildRequires: python-devel >= 2.4 BuildRequires: python-devel >= 2.4
@ -26,6 +25,7 @@ BuildRequires: intltool
BuildRequires: libusb-devel, libudev-devel BuildRequires: libusb-devel, libudev-devel
BuildRequires: xmlto BuildRequires: xmlto
BuildRequires: epydoc BuildRequires: epydoc
BuildRequires: autoconf, automake
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -76,8 +76,11 @@ printers.
%prep %prep
%setup -q -a 1 -a 2 %setup -q -a 1 -a 2
%patch1 -p1 -b .getdevices # Applied patch from 1.1.x (3f45e96).
%patch2 -p1 -b .hplip-hack %patch1 -p1 -b .scp-git
aclocal
automake --copy --add-missing
autoconf
%build %build
%configure --with-udev-rules %configure --with-udev-rules
@ -173,7 +176,6 @@ rm -rf %buildroot
%{_datadir}/%{name}/userdefault.py* %{_datadir}/%{name}/userdefault.py*
%{_datadir}/%{name}/XmlHelper.py* %{_datadir}/%{name}/XmlHelper.py*
%{_datadir}/%{name}/gtk_label_autowrap.py* %{_datadir}/%{name}/gtk_label_autowrap.py*
%{_datadir}/%{name}/gtk_treeviewtooltips.py*
%{_datadir}/%{name}/applet.py* %{_datadir}/%{name}/applet.py*
%{_datadir}/%{name}/troubleshoot %{_datadir}/%{name}/troubleshoot
%{_datadir}/%{name}/icons %{_datadir}/%{name}/icons
@ -190,6 +192,14 @@ rm -rf %buildroot
exit 0 exit 0
%changelog %changelog
* Wed Aug 19 2009 Tim Waugh <twaugh@redhat.com> 1.1.11-5
- Applied patch from 1.1.x (3f45e96):
- Show a 'paused' emblem for rejecting/disabled printers
(bug #518020).
- Set appropriate tooltip when configuring printer (bug #518007).
- Use separate thread for verifying IPP queue (part of bug #518065).
- Better driver preference order (bug #518045).
* Fri Aug 14 2009 Tim Waugh <twaugh@redhat.com> 1.1.11-4 * Fri Aug 14 2009 Tim Waugh <twaugh@redhat.com> 1.1.11-4
- Compare MFG and MDL fields case insensitively when adding automatic - Compare MFG and MDL fields case insensitively when adding automatic
queues, because HPLIP provides them with different case than the queues, because HPLIP provides them with different case than the