diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-08-14 21:51:08 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-08-14 21:51:08 +0000 |
commit | a93e62d784e881146d533f917309416796766e19 (patch) | |
tree | 2e5a23492836aa50a18f3520d3be17c1aab45ab2 | |
parent | 63dc2a3ea6baf4173f31bd9df3fc1b28b1c561eb (diff) | |
download | drakx-backup-do-not-use-a93e62d784e881146d533f917309416796766e19.tar drakx-backup-do-not-use-a93e62d784e881146d533f917309416796766e19.tar.gz drakx-backup-do-not-use-a93e62d784e881146d533f917309416796766e19.tar.bz2 drakx-backup-do-not-use-a93e62d784e881146d533f917309416796766e19.tar.xz drakx-backup-do-not-use-a93e62d784e881146d533f917309416796766e19.zip |
- small fixes (esp. gtk sensitive handling)
- add ask_file
- add "gtk" preference field
-rw-r--r-- | perl-install/interactive.pm | 12 | ||||
-rw-r--r-- | perl-install/interactive_gtk.pm | 10 |
2 files changed, 19 insertions, 3 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index 346026645..0f2541943 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -16,6 +16,7 @@ use common; #- help => tooltip #- advanced => wether it is shown in by default or only in advanced mode #- disabled => function returning wether it should be disabled (grayed) +#- gtk => gtk preferences #- type => #- button => (with clicked) (type defaults to button if clicked is there) (val need not be a reference) #- label => (val need not be a reference) (type defaults to label if val is not a reference) @@ -120,6 +121,15 @@ sub ask_okcancel { } } +sub ask_file { + my ($o, $title, $dir) = @_; + $o->ask_fileW($title, $dir); +} +sub ask_fileW { + my ($o, $title, $dir) = @_; + $o->ask_from_entry($title, _("Choose a file")); +} + sub ask_from_list { my ($o, $title, $message, $l, $def, $help) = @_; ask_from_listf($o, $title, $message, undef, $l, $def, $help); @@ -317,7 +327,7 @@ sub ask_browse_tree_info_refW { #- default definition, do not use with too many }, 'flat'); add2hash_($common, { list => $l, #- TODO interactivity of toggle is missing values => $v, - help => sub { $common->{get_info}($_) }, + help => sub { $common->{get_info}($_[0]) }, }); my ($new_v) = $o->ask_many_from_list($common->{title}, $common->{message}, $common) or return; $common->{toggle_nodes}(sub {}, grep { ! delete $h->{$_} } @$new_v); diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm index c094730fd..0e4ec437d 100644 --- a/perl-install/interactive_gtk.pm +++ b/perl-install/interactive_gtk.pm @@ -30,6 +30,12 @@ sub ask_warn { &interactive::ask_warn; } +sub ask_fileW { + my ($o, $title, $dir) = @_; + $o->_ask_file($title, $dir); + $o->main; +} + sub create_boxradio { my ($e, $may_go_to_next, $changed, $double_click) = @_; my @l = map { may_apply($e->{format}, $_) } @{$e->{list}}; @@ -319,7 +325,7 @@ sub ask_from_entries_refW { my $set_all = sub { $ignore = 1; $_->{set}->(${$_->{e}{val}}) foreach @widgets_always, @widgets_advanced; - $_->{w}->set_sensitive(!$_->{e}{disabled}()) foreach @widgets_always, @widgets_advanced; + $_->{real_w}->set_sensitive(!$_->{e}{disabled}()) foreach @widgets_always, @widgets_advanced; $ignore = 0; }; my $get_all = sub { @@ -399,7 +405,7 @@ sub ask_from_entries_refW { sub { if ($_[1]{type} =~ /^2/) { $mainw->{retval} = 1; Gtk->main_quit } } : ''; my @para = ($e, $may_go_to_next, $changed, $quit_if_double_click); - my $use_boxradio = @{$e->{list}} <= 8; + my $use_boxradio = exists $e->{gtk}{use_boxradio} ? $e->{gtk}{use_boxradio} : @{$e->{list}} <= 8; if ($e->{help}) { #- used only when needed, as key bindings are dropped by List (CList does not seems to accepts Tooltips). |