From f6811b4ae1d4159b3d53b185539ab7dffc9014f5 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 6 Sep 2007 07:21:37 +0000 Subject: - keep the order from MonitorsDB file (allows "Flat Panel 800x600" to be before "Flat Panel 1024x768") (needs a nicely sorted MonitorsDB though) --- lib/Xconfig/monitor.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/Xconfig') diff --git a/lib/Xconfig/monitor.pm b/lib/Xconfig/monitor.pm index 365e2da..b5a05c3 100644 --- a/lib/Xconfig/monitor.pm +++ b/lib/Xconfig/monitor.pm @@ -89,7 +89,12 @@ sub choose { return $ok; } - my %h_monitors = map { ("$_->{VendorName}|$_->{ModelName}" => $_) } monitors_db(); + my (@l_monitors, %h_monitors); + foreach (monitors_db()) { + my $s = "$_->{VendorName}|$_->{ModelName}"; + push @l_monitors, $s; + $h_monitors{$s} = $_; + } ask_monitor: my $merged_name = do { @@ -111,7 +116,7 @@ sub choose { interactive_help_id => 'configureX_monitor' }, [ { val => \$merged_name, separator => '|', - list => ['Custom', "Plug'n Play", sort keys %h_monitors], + list => ['Custom', "Plug'n Play", @l_monitors], format => sub { $_[0] eq 'Custom' ? N("Custom") : $_[0] eq "Plug'n Play" ? N("Plug'n Play") . ($monitor->{VendorName} eq "Plug'n Play" ? " ($monitor->{ModelName})" : '') : $_[0] =~ /^Generic\|(.*)/ ? N("Generic") . "|$1" : -- cgit v1.2.1