aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrpmdrake30
-rw-r--r--rpmdrake.pm6
-rw-r--r--rpmdrake.spec1
3 files changed, 23 insertions, 14 deletions
diff --git a/rpmdrake b/rpmdrake
index 2381e70f..3ebfbed0 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -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];
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 3c7c81e3..c4690632 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -30,14 +30,14 @@ use URPM;
use URPM::Resolve;
use packdrake;
use strict;
-use vars qw(@ISA @EXPORT $configfile %config $mandrakeupdate_wanted_categories $already_splashed $max_info_in_descr $typical_width);
+use vars qw(@ISA @EXPORT $configfile %config $mandrakeupdate_wanted_categories $already_splashed $max_info_in_descr $tree_mode $tree_flat $typical_width);
use log;
use c;
use curl_download;
@ISA = qw(Exporter);
-@EXPORT = qw($configfile %config $mandrakeupdate_wanted_categories $already_splashed $max_info_in_descr $typical_width
+@EXPORT = qw($configfile %config $mandrakeupdate_wanted_categories $already_splashed $max_info_in_descr $tree_mode $tree_flat $typical_width
N translate to_utf8 myexit readconf writeconf interactive_msg interactive_packtable interactive_list fatal_msg
wait_msg remove_wait_msg but but_ slow_func mirrors choose_mirror make_url_mirror show_urpm_progress
update_sources update_sources_interactive add_medium_and_check);
@@ -88,6 +88,8 @@ sub readconf {
%config = (mandrakeupdate_wanted_categories => { var => \$mandrakeupdate_wanted_categories, default => [ qw(security) ] },
already_splashed => { var => \$already_splashed, default => [] },
max_info_in_descr => { var => \$max_info_in_descr, default => [] },
+ tree_mode => { var => \$tree_mode, default => [ qw(mandrake_choices) ] },
+ tree_flat => { var => \$tree_flat, default => [ 0 ] },
);
${$config{$_}{var}} = $config{$_}{default} foreach keys %config;
diff --git a/rpmdrake.spec b/rpmdrake.spec
index fa65b75c..b2fd1af1 100644
--- a/rpmdrake.spec
+++ b/rpmdrake.spec
@@ -103,6 +103,7 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Mon Jan 12 2004 Guillaume Cottenceau <gc@mandrakesoft.com> 2.1.1-1mdk
- add ability to cancel packages downloads (#6317)
+- save sorting method at exit of rpmdrake for Lord Titi (#6051)
- together with changes in 2.1-36mdk deserve a subsubversion change
- remove unecessary provides perl(rpmdrake)