From 87416ad0683631051338fd62e3db7f23f0169c14 Mon Sep 17 00:00:00 2001 From: Matteo Pasotti Date: Wed, 16 Jan 2013 17:43:22 +0000 Subject: - gui.pm: rewrote get_description, get_details, get_url_link, get_main_text - gui.pm: dropped gtk expanders from format_pkg_simplifiedinfo (Files and Changelog still missing) - gui.pm: added table_item_list hash (needed because of the -poor- YTable implementation) - rpmdragora: added detaillist_callback to handle detail_list double-click event - rpmdragora: switched info from YMultiLineEdit to YRichText widget --- modules/rpmdragora/rpmdragora | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/rpmdragora/rpmdragora b/modules/rpmdragora/rpmdragora index f1f99d3..8b1f9d1 100755 --- a/modules/rpmdragora/rpmdragora +++ b/modules/rpmdragora/rpmdragora @@ -134,6 +134,23 @@ sub tree_callback { return; } +sub detaillist_callback { + my ($selection, $info, $options) = @_; + $info->setValue(""); + $info->setValue("

".N("Informations")."

"); + my @data = get_info($options->{table_item_list}[$selection->index()],$info->parent()->parent()); + for(@{$data[0]}){ + if(ref $_ ne "ARRAY"){ + $info->setValue($info->value()."
$_"); + }else{ + $info->setValue($info->value()."
"); + for my $subitem(@{$_}){ + $info->setValue($info->value()."
   ".$subitem); + } + } + } +} + sub do_search($$$$$$$) { my ($find_entry, $tree, $tree_model, $options, $current_search_type, $urpm, $pkgs) = @_; my $entry = $find_entry->value() or return; @@ -452,6 +469,7 @@ sub run_treeview_dialog { $detail_list = $factory->createTable($hbox_middle,$detail_list_header); $detail_list->setWeight(0,50); + $detail_list->setNotify(1); #OLD compute_main_window_size($w); =comment @@ -620,7 +638,9 @@ sub run_treeview_dialog { $find_entry->setWeight(0,10); #OLD my $info = Gtk2::Mdv::TextView->new; - my $info = $factory->createMultiLineEdit($hbox_bottom,""); + #my $info = $factory->createMultiLineEdit($hbox_bottom,""); + my $info = $factory->createRichText($hbox_bottom,""); + #$info->setDisabled(); $info->setWeight(0,40); $info->setWeight(1,40); #OLD $info->set_left_margin(2); @@ -1001,6 +1021,9 @@ sub run_treeview_dialog { elsif ($widget == $tree) { tree_callback($tree->currentItem(),\%$options); } + elsif ($widget == $detail_list){ + detaillist_callback($detail_list->selectedItem(), $info, \%$options); + } elsif ($widget == $file_menu && $mnuItemUpdateMedia) { update_sources_interactive($urpm, transient => $my_win) and $reload_db_and_clear_all->(); -- cgit v1.2.1