Subject: | Bug in Gtk2::Ex::PrintDialog-0.03 for Linux |
Date: | Sun, 2 Dec 2007 12:00:40 +0100 |
To: | bug-Gtk2-Ex-PrintDialog [...] rt.cpan.org |
From: | "Jeffrey Ratcliffe" <jeffrey.ratcliffe [...] gmail.com> |
Whilst packaging Gtk2::Ex::PrintDialog 0.03 for Debian, I found 2 issues:
1. it seems that use Net::CUPS::Destination is not being called, and
therefore those methods are not available.
2. the Net::CUPS::Destination objects, rather than their associated
printer names are being passed to the ComboBox.
I am running v5.8.8 built for i486-linux-gnu-thread-multi under Ubuntu Gutsy:
Linux desktop1-ubuntu 2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT
2007 i686 GNU/Linux
Below is a patch which fixes both problems for Linux.
Regards
Jeff Ratcliffe
Index: lib/Gtk2/Ex/PrintDialog.pm
===================================================================
--- lib/Gtk2/Ex/PrintDialog.pm (revision 9967)
+++ lib/Gtk2/Ex/PrintDialog.pm (working copy)
@@ -69,9 +69,11 @@
$self->{opt_print_command}->set_active(1);
} else {
- map { $self->{opt_printer_combo}->append_text($_) } @printers;
+ my @names;
+ use Net::CUPS::Destination;
+ for (@printers) {push @names, $_->getName}
+ map { $self->{opt_printer_combo}->append_text($_) } @names;
$self->{opt_printer_combo}->set_active(0);
-
}