summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig/various.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-28 22:02:39 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-28 22:02:39 +0000
commitee295df5670f73b285e3de0cea0fdae7d92941bd (patch)
tree1dbff785561e08dd894473b3c3b223fb1b68e081 /perl-install/Xconfig/various.pm
parent70fd8ae05409bb33818da725015daf181c6e6a83 (diff)
downloaddrakx-ee295df5670f73b285e3de0cea0fdae7d92941bd.tar
drakx-ee295df5670f73b285e3de0cea0fdae7d92941bd.tar.gz
drakx-ee295df5670f73b285e3de0cea0fdae7d92941bd.tar.bz2
drakx-ee295df5670f73b285e3de0cea0fdae7d92941bd.tar.xz
drakx-ee295df5670f73b285e3de0cea0fdae7d92941bd.zip
14 new modules, will it be enough?? :)
Diffstat (limited to 'perl-install/Xconfig/various.pm')
-rw-r--r--perl-install/Xconfig/various.pm58
1 files changed, 58 insertions, 0 deletions
diff --git a/perl-install/Xconfig/various.pm b/perl-install/Xconfig/various.pm
new file mode 100644
index 000000000..1c2d1ae73
--- /dev/null
+++ b/perl-install/Xconfig/various.pm
@@ -0,0 +1,58 @@
+package Xconfig::various; # $Id$
+
+use diagnostics;
+use strict;
+
+use Xconfig::card;
+use common;
+use any;
+
+
+sub show_info {
+ my ($in, $X) = @_;
+ $in->ask_warn('', info($X));
+}
+
+sub info {
+ my ($raw_X, $card) = @_;
+ my $info;
+ my $xf_ver = Xconfig::card::using_xf4($card) ? "4.2.0" : "3.3.6";
+ my $title = $card->{use_DRI_GLX} || $card->{use_UTAH_GLX} ?
+ _("XFree %s with 3D hardware acceleration", $xf_ver) : _("XFree %s", $xf_ver);
+ my $keyboard = eval { $raw_X->get_keyboard } || {};
+ my $monitor = eval { $raw_X->get_monitor } || {};
+ my $device = eval { $raw_X->get_device } || {};
+ my $mouse = eval { first($raw_X->get_mice) } || {};
+
+ $info .= _("Keyboard layout: %s\n", $keyboard->{XkbLayout});
+ $info .= _("Mouse type: %s\n", $mouse->{Protocol});
+ $info .= _("Mouse device: %s\n", $mouse->{Device}) if $::expert;
+ $info .= _("Monitor: %s\n", $monitor->{ModelName});
+ $info .= _("Monitor HorizSync: %s\n", $monitor->{HorizSync}) if $::expert;
+ $info .= _("Monitor VertRefresh: %s\n", $monitor->{VertRefresh}) if $::expert;
+ $info .= _("Graphics card: %s\n", $device->{VendorName} . ' '. $device->{BoardName});
+ $info .= _("Graphics memory: %s kB\n", $device->{VideoRam}) if $device->{VideoRam};
+ if (my $resolution = eval { $raw_X->get_resolution }) {
+ $info .= _("Color depth: %s\n", translate($Xconfig::xfreeX::depths{$resolution->{Depth}}));
+ $info .= _("Resolution: %s\n", join('x', @$resolution{'X', 'Y'}));
+ }
+ $info .= _("XFree86 server: %s\n", $card->{server}) if $card->{server};
+ $info .= _("XFree86 driver: %s\n", $device->{Driver}) if $device->{Driver};
+ "$title\n\n$info";
+}
+
+sub choose_xdm {
+ my ($in, $auto) = @_;
+ my $xdm = $::isStandalone ? any::runlevel($::prefix) : 1;
+
+ if (!$auto || $::isStandalone) {
+ $in->set_help('configureXxdm') if !$::isStandalone;
+
+ $xdm = $in->ask_yesorno(_("Graphical interface at startup"),
+_("I can setup your computer to automatically start the graphical interface (XFree) upon booting.
+Would you like XFree to start when you reboot?"), $xdm) or return
+ }
+ any::runlevel($::prefix, $xdm ? 5 : 3);
+}
+
+1;