summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/main.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2005-02-10 03:53:38 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2005-02-10 03:53:38 +0000
commita265f4513d1b1ae8da12ea8d6c63f2bb92ffc994 (patch)
tree136de6d5d5e30e245defcdf1dda67853ff0d43bb /perl-install/printer/main.pm
parentfb5d8ebc42b9de72e529c27a70f4c466cccfbb1b (diff)
downloaddrakx-backup-do-not-use-a265f4513d1b1ae8da12ea8d6c63f2bb92ffc994.tar
drakx-backup-do-not-use-a265f4513d1b1ae8da12ea8d6c63f2bb92ffc994.tar.gz
drakx-backup-do-not-use-a265f4513d1b1ae8da12ea8d6c63f2bb92ffc994.tar.bz2
drakx-backup-do-not-use-a265f4513d1b1ae8da12ea8d6c63f2bb92ffc994.tar.xz
drakx-backup-do-not-use-a265f4513d1b1ae8da12ea8d6c63f2bb92ffc994.zip
- 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).
Diffstat (limited to 'perl-install/printer/main.pm')
-rw-r--r--perl-install/printer/main.pm21
1 files changed, 21 insertions, 0 deletions
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) = @_;