From 543837c945ad7ded0062e32653b895a968c9258e Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Wed, 1 Jul 2009 15:56:07 +0000 Subject: move serial_ports to detect_devices.pm --- lib/mouse.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/mouse.pm b/lib/mouse.pm index 9c5d50d..8139618 100644 --- a/lib/mouse.pm +++ b/lib/mouse.pm @@ -209,11 +209,6 @@ sub fullname2mouse { die "$fname not found ($type, $name)"; } -sub serial_ports() { map { "ttyS$_" } 0..7 } -sub serial_port2text { - $_[0] =~ /ttyS(\d+)/ ? "$_[0] / COM" . ($1 + 1) : $_[0]; -} - sub read() { my %mouse = getVarsFromSh "$::prefix/etc/sysconfig/mouse"; eval { fullname2mouse($mouse{FULLNAME}, device => $mouse{device}) } || \%mouse; @@ -553,7 +548,7 @@ sub select { $in->ask_from_({ title => N("Mouse Port"), messages => N("Please choose which serial port your mouse is connected to."), interactive_help_id => 'selectSerialPort', - }, [ { list => [ serial_ports() ], format => \&serial_port2text, val => \$mouse->{device} } ]) or return &select; + }, [ { list => [ detect_devices::serialPorts() ], format => \&detect_devices::serialPort2text, val => \$mouse->{device} } ]) or return &select; } if (arch() =~ /ppc/ && $mouse->{nbuttons} == 1) { -- cgit v1.2.1