diff options
-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). |