aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatteo Pasotti <matteo@mageia.org>2013-01-15 16:05:16 +0000
committerMatteo Pasotti <matteo@mageia.org>2013-01-15 16:05:16 +0000
commitb34f259e2ac181be75162fd14aa37271757193d0 (patch)
treedcbfd65069cf73c3bcbdb93816210539d348372d
parent4345045d3cf8e367af99f8ed1336e17a1e461cbd (diff)
downloadcolin-keep-b34f259e2ac181be75162fd14aa37271757193d0.tar
colin-keep-b34f259e2ac181be75162fd14aa37271757193d0.tar.gz
colin-keep-b34f259e2ac181be75162fd14aa37271757193d0.tar.bz2
colin-keep-b34f259e2ac181be75162fd14aa37271757193d0.tar.xz
colin-keep-b34f259e2ac181be75162fd14aa37271757193d0.zip
- gurpm.pm: partially fixed gurpm window
- pkg.pm: removing some warnings
-rw-r--r--AdminPanel/Rpmdragora/gurpm.pm20
-rw-r--r--AdminPanel/Rpmdragora/pkg.pm2
2 files changed, 14 insertions, 8 deletions
diff --git a/AdminPanel/Rpmdragora/gurpm.pm b/AdminPanel/Rpmdragora/gurpm.pm
index 8201c03..983f055 100644
--- a/AdminPanel/Rpmdragora/gurpm.pm
+++ b/AdminPanel/Rpmdragora/gurpm.pm
@@ -25,8 +25,6 @@ package AdminPanel::Rpmdragora::gurpm;
#
# $Id: gurpm.pm 255450 2009-04-03 16:00:16Z tv $
-package AdminPanel::Rpmdragora::gurpm;
-
use strict;
use lib qw(/usr/lib/libDrakX);
use yui;
@@ -47,7 +45,7 @@ sub new {
#my $mainw = bless(ugtk2->new($title, %options, default_width => 600, width => 600), $self);
$self->{factory} = yui::YUI::widgetFactory;
$self->{mainw} = $self->{factory}->createPopupDialog();
- $::main_window = $self->{mainw};
+ #$::main_window = $self->{mainw};
$self->{vbox} = $self->{factory}->createVBox($self->{mainw});
#OLD $mainw->{label} = gtknew('Label', text => $initializing, alignment => [ 0.5, 0 ]);
$self->{label} = $self->{factory}->createLabel($self->{vbox}, $initializing);
@@ -66,27 +64,34 @@ sub new {
#$mainw->{real_window}->show_all;
#select(undef, undef, undef, 0.1); #- hackish :-(
#$mainw->SUPER::sync;
+ $self->{mainw}->pollEvent();
+ $self->flush();
+ $self;
+}
+
+sub flush {
+ my ($self) = @_;
$self->{mainw}->recalcLayout();
$self->{mainw}->doneMultipleChanges();
- $self;
}
sub label {
my ($self, $label) = @_;
$self->{label} = $self->{factory}->createLabel($self->{vbox},$label);
#select(undef, undef, undef, 0.1); #- hackish :-(
- #$self->flush;
+ $self->flush();
}
sub progress {
my ($self, $value) = @_;
state $time;
+ $time = 0 if(!defined($time));
$value = 0 if $value < 0;
$value = 100 if 1 < $value;
$self->{progressbar}->setValue($value);
return if Time::HiRes::clock_gettime() - $time < 0.333;
$time = Time::HiRes::clock_gettime();
- #$self->flush;
+ $self->flush();
}
sub DESTROY {
@@ -111,8 +116,7 @@ sub validate_cancel {
}
#$self->{cancel}->set_sensitive(1);
#$self->{cancel}->show;
- $self->{mainw}->recalcLayout();
- $self->{mainw}->doneMultipleChanges();
+ $self->flush();
}
sub invalidate_cancel {
diff --git a/AdminPanel/Rpmdragora/pkg.pm b/AdminPanel/Rpmdragora/pkg.pm
index cd2d9f1..762db65 100644
--- a/AdminPanel/Rpmdragora/pkg.pm
+++ b/AdminPanel/Rpmdragora/pkg.pm
@@ -314,6 +314,7 @@ sub update_pbar {
return if !$total; # don't die if there's no source
$count++;
$new_stage = $level+($limit-$level)*$count/$total;
+ $prev_stage = 0 if(!defined($prev_stage));
if ($prev_stage + 0.01*100 < $new_stage) {
$prev_stage = $new_stage;
$gurpm->progress($new_stage);
@@ -324,6 +325,7 @@ sub update_pbar {
sub get_installed_packages {
my ($urpm, $db, $all_pkgs, $gurpm) = @_;
+ $urpm->{global_config}{'prohibit-remove'} = '' if(!defined($urpm->{global_config}{'prohibit-remove'}));
my @base = ("basesystem", split /,\s*/, $urpm->{global_config}{'prohibit-remove'});
my (%base, %basepackages, @installed_pkgs, @processed_base);
reset_pbar_count(0.33);