summaryrefslogtreecommitdiffstats
path: root/gurpm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-11-26 07:07:27 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-12-05 14:20:25 +0100
commitc059ed1a4c9a21410ef6db2b9b9fc0d46a1300aa (patch)
tree70c293590cc506c648992fa9dddfc238847f4ab2 /gurpm
parentc8725fe88157ed9be4bd58c6ace28f5c68f91d9f (diff)
downloadurpmi-c059ed1a4c9a21410ef6db2b9b9fc0d46a1300aa.tar
urpmi-c059ed1a4c9a21410ef6db2b9b9fc0d46a1300aa.tar.gz
urpmi-c059ed1a4c9a21410ef6db2b9b9fc0d46a1300aa.tar.bz2
urpmi-c059ed1a4c9a21410ef6db2b9b9fc0d46a1300aa.tar.xz
urpmi-c059ed1a4c9a21410ef6db2b9b9fc0d46a1300aa.zip
use Gtk3 namespace instead of Gtk2
Diffstat (limited to 'gurpm')
-rw-r--r--gurpm/RPMProgressDialog.pm30
1 files changed, 15 insertions, 15 deletions
diff --git a/gurpm/RPMProgressDialog.pm b/gurpm/RPMProgressDialog.pm
index 84b1767c..3ef68fc3 100644
--- a/gurpm/RPMProgressDialog.pm
+++ b/gurpm/RPMProgressDialog.pm
@@ -5,7 +5,7 @@ package gurpm::RPMProgressDialog;
#- Copyright (C) 2013 Mageia
# Sharing code from gurpmi2 && Rpmdrake::gurpm
-# Gtk2 only (no ugtk3/mygtk3) as it's used by gurpmi too...
+# Gtk3 only (no ugtk3/mygtk3) as it's used by gurpmi too...
#
=head1 SYNOPSYS
@@ -18,7 +18,7 @@ that presents a global progress bar.
How to use:
my $w = gurpm::RPMProgressDialog->new:
- #$w->change_widget(Gtk2::Box->new);
+ #$w->change_widget(Gtk3::Box->new);
label(N("Preparing packages installation..."));
... # compute packages to install/remove...
$w->init_progressbar;
@@ -35,13 +35,13 @@ How to use:
=cut
use strict;
-use Gtk2;
+use Gtk3;
use urpm::download;
use urpm::msg 'N';
use urpm::util qw(max member);
use Scalar::Util qw(weaken);
-our @ISA = qw(Gtk2::Window);
+our @ISA = qw(Gtk3::Window);
sub title {
$::auto_select ? N("Distribution Upgrade") : N("Packages installation");
@@ -70,7 +70,7 @@ Arguments are an urpm object and a quit routine reference.
sub new {
my ($self, $global_urpm, $o_quit, $o_no_modal) = @_;
# my $w = ugtk3->new($title, %options, default_width => 600, width => 600);
- my $w = $mainw = bless(Gtk2::Window->new('toplevel'), $self);
+ my $w = $mainw = bless(Gtk3::Window->new('toplevel'), $self);
$old_main_window = $::main_window;
$::main_window = $w;
@@ -84,7 +84,7 @@ sub new {
$w->set_type_hint('dialog');
$w->set_modal(1);
}
- $w->{mainbox} = Gtk2::VBox->new(0, 5);
+ $w->{mainbox} = Gtk3::VBox->new(0, 5);
$w->add($w->{mainbox});
$urpm = $global_urpm;
@@ -124,8 +124,8 @@ sets the window to a please-wait message
sub label {
my ($w, $o_text) = @_;
- my $wait_vbox = Gtk2::VBox->new(0, 5);
- my $label = Gtk2::Label->new($o_text || N("Please wait..."));
+ my $wait_vbox = Gtk3::VBox->new(0, 5);
+ my $label = Gtk3::Label->new($o_text || N("Please wait..."));
$label->set_alignment(0.5, 0.5);
$wait_vbox->pack_start($label, 1, 1, 0);
$w->change_widget($wait_vbox);
@@ -136,7 +136,7 @@ sub label {
# From ugtk3.pm/mygtk3.pm:
sub gtk_new_Label_Left {
my ($text) = @_;
- my $w = Gtk2::Label->new($text);
+ my $w = Gtk3::Label->new($text);
$w->set_alignment(0, 0);
$w;
}
@@ -149,18 +149,18 @@ Put a progress bar in the dialog.
sub init_progressbar {
my ($w) = @_;
- my $vbox = Gtk2::VBox->new(0, 5);
+ my $vbox = Gtk3::VBox->new(0, 5);
my $global_label = gtk_new_Label_Left('<b>' . $w->title . '</b>');
$global_label->set_use_markup(1);
$vbox->pack_start($global_label, 0, 0, 0);
- my $global_progressbar = $w->{global_progressbar} = Gtk2::ProgressBar->new;
+ my $global_progressbar = $w->{global_progressbar} = Gtk3::ProgressBar->new;
$vbox->pack_start($global_progressbar, 0, 0, 0);
$vbox->pack_start($w->{progresslabel} = gtk_new_Label_Left('-'), 1, 1, 0);
- my $progressbar = Gtk2::ProgressBar->new;
+ my $progressbar = Gtk3::ProgressBar->new;
$progressbar->set_size_request($progressbar_size, -1);
$vbox->pack_start($progressbar, 0, 0, 0);
$w->{progressbar} = $progressbar;
@@ -204,8 +204,8 @@ $cancel_cb when clicked.
sub validate_cancel {
my ($self, $cancel_msg, $cancel_cb) = @_;
if (!$self->{cancel}) {
- $self->{hbox_cancel} = Gtk2::HButtonBox->new;
- $self->{hbox_cancel}->add($self->{cancel} = Gtk2::Button->new($cancel_msg));
+ $self->{hbox_cancel} = Gtk3::HButtonBox->new;
+ $self->{hbox_cancel}->add($self->{cancel} = Gtk3::Button->new($cancel_msg));
$self->{mainbox}->add($self->{hbox_cancel});
$self->{cancel}->signal_connect('clicked' => \&$cancel_cb);
$self->{hbox_cancel}->show_all;
@@ -248,7 +248,7 @@ tell Gtk+ to refresh the dialog content if needed.
sub sync {
my ($w) = @_;
$w->show;
- Gtk2->main_iteration while Gtk2->events_pending;
+ Gtk3->main_iteration while Gtk3->events_pending;
}
=item gurpm::RPMProgressDialog::get_something_done()