aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-12-12 11:30:07 +0100
committerAngelo Naselli <anaselli@linux.it>2014-12-12 11:30:07 +0100
commitcc143f97f3e0a31f057feb90eefccca49aa8884b (patch)
tree7c4aa3a16390eb1fc53caf95c46815434d8ce362 /modules
parentddde08c747358f9256e3022bd9c9c1e2fb60850f (diff)
downloadmanatools-cc143f97f3e0a31f057feb90eefccca49aa8884b.tar
manatools-cc143f97f3e0a31f057feb90eefccca49aa8884b.tar.gz
manatools-cc143f97f3e0a31f057feb90eefccca49aa8884b.tar.bz2
manatools-cc143f97f3e0a31f057feb90eefccca49aa8884b.tar.xz
manatools-cc143f97f3e0a31f057feb90eefccca49aa8884b.zip
code review, avoid code duplication
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/rpmdragora/rpmdragora24
1 files changed, 4 insertions, 20 deletions
diff --git a/modules/rpmdragora/rpmdragora b/modules/rpmdragora/rpmdragora
index a19fa3d7..a0ed1af7 100755
--- a/modules/rpmdragora/rpmdragora
+++ b/modules/rpmdragora/rpmdragora
@@ -163,29 +163,13 @@ sub detaillist_changeditem_callback {
return;
}
-sub detaillist_callback {
+sub _detaillist_callback {
my ($selection, $info, $options, $show_options) = @_;
$info->setValue("");
return if( ref $selection ne "yui::YItem");
- my $info_text ="<h2>" . $loc->N("Informations") . "</h2>";
-
- my @data = get_info($options->{table_item_list}[$selection->index()], $show_options);
- for(@{$data[0]}){
- if(ref $_ ne "ARRAY"){
- $info_text .= "<br />" . $_;
- }else{
- $info_text .= "<br />";
- for my $subitem(@{$_}) {
- $info_text .= "<br />" . "<br />&nbsp;&nbsp;&nbsp;" . $subitem;
- }
- }
- }
- # change \n to <br/>
- $info_text =~ s|\n|<br/>|g;
-
- $info->setValue($info_text);
+ AdminPanel::Rpmdragora::gui::setInfoOnWidget($options->{table_item_list}[$selection->index()], $info, $show_options);
}
sub _do_search($$$$$$) {
@@ -1094,7 +1078,7 @@ sub run_treeview_dialog {
my $url = yui::toYMenuEvent($event)->id ();
if (AdminPanel::Rpmdragora::gui::info_details($url, $info_options) ) {
$item = $detail_list->selectedItem();
- detaillist_callback($item, $info, \%$options, $info_options);
+ _detaillist_callback($item, $info, \%$options, $info_options);
}
else {
# default it's really a URL
@@ -1204,7 +1188,7 @@ print "Menu " . $menuLabel . " chosen\n";
yui::YUI::app()->normalCursor();
tree_callback($tree->currentItem(),\%$options);
}
- detaillist_callback($detail_list->selectedItem(), $info, \%$options);
+ _detaillist_callback($detail_list->selectedItem(), $info, \%$options);
}
elsif ($widget == $QuitButton) {
last if quit();