From 6c1fa5cd83b0d46528ee8cecda42f9b1adca0b32 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 18 Nov 2013 15:41:22 +0100 Subject: use (my|u)gtk3 instead of *tk2 --- mgaapplet | 14 +++++++------- mgaapplet-config | 8 ++++---- mgaapplet-upgrade-helper | 32 ++++++++++++++++---------------- mgaapplet_gui.pm | 10 +++++----- mgaonline.pm | 2 +- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/mgaapplet b/mgaapplet index 967b0889..4597687f 100755 --- a/mgaapplet +++ b/mgaapplet @@ -31,8 +31,8 @@ use feature 'state'; BEGIN { unshift @::textdomains, 'mgaonline' } -use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version -use ugtk2 qw(:all); +use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version +use ugtk3 qw(:all); use lib qw(/usr/lib/libDrakX/drakfirsttime); use mgaonline; use mgaapplet_gui; @@ -262,7 +262,7 @@ run_program::raw({ detach => 1 }, 'ionice', '-p', $$, '-n7'); Gtk2->main; -ugtk2::exit(0); +ugtk3::exit(0); sub gnome_shell_exit_overview() { eval { Net::DBus->session->get_service('org.gnome.Shell')->get_object('/org/gnome/Shell', 'org.freedesktop.DBus.Properties')->Set('org.gnome.Shell', 'OverviewActive', dbus_boolean(0)) }; @@ -384,7 +384,7 @@ sub configNetwork() { } sub confirm_upgrade() { - local $mygtk2::left_padding = 0; + local $mygtk3::left_padding = 0; my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE}); my $w = new_portable_dialog(N("New version of Mageia distribution")); my ($temp_dir, $box); @@ -453,7 +453,7 @@ sub refresh_no_more_supported_msg() { } sub no_more_supported_choice() { - local $mygtk2::left_padding = 0; + local $mygtk3::left_padding = 0; my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_NO_MORE_SUPPORTED}); # FIXME: just tell radio buttons' children to wrap instead: local $mgaapplet_gui::width = 580; @@ -522,8 +522,8 @@ sub no_more_supported() { } sub really_confirm_upgrade() { - local $mygtk2::left_padding = 0; - my $w = ugtk2->new(N("New version of Mageia distribution"), width => $width + 20); + local $mygtk3::left_padding = 0; + my $w = ugtk3->new(N("New version of Mageia distribution"), width => $width + 20); # estimated package size: my $c; diff --git a/mgaapplet-config b/mgaapplet-config index cd3e121b..ef96655b 100755 --- a/mgaapplet-config +++ b/mgaapplet-config @@ -27,8 +27,8 @@ use common; BEGIN { unshift @::textdomains, 'mgaonline' } -use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version -use ugtk2 qw(:all); +use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version +use ugtk3 qw(:all); use mgaonline; use mgaapplet_gui; use interactive; @@ -36,11 +36,11 @@ use interactive; get_product_id(); configure(); -ugtk2::exit(0); +ugtk3::exit(0); sub configure() { - my $w = ugtk2->new(N("Adding an additional package medium"), width => -1); + my $w = ugtk3->new(N("Adding an additional package medium"), width => -1); my %config = getVarsFromSh($config_file); diff --git a/mgaapplet-upgrade-helper b/mgaapplet-upgrade-helper index a5f19e9b..90a59218 100755 --- a/mgaapplet-upgrade-helper +++ b/mgaapplet-upgrade-helper @@ -31,8 +31,8 @@ use feature 'state'; BEGIN { unshift @::textdomains, 'mgaonline' } -use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version -use ugtk2 qw(:all); +use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version +use ugtk3 qw(:all); use interactive; use do_pkgs; use lib qw(/usr/lib/libDrakX/drakfirsttime); @@ -41,7 +41,7 @@ use Rpmdrake::open_db; use lang; use mgaapplet_gui qw(run_ask_credentials_dialog); -ugtk2::add_icon_path("/usr/share/mgaonline/pixmaps/"); +ugtk3::add_icon_path("/usr/share/mgaonline/pixmaps/"); my ($log_file); my ($new_distro_version, $download_dir); @@ -82,11 +82,11 @@ sub check_available_free_space { my (undef, $free_KB) = MDK::Common::System::df($dir); if ($free_KB / 1024 < $wanted_MB) { - my $msg = ugtk2::escape_text_for_TextView_markup_format( + my $msg = ugtk3::escape_text_for_TextView_markup_format( N("Your system does not have enough space left in %s for upgrade (%dMB < %dMB)", $dir, $free_KB / 1024, $wanted_MB)); - ugtk2::ask_warn(N("Error"), $msg); + ugtk3::ask_warn(N("Error"), $msg); 0; } else { 1; @@ -133,8 +133,8 @@ my @common = ( ); sub create_upgrade_failed_window() { - local $mygtk2::left_padding = 0; - my $w = ugtk2->new(N("Error")); + local $mygtk3::left_padding = 0; + my $w = ugtk3->new(N("Error")); gtkadd($w->{window}, gtknew('VBox', children_tight => [ get_banner(), @@ -148,8 +148,8 @@ sub create_upgrade_failed_window() { } sub create_upgrade_succeeded_window() { - local $mygtk2::left_padding = 0; - my $w = ugtk2->new(N("Congratulations")); + local $mygtk3::left_padding = 0; + my $w = ugtk3->new(N("Congratulations")); gtkadd($w->{window}, gtknew('VBox', children_tight => [ get_banner(), @@ -167,13 +167,13 @@ sub check_preparation() { # Find the matching new_distro_version my @distros = get_distro_list(); if (!@distros) { - ugtk2::ask_warn(N("Error"), N("Unable to download distro list")); + ugtk3::ask_warn(N("Error"), N("Unable to download distro list")); die("unable to retrieve distro list\n"); } my $new_distro = find { $_->{version} eq $new_distro_version } @distros; if (!$new_distro) { - ugtk2::ask_warn(N("Error"), N("Distribution version %s was not found in the update list", $new_distro_version)); + ugtk3::ask_warn(N("Error"), N("Distribution version %s was not found in the update list", $new_distro_version)); die("could not find version '$new_distro_version' in the distro update list\n"); } @@ -182,7 +182,7 @@ sub check_preparation() { my $prepared = -f $statefile && cat_($statefile) =~ /ready/; if (!$prepared) { - ugtk2::ask_yesorno(N("Preparation Required"), N("In order to upgrade, your current installation needs to be prepared.\n\nDo you wish to do this preparation now?")) or exit(0); + ugtk3::ask_yesorno(N("Preparation Required"), N("In order to upgrade, your current installation needs to be prepared.\n\nDo you wish to do this preparation now?")) or exit(0); my $in = interactive->vnew; my $do_pkgs = do_pkgs::do_pkgs($in); @@ -192,9 +192,9 @@ sub check_preparation() { $prepared = -f $statefile && cat_($statefile) =~ /ready/; if (!$prepared) { my $infofile = "$root/usr/share/doc/mageia-prepare-upgrade/README.prepare"; - my $info = -f $infofile && ugtk2::escape_text_for_TextView_markup_format(join('', cat_($infofile))); + my $info = -f $infofile && ugtk3::escape_text_for_TextView_markup_format(join('', cat_($infofile))); $info ||= N("Further action is required before you can continue.\n\nPlease see %s for more information.", $new_distro->{url}); - ugtk2::ask_warn(N("Next Steps"), $info); + ugtk3::ask_warn(N("Next Steps"), $info); exit(0) if !$::testing; log::l("I would validate /var/lib/mageia-prepare-upgrade/state == 'ready'"); } @@ -221,7 +221,7 @@ sub upgrade() { if (my $err = $@) { log::explanations(sprintf("locking urpmi database failed: %s"), $err); - ugtk2::ask_warn(N("Error"), + ugtk3::ask_warn(N("Error"), N("Installation failed"), '', formatAlaTeX(N("Packages database is locked. Please close other applications @@ -280,7 +280,7 @@ packages as well?).")) log::explanations("restoringing urpmi configuration from $file"); cp_af($file, "$root/etc/urpmi/urpmi.cfg"); update_media(); - ugtk2::ask_warn(N("Error"), + ugtk3::ask_warn(N("Error"), N("Installation failed"), N("Failure when adding medium"), ); diff --git a/mgaapplet_gui.pm b/mgaapplet_gui.pm index ebec40a3..605cf3c8 100644 --- a/mgaapplet_gui.pm +++ b/mgaapplet_gui.pm @@ -46,14 +46,14 @@ our @EXPORT_OK = qw( run_no_rights_dialog ); -use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version -use ugtk2 qw(:all); +use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version +use ugtk3 qw(:all); use mgaonline qw(); # you don't want to polute the namespace use interactive; use interactive::gtk; use lib qw(/usr/lib/libDrakX/drakfirsttime); -ugtk2::add_icon_path("/usr/share/mgaonline/pixmaps/"); +ugtk3::add_icon_path("/usr/share/mgaonline/pixmaps/"); our $localdir = "$ENV{HOME}/.MgaOnline"; our $localfile = "$localdir/mgaonline"; @@ -77,7 +77,7 @@ our @common = ( sub new_portable_dialog { my ($title) = @_; - ugtk2->new($title, width => $width + 20); + ugtk3->new($title, width => $width + 20); } sub fill_n_run_portable_dialog { @@ -197,7 +197,7 @@ sub run_ask_credentials_dialog { ) ) ]), - ugtk2::create_okcancel($w, N("Next"), N("Cancel")), + ugtk3::create_okcancel($w, N("Next"), N("Cancel")), ); fill_n_run_portable_dialog($w, \@widgets); diff --git a/mgaonline.pm b/mgaonline.pm index 9288db11..5433952f 100644 --- a/mgaonline.pm +++ b/mgaonline.pm @@ -27,7 +27,7 @@ use strict; use lib qw(/usr/lib/libDrakX); use common; -use ugtk2; +use ugtk3; use LWP::UserAgent; use URI::Escape; -- cgit v1.2.1