aboutsummaryrefslogtreecommitdiffstats
path: root/MandrivaUpdate
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-08-25 13:41:56 +0000
committerThierry Vignaud <tv@mandriva.org>2008-08-25 13:41:56 +0000
commit7e7a62d588fe132695225a1f65e9104a5c4fb320 (patch)
tree640b1143025309aeaa2860669879fe6f2d4096f0 /MandrivaUpdate
parentc271fb2afe02cedfe41e8549a761107f2a673452 (diff)
downloadrpmdrake-7e7a62d588fe132695225a1f65e9104a5c4fb320.tar
rpmdrake-7e7a62d588fe132695225a1f65e9104a5c4fb320.tar.gz
rpmdrake-7e7a62d588fe132695225a1f65e9104a5c4fb320.tar.bz2
rpmdrake-7e7a62d588fe132695225a1f65e9104a5c4fb320.tar.xz
rpmdrake-7e7a62d588fe132695225a1f65e9104a5c4fb320.zip
fix sorting by type of update
Diffstat (limited to 'MandrivaUpdate')
-rwxr-xr-xMandrivaUpdate13
1 files changed, 11 insertions, 2 deletions
diff --git a/MandrivaUpdate b/MandrivaUpdate
index 5a117eb2..37491d71 100755
--- a/MandrivaUpdate
+++ b/MandrivaUpdate
@@ -50,7 +50,8 @@ use Gtk2::SimpleList;
short_name => 3,
version => 4,
release => 5,
- arch => 6
+ arch => 6,
+ importance => 7,
);
$ugtk2::wm_icon = "title-$MODE";
@@ -97,7 +98,7 @@ sub refresh_packages_list {
if ($importance) {
$icon = $icons_cache{$importance} ||= gtknew('Pixbuf', file => $update_icons{$importance});
}
- [ $icon, $pkgs->{$_}{selected}, $_, format_name_n_summary($name, $summary), $version, $release, $arch ];
+ [ $icon, $pkgs->{$_}{selected}, $_, format_name_n_summary($name, $summary), $version, $release, $arch, $importance ];
} grep { $pkgs->{$_}{pkg} } @requested;
gtktext_insert($info,
formatAlaTeX(N("The list of updates is empty. This means that either there is
@@ -159,6 +160,7 @@ sub run_treeview_dialog {
" " . N("Version") . " " => 'text',
" " . N("Release") . " " => 'text',
" " . N("Arch") . " " => 'text',
+ '' => 'hidden',
),
),
@@ -205,6 +207,13 @@ sub run_treeview_dialog {
);
$statusbar = Gtk2::Statusbar->new;
+ $list->get_model->set_sort_func($pkg_columns{image} + 1, sub {
+ my ($store, $treeiter1, $treeiter2) = @_;
+ $store->get_value($treeiter1, $pkg_columns{importance}) cmp
+ $store->get_value($treeiter2, $pkg_columns{importance});
+ });
+
+
$list->set_rules_hint(1);
my $bool_col = $list->get_column(0);
$bool_col->set_fixed_width(24);