summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--lib/Xconfig/monitor.pm9
2 files changed, 10 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 1153797..f4ab10c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,7 @@
- fix default_headers when XFS is installed
+- keep the order from MonitorsDB file
+ (allows "Flat Panel 800x600" to be before "Flat Panel 1024x768")
+ (needs a nicely sorted MonitorsDB though)
Version 0.23 - 6 September 2007, by Pascal "Pixel" Rigaux
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" :