summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-19 16:19:02 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-19 16:19:02 +0000
commitf96d792152374127966036a2b97ad24377c34c15 (patch)
tree8887342ed9dfca00553c54a608d89987cd535663 /perl-install
parentf230905d265dd26e0e50b42e95220602633da716 (diff)
downloaddrakx-backup-do-not-use-f96d792152374127966036a2b97ad24377c34c15.tar
drakx-backup-do-not-use-f96d792152374127966036a2b97ad24377c34c15.tar.gz
drakx-backup-do-not-use-f96d792152374127966036a2b97ad24377c34c15.tar.bz2
drakx-backup-do-not-use-f96d792152374127966036a2b97ad24377c34c15.tar.xz
drakx-backup-do-not-use-f96d792152374127966036a2b97ad24377c34c15.zip
partly cleanup monitor re-configuration (work in progress)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Xconfigurator.pm31
1 files changed, 16 insertions, 15 deletions
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index 613357a78..c578caa18 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -461,9 +461,8 @@ sub optionsConfiguration($) {
$in->ask_from('', _("Choose options for server"), \@l);
}
-sub monitorConfiguration(;$$) {
- my $monitor = shift || {};
- my $useFB = shift || 0;
+sub monitorConfiguration {
+ my ($monitor, $noauto) = @_;
my $monitors = readMonitorsDB("$ENV{SHARE_PATH}/ldetect-lst/MonitorsDB");
@@ -474,16 +473,17 @@ sub monitorConfiguration(;$$) {
log::l("EISA_ID corresponds to: $monitor->{ModelName}");
}
}
- if ($monitor->{hsyncrange} && $monitor->{vsyncrange}) {
+ if ($monitor->{hsyncrange} && $monitor->{vsyncrange} && !$noauto) {
return $monitor;
}
-
- my $good_default = (arch() =~ /ppc/ ? 'Apple|' : 'Generic|') . translate($Xconfigurator_consts::good_default_monitor);
- $monitor->{type} ||=
- ($::auto_install ? $Xconfigurator_consts::low_default_monitor :
- $in->ask_from_treelist(_("Monitor"), _("Choose a monitor"), '|', ['Custom', keys %$monitors], $good_default));
- if ($monitor->{type} eq 'Custom') {
- $in->ask_from('',
+ if (!$monitor->{ModelName} || $noauto) {
+ my $m =
+ ($::auto_install ? $Xconfigurator_consts::low_default_monitor :
+ $in->ask_from_treelist(_("Monitor"), _("Choose a monitor"), '|', ['Custom', keys %$monitors], $Xconfigurator_consts::good_default_monitor));
+ if ($m ne 'Custom') {
+ put_in_hash($monitor, $monitors->{$m});
+ } else {
+ $in->ask_from('',
_("The two critical parameters are the vertical refresh rate, which is the rate
at which the whole screen is refreshed, and most importantly the horizontal
sync rate, which is the rate at which scanlines are displayed.
@@ -493,10 +493,11 @@ that is beyond the capabilities of your monitor: you may damage your monitor.
If in doubt, choose a conservative setting."),
[ { val => \$monitor->{hsyncrange}, list => \@Xconfigurator_consts::hsyncranges, label => _("Horizontal refresh rate"), not_edit => 0 },
{ val => \$monitor->{vsyncrange}, list => \@Xconfigurator_consts::vsyncranges, label => _("Vertical refresh rate"), not_edit => 0 } ]);
+ }
} else {
- add2hash($monitor, $monitors->{$monitor->{type}});
+ my $m = join('|', if_($monitor->{VendorName}, $monitor->{VendorName}), $monitor->{ModelName});
+ put_in_hash($monitor, $monitors->{$m});
}
- add2hash($monitor, { manual => 1 });
}
sub finalize_config {
@@ -1325,7 +1326,7 @@ sub main {
$X->{card} = cardConfiguration($X->{card}, $::noauto, $cardOptions);
- $X->{monitor} = monitorConfiguration($X->{monitor}, $X->{card}{server} eq 'FBDev');
+ monitorConfiguration($X->{monitor} ||= {}, 1);
}
my $ok = resolutionsConfiguration($X, $::auto);
@@ -1346,7 +1347,7 @@ sub main {
}, [
{ format => sub { $_[0][0] }, val => \$f,
list => [
- [ _("Change Monitor") => sub { $X->{monitor} = monitorConfiguration() } ],
+ [ _("Change Monitor") => sub { monitorConfiguration($X->{monitor}, 'noauto') } ],
[ _("Change Graphics card") => sub { my $card = cardConfiguration('', 'noauto', $cardOptions);
$card and $X->{card} = $card } ],
if_($::expert,