aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-09-06 09:15:13 +0000
committerThierry Vignaud <tv@mandriva.org>2007-09-06 09:15:13 +0000
commit5f2587ed3b3f7d25642d9682208a3867cef07d08 (patch)
treeafa2f08f5015aa7a22bc90d2bcdc406c4da2c724
parent64e5df791e3d07cdc8a1a4a9540622b4ba334911 (diff)
downloadrpmdrake-5f2587ed3b3f7d25642d9682208a3867cef07d08.tar
rpmdrake-5f2587ed3b3f7d25642d9682208a3867cef07d08.tar.gz
rpmdrake-5f2587ed3b3f7d25642d9682208a3867cef07d08.tar.bz2
rpmdrake-5f2587ed3b3f7d25642d9682208a3867cef07d08.tar.xz
rpmdrake-5f2587ed3b3f7d25642d9682208a3867cef07d08.zip
(add_node,run_treeview_dialog) display package name, version & arch as 3
separate columns rather than raw urpm name; disable fixed mode
-rw-r--r--Rpmdrake/gui.pm10
-rwxr-xr-xrpmdrake10
2 files changed, 15 insertions, 5 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index 715be140..c7badbfa 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -56,6 +56,9 @@ our %pkg_columns = (
state_icon => 1,
state => 2,
selected => 3,
+ short_name => 4,
+ version => 5,
+ arch => 6,
);
@@ -220,7 +223,12 @@ sub add_node {
if ($leaf) {
my $iter;
if (is_a_package($leaf)) {
- $iter = $w->{detail_list_model}->append_set([ $pkg_columns{text} => $leaf ]);
+ my ($name, $version, $arch) = split_fullname($leaf);
+ $iter = $w->{detail_list_model}->append_set([ $pkg_columns{text} => $leaf,
+ $pkg_columns{short_name} => $name,
+ $pkg_columns{version} => $version,
+ $pkg_columns{arch} => $arch,
+ ]);
set_node_state($iter, $state, $w->{detail_list_model});
$ptree{$leaf} = [ $iter ];
} else {
diff --git a/rpmdrake b/rpmdrake
index fedd1d9e..0d27c241 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -176,7 +176,7 @@ sub run_treeview_dialog {
$tree->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::MDV::CellRendererPixWithLabel->new, 'pixbuf' => $grp_columns{icon}, label => $grp_columns{label}));
$tree->set_headers_visible(0);
- $detail_list_model = Gtk2::ListStore->new("Glib::String", "Gtk2::Gdk::Pixbuf", "Glib::String", "Glib::Boolean");
+ $detail_list_model = Gtk2::ListStore->new("Glib::String", "Gtk2::Gdk::Pixbuf", "Glib::String", "Glib::Boolean", "Glib::String", "Glib::String", "Glib::String");
$detail_list = Gtk2::TreeView->new_with_model($detail_list_model);
$detail_list->append_column(my $col1 = Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererToggle->new, active => $pkg_columns{selected}));
$col1->set_fixed_width(34); # w/o this the toggle cells are not displayed
@@ -186,12 +186,14 @@ sub run_treeview_dialog {
$rdr->set_fixed_size(34, 24);
$pixcolumn->set_fixed_width(34); # w/o this the pixbuf cells is empty
$pixcolumn->set_sizing('fixed');
- $detail_list->append_column(my $col = Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => $pkg_columns{text}));
- $col->set_sizing('fixed');
+ $detail_list->append_column(my $col_nm = Gtk2::TreeViewColumn->new_with_attributes(N("Package"), Gtk2::CellRendererText->new, 'text' => $pkg_columns{short_name}));
+ $detail_list->append_column(my $col_ver = Gtk2::TreeViewColumn->new_with_attributes(N("Version"), Gtk2::CellRendererText->new, 'text' => $pkg_columns{version}));
+ $detail_list->append_column(my $col_arch = Gtk2::TreeViewColumn->new_with_attributes(N("Arch"), Gtk2::CellRendererText->new, 'text' => $pkg_columns{arch}));
+ #$_->set_sizing('fixed') foreach $col_nm, $col_ver, $col_arch;
$detail_list_model->set_sort_column_id(0, 'ascending');
$detail_list->set_headers_visible(0);
$detail_list->set_rules_hint(1);
- $detail_list->set_fixed_height_mode(1);
+ #$detail_list->set_fixed_height_mode(1);
compute_main_window_size($w);