summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gurpmi.pm4
-rwxr-xr-xgurpmi221
2 files changed, 6 insertions, 19 deletions
diff --git a/gurpmi.pm b/gurpmi.pm
index 70e13e3a..b2c3ec7c 100644
--- a/gurpmi.pm
+++ b/gurpmi.pm
@@ -108,9 +108,7 @@ sub new_label {
$label->set_line_wrap(1);
$label->set_alignment(0.5, 0.5);
if (($msg =~ tr/\n/\n/) > 5) {
- my $sw = Gtk2::ScrolledWindow->new;
- $sw->set_policy('never', 'automatic');
- $sw->add_with_viewport($label);
+ my $sw = create_scrolled_window($label, [ 'never', 'automatic' ]);
$sw->set_size_request(-1,200);
return $sw;
} else {
diff --git a/gurpmi2 b/gurpmi2
index 21a30ce3..772a3187 100755
--- a/gurpmi2
+++ b/gurpmi2
@@ -102,14 +102,10 @@ sub configure_urpm() {
if ($nb_lines > 30) {
$w = Gtk2::Dialog->new(N("Warning"), $mainw, [qw(modal destroy-with-parent)], N("Ok"), 'ok');
$w->vbox->add(my $f = Gtk2::Frame->new);
- my $sw = Gtk2::ScrolledWindow->new(undef, undef);
+ my $sw = create_scrolled_window(my $text = Gtk2::TextView->new);
+ $sw->set_border_width(2);
$f->add($sw);
- $f->set_shadow_type('in');
- $sw->set_policy('automatic', 'automatic');
- my $text = Gtk2::TextView->new;
- $sw->add($text);
$text->get_buffer->set_text($message);
- $sw->set_border_width(2);
$_->show foreach $f, $sw, $text;
$w->set_size_request(400, 400);
} else {
@@ -118,8 +114,8 @@ sub configure_urpm() {
$w->run;
$w->destroy;
};
- $urpm->exlock_rpm_db;
- $urpm->shlock_urpmi_db;
+ $urpm->lock_rpm_db('exclusive');
+ $urpm->lock_urpmi_db;
$urpm->configure(
root => $gurpmi::options{root},
media => $gurpmi::options{media},
@@ -247,9 +243,6 @@ sub do_install_3 () {
\@transaction_list,
\%transaction_sources,
\%error_sources,
- limit_rate => $urpm->{options}{'limit-rate'},
- compress => $urpm->{options}{compress},
- resume => $urpm->{options}{resume},
callback => sub {
my ($mode, $file, $percent) = @_;
if ($mode eq 'start') {
@@ -305,7 +298,6 @@ sub do_install_3 () {
$set->{remove} || [],
\%transaction_sources_install,
\%transaction_sources,
- 'fork' => 0, #- do not fork (even if multiple transaction) because of X11 crash
translate_message => 1,
oldpackage => $state->{oldpackage},
callback_inst => $callback_inst,
@@ -328,10 +320,7 @@ sub do_install_3 () {
}
$vbox = Gtk2::VBox->new(0, 5);
$progress_label = Gtk2::Label->new('-');
- my $sw = Gtk2::ScrolledWindow->new(undef, undef);
- $sw->add_with_viewport($progress_label);
- $sw->set_shadow_type('in');
- $sw->set_policy('automatic', 'automatic');
+ my $sw = create_scrolled_window($progress_label);
$sw->set_size_request(500, 200);
$vbox->pack_start($sw, 1, 1, 0);
my $quit_button = Gtk2::Button->new(but(N("_Done")));