diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-02-25 09:43:46 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-02-25 09:43:46 +0000 |
commit | b54fb710f233d76f7fc3c05a5279b747fd2912aa (patch) | |
tree | d1f2985edaad6f6519a740f226e10f9fa2a19476 /perl-install/standalone/harddrake2 | |
parent | 6c1837a6cb4385ae75c67028e84ad8dcac2c2ad9 (diff) | |
download | drakx-backup-do-not-use-b54fb710f233d76f7fc3c05a5279b747fd2912aa.tar drakx-backup-do-not-use-b54fb710f233d76f7fc3c05a5279b747fd2912aa.tar.gz drakx-backup-do-not-use-b54fb710f233d76f7fc3c05a5279b747fd2912aa.tar.bz2 drakx-backup-do-not-use-b54fb710f233d76f7fc3c05a5279b747fd2912aa.tar.xz drakx-backup-do-not-use-b54fb710f233d76f7fc3c05a5279b747fd2912aa.zip |
hide module configuration button if needed (#16678)
Diffstat (limited to 'perl-install/standalone/harddrake2')
-rwxr-xr-x | perl-install/standalone/harddrake2 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2 index 1325d767d..6d4d2f738 100755 --- a/perl-install/standalone/harddrake2 +++ b/perl-install/standalone/harddrake2 @@ -14,6 +14,7 @@ BEGIN { unshift @::textdomains, 'drakconf' } use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version use ugtk2 qw(:create :helpers :wrappers); use interactive; +use modules::parameters; use harddrake::data; #- needs to stay after use-ugtk2 as long as this module defines globals containing some N() use fsedit; use pkgs; @@ -302,6 +303,7 @@ sub fill_default_text { $text->get_buffer->set_text(N("Click on a device in the left tree in order to display its information here.")); } +my %has_parameter; $tree->get_selection->signal_connect('changed' => sub { my ($select) = @_; my ($model, $iter) = $select->get_selected; @@ -352,6 +354,15 @@ $tree->get_selection->signal_connect('changed' => sub { $current_configurator = $configurators[$idx]; show_hide($current_configurator && -x first(split /\s+/, $current_configurator), $config_button); # strip arguments for -x test + + # hide module configuration button if needed: + my $driver = $current_device->{driver}; + if (!defined $has_parameter{$driver}) { + local $SIG{CHLD} = undef; + $has_parameter{$driver} ||= to_bool(scalar modules::parameters::parameters($driver)); + } + show_hide($has_parameter{$driver}, $module_cfg_button); + return 1; } } |