Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreia Gaita <avidigal@novell.com>2007-02-22 03:24:29 +0300
committerAndreia Gaita <avidigal@novell.com>2007-02-22 03:24:29 +0300
commit20bb09af74584254db0f2595a808957937a93809 (patch)
treecf8c35ed94a04154921bec0e3da55522c83f4fc9 /mcs/class/System.Drawing/System.Drawing.Printing
parent3a1156eaa57253d762a604d5cd97efb89003c355 (diff)
2007-02-21 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix.cs: Report an error in the console if there is a problem opening the printer. svn path=/trunk/mcs/; revision=73289
Diffstat (limited to 'mcs/class/System.Drawing/System.Drawing.Printing')
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog5
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs10
2 files changed, 13 insertions, 2 deletions
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog b/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog
index a140705ee5b..7802dfffdca 100644
--- a/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog
+++ b/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog
@@ -1,4 +1,9 @@
2007-02-21 Andreia Gaita <avidigal@novell.com>
+
+ * PrintingServicesUnix.cs: Report an error in the console if there is
+ a problem opening the printer.
+
+2007-02-21 Andreia Gaita <avidigal@novell.com>
* PrintingServicesUnix.cs: don't free up pointers unnecessarily (doh)
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs
index 9cc0640f5d2..57cf437bf86 100644
--- a/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs
+++ b/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs
@@ -118,7 +118,11 @@ namespace System.Drawing.Printing
IntPtr ppd_handle = ppdOpenFile (ppd_filename);
return ppd_handle;
}
- catch {
+ catch (Exception ex) {
+ Console.WriteLine ("There was an error opening the printer {0}. Please check your cups installation.");
+#if DEBUG
+ Console.WriteLine (ex.Message);
+#endif
}
return IntPtr.Zero;
}
@@ -236,7 +240,9 @@ namespace System.Drawing.Printing
return;
}
- ppd_handle = OpenPrinter (printer);
+ ppd_handle = OpenPrinter (printer);
+ if (ppd_handle == IntPtr.Zero)
+ return;
printer_dest = (CUPS_DESTS) Marshal.PtrToStructure (ptr, typeof (CUPS_DESTS));
options = new NameValueCollection();