From 0a6839c0cec48a2b037cecd6bf70619a7cfd7f8b Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 5 Nov 2009 10:45:06 +0000 Subject: [PATCH] - Fail gracefully if the new printer has disappeared before the user has responded to the test page prompt (bug #533109). --- ...m-config-printer-test-page-traceback.patch | 27 +++++++++++++++++++ system-config-printer.spec | 8 +++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 system-config-printer-test-page-traceback.patch diff --git a/system-config-printer-test-page-traceback.patch b/system-config-printer-test-page-traceback.patch new file mode 100644 index 0000000..657810d --- /dev/null +++ b/system-config-printer-test-page-traceback.patch @@ -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 diff --git a/system-config-printer.spec b/system-config-printer.spec index cd3a3b0..dc67b03 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -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 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 1.1.13-7 - Fixed typo in de.po (bug #532371).