Fixed driver selection when there are duplicate PPDs available. (#667571)

Grabbing focus for editing breaks it (bug #650995).
This commit is contained in:
Jiri Popelka 2011-01-21 13:10:20 +01:00
parent 84548f8e01
commit e1726083ab
3 changed files with 80 additions and 1 deletions

View File

@ -0,0 +1,56 @@
diff -up system-config-printer-1.2.96/newprinter.py.duplicate-PPDs system-config-printer-1.2.96/newprinter.py
--- system-config-printer-1.2.96/newprinter.py.duplicate-PPDs 2011-01-21 12:59:20.000000000 +0100
+++ system-config-printer-1.2.96/newprinter.py 2011-01-21 13:05:50.000000000 +0100
@@ -3024,8 +3024,10 @@ class NewPrinterGUI(GtkGUI):
self.NPDrivers = drivers
driverlist = []
- for i in range (len(self.NPDrivers)):
- ppd = self.ppds.getInfoFromPPDName (self.NPDrivers[i])
+ NPDrivers = []
+ i = 0
+ for ppdname in self.NPDrivers:
+ ppd = self.ppds.getInfoFromPPDName (ppdname)
driver = _singleton (ppd["ppd-make-and-model"])
driver = driver.replace(" (recommended)", "")
@@ -3035,18 +3037,20 @@ class NewPrinterGUI(GtkGUI):
except KeyError:
pass
- duplicate = False
- if driver in driverlist:
- duplicate = True
- else:
- driverlist.append (driver)
+ duplicate = driver in driverlist
- if not self.device and self.auto_driver == self.NPDrivers[i]:
+ if not self.device and self.auto_driver == ppdname:
+ driverlist.append (driver)
+ NPDrivers.append (ppdname)
+ i += 1
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 self.recommended_model_selected and i == 0:
+ elif self.device and i == 0:
+ driverlist.append (driver)
+ NPDrivers.append (ppdname)
+ i += 1
iter = model.append ((driver + _(" (recommended)"),))
path = model.get_path (iter)
self.tvNPDrivers.get_selection().select_path(path)
@@ -3054,7 +3058,11 @@ class NewPrinterGUI(GtkGUI):
else:
if duplicate:
continue
+ driverlist.append (driver)
+ NPDrivers.append (ppdname)
+ i += 1
model.append((driver, ))
+ self.NPDrivers = NPDrivers
self.tvNPDrivers.columns_autosize()
def on_NPDrivers_query_tooltip(self, tv, x, y, keyboard_mode, tooltip):

View File

@ -0,0 +1,11 @@
diff -up system-config-printer-1.2.96/system-config-printer.py.ungrab-focus system-config-printer-1.2.96/system-config-printer.py
--- system-config-printer-1.2.96/system-config-printer.py.ungrab-focus 2011-01-14 17:17:32.000000000 +0100
+++ system-config-printer-1.2.96/system-config-printer.py 2011-01-21 13:07:54.000000000 +0100
@@ -1404,7 +1404,6 @@ class GUI(GtkGUI):
self.rename_sigids = ids
self.rename_entry_sigid = None
self.dests_iconview.set_cursor (path, cell, start_editing=True)
- self.dests_iconview.grab_focus ()
def printer_name_edit_start (self, cell, editable, path):
debugprint ("editing-started")

View File

@ -5,12 +5,14 @@
Summary: A printer administration tool
Name: system-config-printer
Version: 1.2.96
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2+
URL: http://cyberelk.net/tim/software/system-config-printer/
Group: System Environment/Base
Source0: http://cyberelk.net/tim/data/system-config-printer/1.2/%{name}-%{version}.tar.xz
Patch1: system-config-printer-dnssd-URI.patch
Patch2: system-config-printer-duplicate-PPDs.patch
Patch3: system-config-printer-ungrab-focus.patch
BuildRequires: cups-devel >= 1.2
BuildRequires: desktop-file-utils >= 0.2.92
BuildRequires: gettext-devel
@ -70,6 +72,12 @@ printers.
# Allow %, ( and ) characters in dnssd URI (bug #669820).
%patch1 -p1 -b .dnssd-URI
# Fixed driver selection when there are duplicate PPDs available. (#667571)
%patch2 -p1 -b .duplicate-PPDs
# Grabbing focus for editing breaks it (bug #650995).
%patch3 -p1 -b .ungrab-focus
%build
%configure --with-udev-rules
@ -178,6 +186,10 @@ rm -rf %buildroot
exit 0
%changelog
* Fri Jan 21 2011 Jiri Popelka <jpopelka@redhat.com> 1.2.96-3
- Fixed driver selection when there are duplicate PPDs available. (#667571)
- Grabbing focus for editing breaks it (bug #650995).
* Tue Jan 18 2011 Jiri Popelka <jpopelka@redhat.com> 1.2.96-2
- Allow %, ( and ) characters in dnssd URI (bug #669820).