aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-07-04 11:33:26 +0200
committerAngelo Naselli <anaselli@linux.it>2014-07-04 11:33:26 +0200
commitbb5dc99c92f67fc478f81963b32cea40ee989fcd (patch)
treed0157d5e5dae33ba87b35d7facc3cf7cfafb54e4 /lib/AdminPanel
parentbc17794bb03c0083e43d219e24a92e3e51769223 (diff)
downloadmanatools-bb5dc99c92f67fc478f81963b32cea40ee989fcd.tar
manatools-bb5dc99c92f67fc478f81963b32cea40ee989fcd.tar.gz
manatools-bb5dc99c92f67fc478f81963b32cea40ee989fcd.tar.bz2
manatools-bb5dc99c92f67fc478f81963b32cea40ee989fcd.tar.xz
manatools-bb5dc99c92f67fc478f81963b32cea40ee989fcd.zip
FIxed Update media
Diffstat (limited to 'lib/AdminPanel')
-rw-r--r--lib/AdminPanel/rpmdragora.pm51
1 files changed, 25 insertions, 26 deletions
diff --git a/lib/AdminPanel/rpmdragora.pm b/lib/AdminPanel/rpmdragora.pm
index a31b5b5b..086e5ef1 100644
--- a/lib/AdminPanel/rpmdragora.pm
+++ b/lib/AdminPanel/rpmdragora.pm
@@ -642,11 +642,11 @@ sub update_sources {
my $pb = $factory->createProgressBar( $vbox, "");
- $dlg->open();
+ $dlg->pollEvent();
my @media; @media = @{$options{medialist}} if ref $options{medialist};
my $outerfatal = $urpm->{fatal};
- local $urpm->{fatal} = sub { $dlg->destroy(); $outerfatal->(@_) };
+ local $urpm->{fatal} = sub { $outerfatal->(@_) };
urpm::media::update_those_media($urpm, [ urpm::media::select_media_by_name($urpm, \@media) ],
%options, allow_failures => 1,
callback => sub {
@@ -667,8 +667,9 @@ later.",
}
},
);
+
+cancel_update:
$dlg->destroy();
- cancel_update:
}
sub show_urpm_progress {
@@ -750,12 +751,10 @@ sub update_sources_interactive {
$item->setLabel($_->{name});
$itemCollection->push($item);
$item->DISOWN();
-
}
$mediaTable->addItems($itemCollection);
-
- # dialog buttons
+ # dialog buttons
$factory->createVSpacing($vbox, 1.0);
## Window push buttons
my $hbox = $factory->createHBox( $vbox );
@@ -802,25 +801,25 @@ sub update_sources_interactive {
}
elsif ($widget == $updateButton) {
-# @media = map_index { if_($_->get_active, $buttonmedia[$::i]{name}) } @buttons;
-#
-# my @media_index;
-# for (my $it = $mediaTable->itemsBegin(); $it != $mediaTable->itemsEnd(); ) {
-# my $item = $mediaTable->YItemIteratorToYItem($it);
-# $item = $mediaTable->toCBYTableItem($item);
-# if ($item) {
-# if ($item->checked() && $media[$item->index()]{name}) {
-# push @media_index, $item->index();
-# }
-# # NOTE for some reasons it is never == $mediaTable->itemsEnd()
-# if ($item->index() == $mediaTable->itemsCount()-1) {
-# last;
-# }
-# }
-# $it = $mediaTable->nextItem($it);
-# }
-#
-# $retVal = update_sources_noninteractive($urpm, \@media_index, %options);
+ yui::YUI::app()->busyCursor();
+ my @checked_media;
+ for (my $it = $mediaTable->itemsBegin(); $it != $mediaTable->itemsEnd(); ) {
+ my $item = $mediaTable->YItemIteratorToYItem($it);
+ $item = $mediaTable->toCBYTableItem($item);
+ if ($item) {
+ if ($item->checked()) {
+ push @checked_media, $item->label();
+ }
+ # NOTE for some reasons it is never == $mediaTable->itemsEnd()
+ if ($item->index() == $mediaTable->itemsCount()-1) {
+ last;
+ }
+ }
+ $it = $mediaTable->nextItem($it);
+ }
+
+ $retVal = update_sources_noninteractive($urpm, \@checked_media, %options);
+ yui::YUI::app()->normalCursor();
last;
}
}
@@ -837,7 +836,7 @@ sub update_sources_interactive {
sub update_sources_noninteractive {
my ($urpm, $media, %options) = @_;
- urpm::media::select_media($urpm, @$media);
+ urpm::media::select_media_by_name($urpm, $media);
update_sources_check(
$urpm,
{},