diff options
Diffstat (limited to 'rpmdrake')
-rwxr-xr-x | rpmdrake | 30 |
1 files changed, 18 insertions, 12 deletions
@@ -698,20 +698,24 @@ or you already installed all of them.")); $compssUsers = parse_compssUsers_flat(); my @radios_names_ordered = qw(mandrake_choices flat by); $compssUsers or shift @radios_names_ordered; - @modes_buttons = gtkradio($radios_infos{mandrake_choices}{name}, map { $radios_infos{$_}{name} } @radios_names_ordered); + @modes_buttons = gtkradio($radios_infos{by}{name}, map { $radios_infos{$_}{name} } @radios_names_ordered); mapn { my $capture_mode = $_[0]; + $_[0] eq $tree_mode->[0] and $_[1]->set_active(1); $_[1]->signal_connect(clicked => sub { if ($_[0]->get_active) { ($options->{tree_mode}, $options->{state}{flat}) = $capture_mode eq 'by' ? ($options->{tree_submode}, $options->{tree_subflat}) : ($capture_mode, $radios_infos{$capture_mode}{flat}); + $tree_mode->[0] = $options->{tree_mode}; + $tree_flat->[0] = $options->{state}{flat}; $options->{rebuild_tree}->(); } }); } \@radios_names_ordered, \@modes_buttons; - $options->{tree_mode} = $radios_names_ordered[0]; + $options->{tree_mode} = $tree_mode->[0]; + $options->{state}{flat} = $tree_flat->[0]; my $advanced_menu = Gtk2::Menu->new; my $radio_by; @@ -719,16 +723,18 @@ or you already installed all of them.")); [ 'by_selection', N("All packages, by selection state"), 1 ]); $MODE eq 'install' and push @advanced_modes, ([ 'by_source', N("All packages, by medium repository"), 0 ], [ 'by_presence', N("All packages, by update availability"), 0 ]); $MODE eq 'remove' and push @advanced_modes, [ 'by_leaves', N("Leaves only, sorted by install date"), 1 ]; - foreach (@advanced_modes) { + each_index { my ($capt_mode, $capt_flat) = ($_->[0], $_->[2]); - $advanced_menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label($_->[1])), - activate => sub { - $options->{tree_submode} = $capt_mode; - $options->{tree_subflat} = $capt_flat; - $radio_by->activate; - })); - } - $options->{tree_submode} = $advanced_modes[0][0]; + my $item = Gtk2::MenuItem->new_with_label($_->[1]); + $advanced_menu->append(gtkshow($item)); + $_->[0] eq $tree_mode->[0] and do { $options->{tree_submode} = $_->[0]; $advanced_menu->set_active($::i) }; + $item->signal_connect(activate => sub { + $options->{tree_submode} = $capt_mode; + $options->{tree_subflat} = $capt_flat; + $radio_by->activate; + }); + } @advanced_modes; + $options->{tree_submode} ||= $advanced_modes[0][0]; each_index { if ($_ eq 'by') { $radio_by = $modes_buttons[$::i]; @@ -737,7 +743,7 @@ or you already installed all of them.")); } } @radios_names_ordered; } - + my $search_types_menu = Gtk2::Menu->new; my @search_types = ([ 'normal', N("in names") ], [ 'descriptions', N("in descriptions") ], [ 'files', N("in file names") ]); my $current_search_type = $search_types[0][0]; |