- Fail gracefully if the new printer has disappeared before the user has

responded to the test page prompt (bug #533109).
This commit is contained in:
Tim Waugh 2009-11-05 10:45:06 +00:00
parent ab95adce56
commit 0a6839c0ce
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,27 @@
diff -up system-config-printer-1.1.13/system-config-printer.py.test-page-traceback system-config-printer-1.1.13/system-config-printer.py
--- system-config-printer-1.1.13/system-config-printer.py.test-page-traceback 2009-11-05 10:24:09.782129808 +0000
+++ system-config-printer-1.1.13/system-config-printer.py 2009-11-05 10:24:22.512254783 +0000
@@ -6837,12 +6837,19 @@ class NewPrinterGUI(GtkGUI):
response = q.run ()
q.destroy ()
if response == gtk.RESPONSE_YES:
- # Load the printer details but hide the properties dialog.
- self.mainapp.display_properties_dialog_for (name)
self.mainapp.PrinterPropertiesDialog.hide ()
- # Click the test button.
- self.mainapp.btnPrintTestPage.clicked ()
+ properties_shown = False
+ try:
+ # Load the printer details but hide the properties dialog.
+ self.mainapp.display_properties_dialog_for (name)
+ properties_shown = True
+ except RuntimeError:
+ pass
+
+ if properties_shown:
+ # Click the test button.
+ self.mainapp.btnPrintTestPage.clicked ()
def checkDriverExists(self, name, ppd=None):
"""Check that the driver for an existing queue actually

View File

@ -7,7 +7,7 @@
Summary: A printer administration tool
Name: system-config-printer
Version: 1.1.13
Release: 7%{?dist}
Release: 8%{?dist}
License: GPLv2+
URL: http://cyberelk.net/tim/software/system-config-printer/
Group: System Environment/Base
@ -34,6 +34,7 @@ Patch16: system-config-printer-custom-state-reasons.patch
Patch17: system-config-printer-no-epydoc.patch
Patch18: system-config-printer-notification-traceback.patch
Patch19: system-config-printer-de.po-typo.patch
Patch20: system-config-printer-test-page-traceback.patch
BuildRequires: cups-devel >= 1.2
BuildRequires: python-devel >= 2.4
@ -112,6 +113,7 @@ printers.
%patch17 -p1 -b .no-epydoc
%patch18 -p1 -b .notification-traceback
%patch19 -p1 -b .de.po-typo
%patch20 -p1 -b .test-page-traceback
%build
%configure --with-udev-rules --with-polkit-1
@ -223,6 +225,10 @@ rm -rf %buildroot
exit 0
%changelog
* Thu Nov 5 2009 Tim Waugh <twaugh@redhat.com> 1.1.13-8
- Fail gracefully if the new printer has disappeared before the user
has responded to the test page prompt (bug #533109).
* Mon Nov 2 2009 Tim Waugh <twaugh@redhat.com> 1.1.13-7
- Fixed typo in de.po (bug #532371).