aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-07-21 23:08:26 +0200
committerAngelo Naselli <anaselli@linux.it>2014-07-21 23:08:26 +0200
commit46baa77f917281bdbe8570ff14ab0bc6a5f19371 (patch)
treefa708cc06258b26677693b338ba0187feb18c5de /lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm
parentdf60b85c9e301789eb9cf6980df7ac331bbfa8f2 (diff)
downloadcolin-keep-46baa77f917281bdbe8570ff14ab0bc6a5f19371.tar
colin-keep-46baa77f917281bdbe8570ff14ab0bc6a5f19371.tar.gz
colin-keep-46baa77f917281bdbe8570ff14ab0bc6a5f19371.tar.bz2
colin-keep-46baa77f917281bdbe8570ff14ab0bc6a5f19371.tar.xz
colin-keep-46baa77f917281bdbe8570ff14ab0bc6a5f19371.zip
double click on a media allows to change its status (enable/disable)
Diffstat (limited to 'lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm')
-rw-r--r--lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm
index 10feb8d..113c779 100644
--- a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm
+++ b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm
@@ -1460,6 +1460,20 @@ sub mainwindow() {
}
$helpMenu{ widget }->rebuildMenuTree();
+# my %contextMenu = (
+# enable => N("Enable/Disable"),
+# update => N("Check as updates"),
+# );
+# @ordered_menu_lines = qw(enable update);
+# my $itemColl = new yui::YItemCollection;
+# foreach (@ordered_menu_lines) {
+# # last if (!$::expert && $_ eq "update");
+# my $item = new yui::YMenuItem($contextMenu{$_});
+# $item->DISOWN();
+# $itemColl->push($item);
+# }
+# yui::YUI::app()->openContextMenu($itemColl) or die "Cannot create contextMenu";
+
my $hbox_content = $factory->createHBox($vbox);
my $leftContent = $factory->createLeft($hbox_content);
$leftContent->setWeight($yui::YD_HORIZ,3);
@@ -1675,6 +1689,23 @@ sub mainwindow() {
}
elsif ($widget == $mirrorTbl) {
$selection_changed = 1;
+ # contextMenu in libyui does not work as expected let's enable/disable
+ # medium by double clicking on it
+ my $wEvent = yui::YMGAWidgetFactory::getYWidgetEvent($event);
+ if ($wEvent && $wEvent->reason() == $yui::YEvent::Activated) {
+ my $item = $mirrorTbl->selectedItem();
+ if ($item) {
+ if (interactive_msg("rpmdragora", N("Do you want to change the status of %s?", $item->label()),
+ yesno => 1)) {
+ my $row = $item->index();
+ $urpm->{media}[$row]{ignore} = !$urpm->{media}[$row]{ignore} || undef;
+ urpm::media::write_config($urpm);
+ $changed = 1;
+ }
+ }
+
+ }
+
}
}
if ($changed) {