aboutsummaryrefslogtreecommitdiffstats
path: root/modules/rpmdragora/rpmdragora
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-11-07 00:20:53 +0100
committerAngelo Naselli <anaselli@linux.it>2014-11-07 00:20:53 +0100
commit95592ce9fc2e0edd1168d6d80152730cce9bb2a1 (patch)
tree4c1e8c0080bb87223dd2f2068d77fedc327d597f /modules/rpmdragora/rpmdragora
parent390efecb238391bfe4b0335b4742d66054bde44c (diff)
downloadcolin-keep-95592ce9fc2e0edd1168d6d80152730cce9bb2a1.tar
colin-keep-95592ce9fc2e0edd1168d6d80152730cce9bb2a1.tar.gz
colin-keep-95592ce9fc2e0edd1168d6d80152730cce9bb2a1.tar.bz2
colin-keep-95592ce9fc2e0edd1168d6d80152730cce9bb2a1.tar.xz
colin-keep-95592ce9fc2e0edd1168d6d80152730cce9bb2a1.zip
- More porting for packages info
- Added a link to manage hidden information (though has problems in ncurses)
Diffstat (limited to 'modules/rpmdragora/rpmdragora')
-rwxr-xr-xmodules/rpmdragora/rpmdragora120
1 files changed, 69 insertions, 51 deletions
diff --git a/modules/rpmdragora/rpmdragora b/modules/rpmdragora/rpmdragora
index 51f2b55..f566a76 100755
--- a/modules/rpmdragora/rpmdragora
+++ b/modules/rpmdragora/rpmdragora
@@ -198,14 +198,14 @@ sub detaillist_changeditem_callback {
}
sub detaillist_callback {
- my ($selection, $info, $options) = @_;
+ 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()],$info->parent()->parent());
+ my @data = get_info($options->{table_item_list}[$selection->index()], $show_options);
for(@{$data[0]}){
if(ref $_ ne "ARRAY"){
$info_text .= "<br />" . $_;
@@ -1084,6 +1084,8 @@ sub run_treeview_dialog {
ask_browse_tree_given_widgets_for_rpmdragora($options);
+ my $info_options = {};
+
######## main loop ####################
while(1) {
my $event = $my_win->waitForEvent();
@@ -1098,58 +1100,73 @@ sub run_treeview_dialog {
elsif ($eventType == $yui::YEvent::MenuEvent) {
### MENU ###
my $item = $event->item();
- my $menuLabel = $item->label();
- if ($menuLabel eq $fileMenu{ quit }->label()) {
- #menu File->Quit
- quit();
- last;
- }
- elsif ($menuLabel eq $fileMenu{ update }->label()) {
- update_sources_interactive($urpm, transient => $my_win)
- and $reload_db_and_clear_all->();
+ if (!$item) {
+ #URL emitted or at least a ref into RichText widget
+ my $url = yui::toYMenuEvent($event)->id ();
+ $item = $detail_list->selectedItem();
+ if ($url eq $AdminPanel::Rpmdragora::gui::hidden_info{details}) {
+ $info_options->{details} = 1;
+ detaillist_callback($item, $info, \%$options, $info_options);
+ }
+ else {
+ # default it's really a URL
+ AdminPanel::Rpmdragora::gui::run_browser($url);
+ }
}
- elsif ($menuLabel eq $fileMenu{ reset_sel }->label()) {
- if ($MODE ne 'remove') {
- my $db = eval { open_rpm_db() };
- if (!ref($db)) {
- statusbar_msg($loc->N("Reset aborted (RPM DB is locked by another process)"), 1);
- return;
+ else {
+ my $menuLabel = $item->label();
+ if ($menuLabel eq $fileMenu{ quit }->label()) {
+ #menu File->Quit
+ quit();
+ last;
+ }
+ elsif ($menuLabel eq $fileMenu{ update }->label()) {
+ update_sources_interactive($urpm, transient => $my_win)
+ and $reload_db_and_clear_all->();
+ }
+ elsif ($menuLabel eq $fileMenu{ reset_sel }->label()) {
+ if ($MODE ne 'remove') {
+ my $db = eval { open_rpm_db() };
+ if (!ref($db)) {
+ statusbar_msg($loc->N("Reset aborted (RPM DB is locked by another process)"), 1);
+ return;
+ }
+ $urpm->disable_selected(
+ $db, $urpm->{state},
+ map { if_($pkgs->{$_}{selected}, $pkgs->{$_}{pkg}) } keys %$pkgs,);
}
- $urpm->disable_selected(
- $db, $urpm->{state},
- map { if_($pkgs->{$_}{selected}, $pkgs->{$_}{pkg}) } keys %$pkgs,);
+ undef $pkgs->{$_}{selected} foreach keys %$pkgs;
+ reset_search();
+ $size_selected = 0;
+ $force_displaying_group = 1;
+ my $tree_selection = $tree->currentItem();
+ }
+ elsif ($menuLabel eq $fileMenu{ reload }->label()) {
+ $reload_db_and_clear_all->();
+ }
+ elsif ($menuLabel eq $helpMenu{ about }->label()) {
+ my $translators = $loc->N("_: Translator(s) name(s) & email(s)\n");
+ $translators =~ s/\</\&lt\;/g;
+ $translators =~ s/\>/\&gt\;/g;
+ my $sh_gui = AdminPanel::Shared::GUI->new();
+ $sh_gui->AboutDialog({ name => "Rpmdragora",
+ version => "TODO",
+ credits => $loc->N("Copyright (C) %s Mageia community", '2013-2014'),
+ license => $loc->N("GPLv2"),
+ description => $loc->N("Rpmdragora is the Mageia package management tool."),
+ authors => $loc->N("<h3>Developers</h3>
+ <ul><li>%s</li>
+ <li>%s</li>
+ </ul>
+ <h3>Translators</h3>
+ <ul><li>%s</li></ul>",
+ "Angelo Naselli &lt;anaselli\@linux.it&gt;",
+ "Matteo Pasotti &lt;matteo.pasotti\@gmail.com&gt;",
+ $translators
+ ),
+ }
+ );
}
- undef $pkgs->{$_}{selected} foreach keys %$pkgs;
- reset_search();
- $size_selected = 0;
- $force_displaying_group = 1;
- my $tree_selection = $tree->currentItem();
- }
- elsif ($menuLabel eq $fileMenu{ reload }->label()) {
- $reload_db_and_clear_all->();
- }
- elsif ($menuLabel eq $helpMenu{ about }->label()) {
- my $translators = $loc->N("_: Translator(s) name(s) & email(s)\n");
- $translators =~ s/\</\&lt\;/g;
- $translators =~ s/\>/\&gt\;/g;
- my $sh_gui = AdminPanel::Shared::GUI->new();
- $sh_gui->AboutDialog({ name => "Rpmdragora",
- version => "TODO",
- credits => $loc->N("Copyright (C) %s Mageia community", '2013-2014'),
- license => $loc->N("GPLv2"),
- description => $loc->N("Rpmdragora is the Mageia package management tool."),
- authors => $loc->N("<h3>Developers</h3>
- <ul><li>%s</li>
- <li>%s</li>
- </ul>
- <h3>Translators</h3>
- <ul><li>%s</li></ul>",
- "Angelo Naselli &lt;anaselli\@linux.it&gt;",
- "Matteo Pasotti &lt;matteo.pasotti\@gmail.com&gt;",
- $translators
- ),
- }
- );
}
}
elsif ($eventType == $yui::YEvent::WidgetEvent) {
@@ -1180,6 +1197,7 @@ sub run_treeview_dialog {
tree_callback($tree->currentItem(),\%$options);
}
elsif ($widget == $detail_list){
+ $info_options = {};
detaillist_callback($detail_list->selectedItem(), $info, \%$options);
detaillist_changeditem_callback($detail_list, \%$options);
}