From a265f4513d1b1ae8da12ea8d6c63f2bb92ffc994 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Thu, 10 Feb 2005 03:53:38 +0000 Subject: - Added help text for printers used with HPLIP. - Let "ask_warn()" messages not embed in the wizard, this breaks the "Cancel" button (help texts when MF device queue is added). --- perl-install/printer/main.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'perl-install/printer/main.pm') diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm index 8f8a4671c..405c2f353 100644 --- a/perl-install/printer/main.pm +++ b/perl-install/printer/main.pm @@ -2458,6 +2458,27 @@ sub hplip_device_entry { return undef; } +sub hplip_device_entry_from_uri { + my ($deviceuri) = @_; + + return undef if $deviceuri !~ m!^hp:/!; + + if (!$hplipdevicesdb) { + # Read the HPLIP device database if not done already + $hplipdevicesdb = read_hplip_db(); + } + + $deviceuri =~ m!^hp:/(usb|par|net)/(\S+?)(\?\S+|)$!; + my $model = $2; + return undef if !$model; + + my $entry; + if ($entry = $hplipdevicesdb->{$model}) { + return $entry; + } + return undef; +} + sub start_hplip { my ($device, $hplipentry, @autodetected) = @_; -- cgit v1.2.1