summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-11-19 15:12:58 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-11-19 15:12:58 +0000
commit63f4f397d563d61ab8d876e8c8c3755e4d308d41 (patch)
tree3581f975a292a8536db3a2f87f82dcc87c05b327 /perl-install
parent719ab5b9b546c90f0c592cac0bac79473253f2e2 (diff)
downloaddrakx-63f4f397d563d61ab8d876e8c8c3755e4d308d41.tar
drakx-63f4f397d563d61ab8d876e8c8c3755e4d308d41.tar.gz
drakx-63f4f397d563d61ab8d876e8c8c3755e4d308d41.tar.bz2
drakx-63f4f397d563d61ab8d876e8c8c3755e4d308d41.tar.xz
drakx-63f4f397d563d61ab8d876e8c8c3755e4d308d41.zip
- add option menu check boxes to prevent (slowly) detecting
printers and modems - remove warnings on usb devices
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/harddrake/ui.pm24
1 files changed, 15 insertions, 9 deletions
diff --git a/perl-install/harddrake/ui.pm b/perl-install/harddrake/ui.pm
index b0047c915..a468fc1ee 100644
--- a/perl-install/harddrake/ui.pm
+++ b/perl-install/harddrake/ui.pm
@@ -68,7 +68,7 @@ my %fields =
my ($in, %IDs, $pid, $w);
-my %options;
+my (%options, %check_boxes);
my $conffile = "/etc/sysconfig/harddrake2/ui.conf";
my ($modem_check_box, $printer_check_box, $current_device);
@@ -77,10 +77,10 @@ my @menu_items =
(
{ path => N("/_File"), type => '<Branch>' },
{ path => N("/_File").N("/_Quit"), accelerator => N("<control>Q"), callback => \&quit_global },
-# { path => N("/_Options").N("/Autodetect _printers"), type => '<CheckItem>',
-# callback => sub { $options{PRINTERS_DETECTION} ^= 1 } },
-# { path => N("/_Options").N("/Autodetect _modems"), type => '<CheckItem>',
-# callback => sub { $options{MODEMS_DETECTION} ^= 1 } },
+ { path => N("/_Options").N("/Autodetect _printers"), type => '<CheckItem>',
+ callback => sub { $options{PRINTERS_DETECTION} = $check_boxes{PRINTERS_DETECTION}->active } },
+ { path => N("/_Options").N("/Autodetect _modems"), type => '<CheckItem>',
+ callback => sub { $options{MODEMS_DETECTION} = $check_boxes{MODEMS_DETECTION}->active } },
{ path => N("/_Help"), type => '<Branch>' },
{
path => N("/_Help").N("/_Help..."),
@@ -139,7 +139,7 @@ sub detect {
if (exists $_->{bus} && $_->{bus} eq 'ide') {
$_->{channel} = $_->{channel} ? N("secondary") : N("primary");
delete $_->{info};
- } elsif ((exists $_->{id}) && $_->{bus} ne 'PCI') {
+ } elsif ((exists $_->{id}) && $_->{bus} !~ /USB|PCI/) {
# SCSI detection incoherency:
my $i = $_;
$_->{bus_location} = join ':', map { sprintf("%lx", $i->{$_}) } qw(bus id);
@@ -173,8 +173,6 @@ sub new {
add_icon_path('/usr/share/pixmaps/harddrake2/');
$w = my_gtk->new(N("Harddrake2 version ") . $harddrake::data::version);
$w->{window}->set_usize(760, 550) unless $::isEmbedded;
- $options{MODEMS_DETECTION} = 1 unless defined $options{MODEMS_DETECTION};
- $options{PRINTERS_DETECTION} = 1 unless defined $options{PRINTERS_DETECTION};
$w->{window}->add(my $main_vbox = gtkadd(gtkadd($::isEmbedded ? new Gtk::VBox(0, 0) :
gtkadd(new Gtk::VBox(0, 0),
@@ -271,6 +269,14 @@ sub new {
gtkset_mousecursor_normal();
$w->{rwindow}->set_position('center') unless $::isEmbedded;
$w->{rwindow}->show_all();
+
+ foreach (['PRINTERS_DETECTION', N("/Autodetect printers")], ['MODEMS_DETECTION', N("/Autodetect modems")]) {
+ $check_boxes{$_->[0]} = $menubar->{factory}->get_widget("<main>".N("/Options").$_->[1]);
+ print "$_->[0] : value=$options{$_->[0]}, defined=" , defined($options{$_->[0]}), "\n";
+ $options{$_->[0]} = 0 unless defined($options{$_->[0]});
+ $check_boxes{$_->[0]}->set_active($options{$_->[0]});
+ }
+
foreach ($module_cfg_button, $config_button) { $_->hide };
$in = 'interactive'->vnew('su', 'default') if $::isEmbedded;
$w->main;
@@ -284,7 +290,7 @@ sub quit_global {
$in->exit;
}
-# remove a signal handler from a button & hide it if needed
+# remove a signal handler from a button & hide it if needed
sub disconnect {
my ($button, $id) = @_;
if ($IDs{$id}) {