summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-01-28 11:37:27 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-01-28 11:37:27 +0000
commit6a845868e1d54b46df737953dce31a8bad355c9e (patch)
treede56644174221ad7099155ffe037c02aaca7f227 /perl-install
parente56387cd4d995657f4200fb06a5cf798e23d9ec4 (diff)
downloaddrakx-backup-do-not-use-6a845868e1d54b46df737953dce31a8bad355c9e.tar
drakx-backup-do-not-use-6a845868e1d54b46df737953dce31a8bad355c9e.tar.gz
drakx-backup-do-not-use-6a845868e1d54b46df737953dce31a8bad355c9e.tar.bz2
drakx-backup-do-not-use-6a845868e1d54b46df737953dce31a8bad355c9e.tar.xz
drakx-backup-do-not-use-6a845868e1d54b46df737953dce31a8bad355c9e.zip
create add_modify_remove_sensitive() and use it so that "Modify" and "Remove"
are non sensitive when the initial list is empty
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/interactive/gtk.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm
index 9476d78de..4e3d2666c 100644
--- a/perl-install/interactive/gtk.pm
+++ b/perl-install/interactive/gtk.pm
@@ -356,9 +356,15 @@ sub add_modify_remove_action {
${$e->{val}} = $e->{list}[0];
}
ugtk2::gtk_set_treelist($treelist, [ map { may_apply($e->{format}, $_) } @{$e->{list}} ]);
+
+ add_modify_remove_sensitive($buttons, $e);
+ 1;
+}
+
+sub add_modify_remove_sensitive {
+ my ($buttons, $e) = @_;
$_->{button}->set_sensitive(@{$e->{list}} != ()) foreach
grep { member($_->{kind}, 'modify', 'remove') } @$buttons;
- 1;
}
sub ask_fromW {
@@ -482,6 +488,8 @@ sub ask_fromW {
foreach my $button (@buttons) {
$button->{button}->signal_connect(clicked => sub { $do_action->($button) });
}
+ add_modify_remove_sensitive(\@buttons, $e);
+
$real_w = gtkpack_(Gtk2::HBox->new(0,0),
1, create_scrolled_window($w),
0, gtkpack__(Gtk2::VBox->new(0,0), map { $_->{button} } @buttons));