diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2012-08-01 17:16:09 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2013-11-24 21:28:33 +0100 |
commit | 504f6c89db28716c7038153fb7838565b4ba0583 (patch) | |
tree | ca6e1c843dfb368d34f5c6b89f962d61415525ee /perl-install | |
parent | 3252bfe856428c0a38ba7edb0f0ad6245537df6e (diff) | |
download | drakx-504f6c89db28716c7038153fb7838565b4ba0583.tar drakx-504f6c89db28716c7038153fb7838565b4ba0583.tar.gz drakx-504f6c89db28716c7038153fb7838565b4ba0583.tar.bz2 drakx-504f6c89db28716c7038153fb7838565b4ba0583.tar.xz drakx-504f6c89db28716c7038153fb7838565b4ba0583.zip |
use (my|u)gtk3 instead of *tk2
Diffstat (limited to 'perl-install')
35 files changed, 258 insertions, 258 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 52dc46bb2..a04c47f5e 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -964,7 +964,7 @@ sub urpmi_add_all_media { $wait = $in->wait_message(N("Please wait"), N("Please wait, adding media...")); } elsif ($in->isa('interactive::gtk')) { push @options, '--silent-success'; - mygtk2::flush(); + mygtk3::flush(); } my $reason = join(',', $o_previous_release ? @@ -1028,17 +1028,17 @@ sub display_release_notes { } require Gtk2::WebKit; - require ugtk2; - ugtk2->import(':all'); - require mygtk2; - mygtk2->import('gtknew'); + require ugtk3; + ugtk3->import(':all'); + require mygtk3; + mygtk3->import('gtknew'); my $view = gtknew('WebKit_View', no_popup_menu => 1); $view->load_html_string($release_notes, '/'); - my $w = ugtk2->new(N("Release Notes"), transient => $::main_window, modal => 1, pop_it => 1); + my $w = ugtk3->new(N("Release Notes"), transient => $::main_window, modal => 1, pop_it => 1); gtkadd($w->{rwindow}, gtkpack_(Gtk2::VBox->new, - 1, create_scrolled_window(ugtk2::gtkset_border_width($view, 5), + 1, create_scrolled_window(ugtk3::gtkset_border_width($view, 5), [ 'never', 'automatic' ], ), 0, gtkpack(create_hbox('end'), @@ -1047,7 +1047,7 @@ sub display_release_notes { ), ), ); - mygtk2::set_main_window_size($w->{rwindow}); + mygtk3::set_main_window_size($w->{rwindow}); $w->{real_window}->grab_focus; $w->{real_window}->show_all; $w->main; diff --git a/perl-install/common.pm b/perl-install/common.pm index adee703b0..9d5763202 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -69,7 +69,7 @@ sub remove_translate_context { sub translate { my $s = translate_real(@_); - $::one_message_has_been_translated ||= join(':', (caller(1))[1,2]); #- see mygtk2.pm + $::one_message_has_been_translated ||= join(':', (caller(1))[1,2]); #- see mygtk3.pm remove_translate_context($s); } diff --git a/perl-install/dbus_object.pm b/perl-install/dbus_object.pm index dc9df0d54..a1038fc40 100644 --- a/perl-install/dbus_object.pm +++ b/perl-install/dbus_object.pm @@ -44,12 +44,12 @@ sub safe_call_method { @ret; } -sub set_gtk2_watch { +sub set_gtk3_watch { my ($o) = @_; - set_gtk2_watch_helper($o->{bus}); + set_gtk3_watch_helper($o->{bus}); } -sub set_gtk2_watch_helper { +sub set_gtk3_watch_helper { my ($bus) = @_; $bus->{connection}->set_watch_callbacks(sub { my ($con, $watch) = @_; diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm index 89d46dbfd..f552fb1af 100644 --- a/perl-install/diskdrake/hd_gtk.pm +++ b/perl-install/diskdrake/hd_gtk.pm @@ -4,8 +4,8 @@ use diagnostics; use strict; use common; -use mygtk2 qw(gtknew); -use ugtk2 qw(:helpers :wrappers :create); +use mygtk3 qw(gtknew); +use ugtk3 qw(:helpers :wrappers :create); use partition_table; use fs::type; use detect_devices; @@ -58,8 +58,8 @@ sub main { local $in->{grab} = 1; - $w = ugtk2->new(N("Partitioning")); - mygtk2::register_main_window($w->{real_window}) if !$::isEmbedded && !$::isInstall; + $w = ugtk3->new(N("Partitioning")); + mygtk3::register_main_window($w->{real_window}) if !$::isEmbedded && !$::isInstall; load_theme(); @@ -72,7 +72,7 @@ sub main { 0, gtknew(($::isInstall ? ('Title1', 'label') : ('Label_Left', 'text')) => N("Click on a partition, choose a filesystem type then choose an action"), # workaround infamous 6 years old gnome bug #101968: - width => mygtk2::get_label_width() + width => mygtk3::get_label_width() ), 1, (my $notebook_widget = Gtk2::Notebook->new), 0, (my $per_kind_action_box = gtknew('HButtonBox', layout => 'edge')), @@ -176,7 +176,7 @@ sub add_kind2notebook { 1, $box, 0, $kind->{action_box}, ]); - ugtk2::add2notebook($notebook_widget, $kind->{name}, $kind->{main_box}); + ugtk3::add2notebook($notebook_widget, $kind->{name}, $kind->{main_box}); push @notebook, $kind; $kind; } diff --git a/perl-install/diskdrake/smbnfs_gtk.pm b/perl-install/diskdrake/smbnfs_gtk.pm index 28fc9f2ea..e29101b44 100644 --- a/perl-install/diskdrake/smbnfs_gtk.pm +++ b/perl-install/diskdrake/smbnfs_gtk.pm @@ -9,8 +9,8 @@ use common; use interactive; use fs::remote::smb; use fs::remote::nfs; -use mygtk2 qw(gtknew gtkset); -use ugtk2 qw(:helpers :wrappers :create); +use mygtk3 qw(gtknew gtkset); +use ugtk3 qw(:helpers :wrappers :create); my ($all_hds, $in, $tree_model, $current_entry, $current_leaf, %icons); @@ -19,7 +19,7 @@ sub main { my ($kind) = $type eq 'smb' ? smb2kind() : nfs2kind(); $kind->check($in) or return; - my $w = ugtk2->new(N("Partitioning")); + my $w = ugtk3->new(N("Partitioning")); add_smbnfs($w->{window}, $kind); $w->{rwindow}->set_default_size(400, 300) if $w->{rwindow}->can('set_default_size'); @@ -227,7 +227,7 @@ sub import_tree { } else { if (!$tree_model->iter_has_child($curr)) { gtkset_mousecursor_wait($tree->window); - ugtk2::flush(); + ugtk3::flush(); $add_exports->($curr); gtkset_mousecursor_normal($tree->window); } diff --git a/perl-install/fs/partitioning_wizard.pm b/perl-install/fs/partitioning_wizard.pm index 750e02816..935ecb5bc 100644 --- a/perl-install/fs/partitioning_wizard.pm +++ b/perl-install/fs/partitioning_wizard.pm @@ -13,8 +13,8 @@ use partition_table; use partition_table::raw; use partition_table::dos; use POSIX qw(ceil); -use mygtk2; -use ugtk2 qw(:wrappers); +use mygtk3; +use ugtk3 qw(:wrappers); #- unit of $mb is mega bytes, min and max are in sectors, this #- function is used to convert back to sectors count the size of @@ -300,7 +300,7 @@ sub create_display_box { my $width = 540; my $minwidth = 40; - my $display_box = ugtk2::gtkset_size_request(Gtk2::HBox->new(0,0), -1, 26); + my $display_box = ugtk3::gtkset_size_request(Gtk2::HBox->new(0,0), -1, 26); my $sep_count = @parts - 1; #- ratio used to compute initial partition pixel width (each partition should be > min_width) @@ -339,12 +339,12 @@ sub create_display_box { $hpane->add2($mdv_widget); $hpane->child2_shrink(0); $hpane->set_position(ceil($ratio * $entry->{req_size})); - ugtk2::gtkset_size_request($hpane, $entry->{width}, 0); - ugtk2::gtkpack__($display_box, $hpane); + ugtk3::gtkset_size_request($hpane, $entry->{width}, 0); + ugtk3::gtkpack__($display_box, $hpane); my $add_part_size_info = sub { my ($name, $label) = @_; - ugtk2::gtkpack__($desc, + ugtk3::gtkpack__($desc, gtkadd(gtkset_name(Gtk2::EventBox->new, $name), Gtk2::Label->new(" " x 4)), gtkset_size_request(gtkset_alignment($label, 0, 0.5), @@ -396,7 +396,7 @@ sub create_display_box { 'other')); } $part_widget->set_size_request($entry->{width}, 0); - ugtk2::gtkpack($display_box, $part_widget); + ugtk3::gtkpack($display_box, $part_widget); } $part_widget->add($part_info); @@ -409,7 +409,7 @@ sub create_display_box { my @types = (N_("Ext2/3/4"), N_("XFS"), N_("Swap"), arch() =~ /sparc/ ? N_("SunOS") : arch() eq "ppc" ? N_("HFS") : N_("Windows"), N_("Other"), N_("Empty")); my %name2fs_type = ('Ext2/3/4' => 'ext3', 'XFS' => 'xfs', Swap => 'swap', Other => 'other', "Windows" => 'vfat', HFS => 'hfs'); - $desc = ugtk2::gtkpack(Gtk2::HBox->new, + $desc = ugtk3::gtkpack(Gtk2::HBox->new, map { my $t = $name2fs_type{$_}; my $ev = Gtk2::EventBox->new; @@ -443,8 +443,8 @@ sub display_choices { $contentbox->foreach(sub { $contentbox->remove($_[0]) }); $mainw->{kind}{display_box} ||= create_display_box($mainw->{kind}); - ugtk2::gtkpack2__($contentbox, $mainw->{kind}{display_box}); - ugtk2::gtkpack__($contentbox, gtknew('Label', + ugtk3::gtkpack2__($contentbox, $mainw->{kind}{display_box}); + ugtk3::gtkpack__($contentbox, gtknew('Label', text => N("The DrakX Partitioning wizard found the following solutions:"), alignment => [0, 0])); @@ -471,20 +471,20 @@ sub display_choices { log::l($s); next; } - ugtk2::gtkpack($vbox, + ugtk3::gtkpack($vbox, gtknew('Label', text => $solutions{$s}[1], alignment => [0, 0])); - ugtk2::gtkpack($vbox, $item) if defined($item); + ugtk3::gtkpack($vbox, $item) if defined($item); $button->set_group($oldbutton->get_group) if $oldbutton; $oldbutton = $button; $button->signal_connect('toggled', sub { $mainw->{sol} = $solutions{$s} if $_[0]->get_active }); - ugtk2::gtkpack2__($choicesbox, $button); + ugtk3::gtkpack2__($choicesbox, $button); $sep = gtknew('HSeparator'); - ugtk2::gtkpack2__($choicesbox, $sep); + ugtk3::gtkpack2__($choicesbox, $sep); } $choicesbox->remove($sep); - ugtk2::gtkadd($contentbox, $choicesbox); + ugtk3::gtkadd($contentbox, $choicesbox); $mainw->{sol} = $solutions{@solutions[0]}; } @@ -494,15 +494,15 @@ sub main { my $sol; if ($o->isa('interactive::gtk')) { - require mygtk2; - mygtk2->import(qw(gtknew)); - require ugtk2; - ugtk2->import(qw(:wrappers)); + require mygtk3; + mygtk3->import(qw(gtknew)); + require ugtk3; + ugtk3->import(qw(:wrappers)); - my $mainw = ugtk2->new(N("Partitioning"), %$o, if__($::main_window, transient => $::main_window)); + my $mainw = ugtk3->new(N("Partitioning"), %$o, if__($::main_window, transient => $::main_window)); $mainw->{box_allow_grow} = 1; - mygtk2::set_main_window_size($mainw->{rwindow}); + mygtk3::set_main_window_size($mainw->{rwindow}); require diskdrake::hd_gtk; diskdrake::hd_gtk::load_theme(); @@ -526,10 +526,10 @@ sub main { } $combobox->set_active(0); - ugtk2::gtkpack2__($hdchoice, $hdchoicelabel); + ugtk3::gtkpack2__($hdchoice, $hdchoicelabel); $hdchoice->add($combobox); - ugtk2::gtkpack2__($mainbox, $hdchoice); + ugtk3::gtkpack2__($mainbox, $hdchoice); my $contentbox = Gtk2::VBox->new(0, 12); @@ -564,7 +564,7 @@ sub main { ); my $buttons_pack = $mainw->create_okcancel(N("Next"), undef, '', @more_buttons); $mainbox->pack_end($buttons_pack, 0, 0, 0); - ugtk2::gtkadd($mainw->{window}, $mainbox); + ugtk3::gtkadd($mainw->{window}, $mainbox); $mainw->{window}->show_all; $mainw->main; diff --git a/perl-install/install/gtk.pm b/perl-install/install/gtk.pm index 675b33475..ac5c49ba4 100644 --- a/perl-install/install/gtk.pm +++ b/perl-install/install/gtk.pm @@ -3,8 +3,8 @@ package install::gtk; # $Id: gtk.pm 269881 2010-06-04 14:48:46Z cfergeau $ use diagnostics; use strict; -use ugtk2; -use mygtk2; +use ugtk3; +use mygtk3; use common; use lang; use devices; @@ -98,7 +98,7 @@ sub install_theme { my $win = gtknew('Window', widget_name => 'background', title => 'root window'); $win->set_type_hint('desktop'); # for matchbox window manager $win->realize; - mygtk2::set_root_window_background_with_gc($win->style->bg_gc('normal')); + mygtk3::set_root_window_background_with_gc($win->style->bg_gc('normal')); $root_window = $win; } @@ -169,7 +169,7 @@ sub update_steps_position { exists $steps{steps}{$_} or next; if ($o->{steps}{$_}{entered} && !$o->{steps}{$_}{done}) { # we need to flush the X queue since else we got a temporary Y position of -1 when switching locales: - mygtk2::flush(); #- for auto_installs which never go through the Gtk2 main loop + mygtk3::flush(); #- for auto_installs which never go through the Gtk2 main loop $o->{steps_widget}->move_selection($steps{steps}{$_}{text}); if ($last_step) { @@ -179,7 +179,7 @@ sub update_steps_position { } $last_step = $_; } - mygtk2::flush(); #- for auto_installs which never go through the Gtk2 main loop + mygtk3::flush(); #- for auto_installs which never go through the Gtk2 main loop } #------------------------------------------------------------------------------ @@ -233,7 +233,7 @@ sub special_shortcuts { install::any::take_screenshot($::o); } elsif ($d eq 'restart' && member('control-mask', @{$event->state}) && member('mod1-mask', @{$event->state})) { log::l("restarting install"); - ugtk2->exit(0x35); + ugtk3->exit(0x35); } 0; } diff --git a/perl-install/install/steps_gtk.pm b/perl-install/install/steps_gtk.pm index 04db5ffd1..d88fa2106 100644 --- a/perl-install/install/steps_gtk.pm +++ b/perl-install/install/steps_gtk.pm @@ -15,8 +15,8 @@ use install::steps_interactive; use interactive::gtk; use xf86misc::main; use common; -use mygtk2; -use ugtk2 qw(:helpers :wrappers :create); +use mygtk3; +use ugtk3 qw(:helpers :wrappers :create); use devices; use modules; use install::gtk; @@ -53,7 +53,7 @@ sub new($$) { install::gtk::create_steps_window($o); _may_configure_framebuffer_640x480($o); - $ugtk2::grab = 1; + $ugtk3::grab = 1; $o = (bless {}, ref($type) || $type)->SUPER::new($o); $o->interactive::gtk::new; @@ -245,7 +245,7 @@ sub setPackages { sub reallyChooseDesktop { my ($o, $title, $message, $choices, $choice) = @_; - my $w = ugtk2->new($title); + my $w = ugtk3->new($title); my %tips = ( KDE => N("Install %s KDE Desktop", N("Mageia")), @@ -276,12 +276,12 @@ sub reallyChooseDesktop { Custom => N("Custom Desktop"), ); - my $wp = ugtk2->new($title{$val->[0]}, transient => $w->{real_window}, modal => 1); + my $wp = ugtk3->new($title{$val->[0]}, transient => $w->{real_window}, modal => 1); gtkadd($wp->{rwindow}, gtknew('VBox', children => [ 0, gtknew('Title2', label => N("Here's a preview of the '%s' desktop.", $val->[1]), # workaround infamous 6 years old gnome bug #101968: - width => mygtk2::get_label_width(), + width => mygtk3::get_label_width(), ), 1, gtknew('Image', file => "desktop-$val->[0]-big"), 0, gtknew('HSeparator'), @@ -301,11 +301,11 @@ sub reallyChooseDesktop { ]); } @$choices; - ugtk2::gtkadd($w->{window}, + ugtk3::gtkadd($w->{window}, gtknew('VBox', children => [ 0, gtknew('Title2', # workaround infamous 6 years old gnome bug #101968: - width => mygtk2::get_label_width(), label => $message . ' ' . + width => mygtk3::get_label_width(), label => $message . ' ' . N("Click on images in order to see a bigger preview")), 1, gtknew('HButtonBox', children_loose => \@l), 0, $w->create_okcancel(N("Next"), undef, '', @@ -322,7 +322,7 @@ sub reallyChooseDesktop { sub reallyChooseGroups { my ($o, $size_to_display, $individual, $_compssUsers) = @_; - my $w = ugtk2->new(N("Package Group Selection")); + my $w = ugtk3->new(N("Package Group Selection")); my $w_size = gtknew('Label_Left', text => &$size_to_display, padding => [ 0, 0 ]); my @entries; @@ -341,7 +341,7 @@ sub reallyChooseGroups { }; #- when restarting this step, it might be necessary to reload the compssUsers.pl (bug 11558). kludgy. if (!ref $o->{gtk_display_compssUsers}) { install::any::load_rate_files($o) } - ugtk2::gtkadd($w->{window}, + ugtk3::gtkadd($w->{window}, gtknew('ScrolledWindow', child => gtknew('VBox', children => [ 1, $o->{gtk_display_compssUsers}->($entry), @@ -548,7 +548,7 @@ sub installPackages { my ($current_total_size, $last_size, $nb, $total_size, $last_dtime, $_trans_progress_total); local $::noborderWhenEmbedded = 1; - my $w = ugtk2->new(N("Installing")); + my $w = ugtk3->new(N("Installing")); state $show_advertising; my $show_release_notes; @@ -588,7 +588,7 @@ sub installPackages { my $rel_notes = gtknew('Button', text => N("Release Notes"), clicked => sub { $show_release_notes = 1 }); - ugtk2::gtkadd($w->{window}, my $box = gtknew('VBox', children_tight => [ + ugtk3::gtkadd($w->{window}, my $box = gtknew('VBox', children_tight => [ gtknew('Image_using_pixmap', file_ref => \$advertising_image, show_ref => \$show_advertising), ])); @@ -628,7 +628,7 @@ sub installPackages { $nb = $amount; $total_size = $total; $current_total_size = 0; $o->{install_start_time} = 0; - mygtk2::gtkadd($pkg_log_widget, text => P("%d package", "%d packages", $nb, $nb)); + mygtk3::gtkadd($pkg_log_widget, text => P("%d package", "%d packages", $nb, $nb)); $w->flush; } elsif ($type eq 'open') { $advertize->(1) if $show_advertising && $total_size > 20_000_000 && time() - $change_time > 20; @@ -642,7 +642,7 @@ sub installPackages { } elsif ($type eq 'inst' && $subtype eq 'start') { gtkval_modify(\$pkg_progress, 0); my $p = $packages->{depslist}[$id]; - mygtk2::gtkadd($pkg_log_widget, text => sprintf("\n%s: %s", $p->name, translate($p->summary))); + mygtk3::gtkadd($pkg_log_widget, text => sprintf("\n%s: %s", $p->name, translate($p->summary))); $current_total_size += $last_size; $last_size = $p->size; @@ -684,7 +684,7 @@ sub installPackages { sub summary_prompt { my ($o, $l, $check_complete) = @_; - my $w = ugtk2->new(N("Summary")); + my $w = ugtk3->new(N("Summary")); my $set_entry_labels; my (@table, @widget_list); @@ -698,7 +698,7 @@ sub summary_prompt { $group = $e->{group}; push @table, [ gtknew('HBox', children_tight => [ gtknew('Title1', - label => mygtk2::asteriskize(escape_text_for_TextView_markup_format($group))) ]), '' ]; + label => mygtk3::asteriskize(escape_text_for_TextView_markup_format($group))) ]), '' ]; } $e->{widget} = gtknew('Label_Right', width => $::real_windowwidth * 0.72, alignment => [ 1, 1 ]); @@ -730,7 +730,7 @@ sub summary_prompt { my $help_sub = sub { interactive::gtk::display_help($o, { interactive_help_id => 'misc-params' }) }; - ugtk2::gtkadd($w->{window}, + ugtk3::gtkadd($w->{window}, gtknew('VBox', spacing => 5, children => [ 1, gtknew('ScrolledWindow', h_policy => 'never', child => gtknew('TextView', @@ -754,15 +754,15 @@ sub ask_deselect_media__copy_on_disk { my %selection = map { $_->{name} => !$_->{ignore} } @$hdlists; if (@names > 1 || $o_copy_rpms_on_disk) { - my $w = ugtk2->new(N("Media Selection")); + my $w = ugtk3->new(N("Media Selection")); $w->sync; - ugtk2::gtkadd( + ugtk3::gtkadd( $w->{window}, gtknew('VBox', children => [ @names > 1 ? ( 0, gtknew('Label_Left', padding => [ 0, 0 ], # workaround infamous 6 years old gnome bug #101968: - width => mygtk2::get_label_width(), + width => mygtk3::get_label_width(), text => formatAlaTeX(N("The following installation media have been found. If you want to skip some of them, you can unselect them now."))), 1, gtknew('ScrolledWindow', child => gtknew('VBox', children => [ @@ -778,7 +778,7 @@ If you want to skip some of them, you can unselect them now."))), if_($o_copy_rpms_on_disk, 0, gtknew('Label_Left', padding => [ 0, 0 ], # workaround infamous 6 years old gnome bug #101968: - width => mygtk2::get_label_width(), + width => mygtk3::get_label_width(), text => N("You have the option to copy the contents of the CDs onto the hard disk drive before installation. It will then continue from the hard disk drive and the packages will remain available once the system is fully installed.")), 0, gtknew('CheckButton', text => N("Copy whole CDs"), active_ref => $o_copy_rpms_on_disk), diff --git a/perl-install/install/steps_interactive.pm b/perl-install/install/steps_interactive.pm index ee5eda054..83929dd83 100644 --- a/perl-install/install/steps_interactive.pm +++ b/perl-install/install/steps_interactive.pm @@ -36,7 +36,7 @@ use log; #-###################################################################################### sub errorInStep { my ($o, $err) = @_; - $err = ugtk2::escape_text_for_TextView_markup_format($err) if $o->isa('install::steps_gtk'); + $err = ugtk3::escape_text_for_TextView_markup_format($err) if $o->isa('install::steps_gtk'); $o->ask_warn(N("Error"), [ N("An error occurred"), formatError($err) ]); } diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 7e177b420..61c886da2 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -8,8 +8,8 @@ use vars qw(@ISA); use interactive; use common; -use mygtk2; -use ugtk2 qw(:helpers :wrappers :create); +use mygtk3; +use ugtk3 qw(:helpers :wrappers :create); use Gtk2::Gdk::Keysyms; my $forgetTime = 1000; #- in milli-seconds @@ -22,21 +22,21 @@ sub new { sub enter_console { my ($o) = @_; $o->{suspended} = common::setVirtual(1) } sub leave_console { my ($o) = @_; common::setVirtual(delete $o->{suspended}) } sub adapt_markup { - #- nothing needed, the default markup is gtk2's + #- nothing needed, the default markup is gtk3's my ($_o, $s) = @_; return $s; } -sub exit { ugtk2::exit(@_) } +sub exit { ugtk3::exit(@_) } sub ask_fileW { my ($in, $common) = @_; - my $w = ugtk2::create_file_selector(%$common); + my $w = ugtk3::create_file_selector(%$common); my $file; $w->main(sub { $file = $w->{chooser}->get_filename; - my $err = ugtk2::file_selected_check($common->{save}, $common->{want_a_dir}, $file); + my $err = ugtk3::file_selected_check($common->{save}, $common->{want_a_dir}, $file); $err and $in->ask_warn('', $err); !$err; }) && $file; @@ -51,7 +51,7 @@ sub create_boxradio { mapn { my ($txt, $w) = @_; # workaround infamous 6 years old gnome bug #101968: - $w->child->set_size_request(mygtk2::get_label_width(), -1) if $e->{alignment} ne 'right' && !$e->{label}; + $w->child->set_size_request(mygtk3::get_label_width(), -1) if $e->{alignment} ne 'right' && !$e->{label}; $w->signal_connect(button_press_event => $double_click) if $double_click; $w->signal_connect(key_press_event => $e->{may_go_to_next}); @@ -223,7 +223,7 @@ sub create_treeview_tree { my $path = Gtk2::TreePath->new_from_string($path_str); $tree->expand_to_path($path); $tree->set_cursor($path, undef, 0); - gtkflush(); #- workaround gtk2 bug not honouring centering on the given row if node was closed + gtkflush(); #- workaround gtk3 bug not honouring centering on the given row if node was closed $tree->scroll_to_cell($path, undef, 1, 0.5, 0); }; @@ -348,7 +348,7 @@ sub add_modify_remove_action { } elsif ($button->{kind} eq 'remove') { ${$e->{val}} = $e->{list}[0]; } - ugtk2::gtk_set_treelist($treelist, [ map { may_apply($e->{format}, $_) } @{$e->{list}} ]); + ugtk3::gtk_set_treelist($treelist, [ map { may_apply($e->{format}, $_) } @{$e->{list}} ]); add_modify_remove_sensitive($buttons, $e); 1; @@ -357,7 +357,7 @@ sub add_modify_remove_action { sub add_padding { my ($w) = @_; gtknew('HBox', children => [ - 0, gtknew('Alignment', width => $mygtk2::left_padding), + 0, gtknew('Alignment', width => $mygtk3::left_padding), 1, $w ]); } @@ -392,7 +392,7 @@ sub create_widget { } } elsif ($e->{type} eq 'bool') { if ($e->{image}) { - $w = ugtk2::gtkadd(Gtk2::CheckButton->new, gtkshow(gtkcreate_img($e->{image}))); + $w = ugtk3::gtkadd(Gtk2::CheckButton->new, gtkshow(gtkcreate_img($e->{image}))); } else { #- warn "\"text\" member should have been used instead of \"label\" one at:\n", common::backtrace(), "\n" if $e->{label} && !$e->{text}; $w = Gtk2::CheckButton->new_with_label($e->{text}); @@ -403,7 +403,7 @@ sub create_widget { } elsif ($e->{type} eq 'only_label') { my @common = ( # workaround infamous 6 years old gnome bug #101968: - if_($e->{alignment} ne 'right', width => mygtk2::get_label_width()) + if_($e->{alignment} ne 'right', width => mygtk3::get_label_width()) ); $w = $e->{title} ? gtknew('Title2', label => escape_text_for_TextView_markup_format(${$e->{val}}), @common) : @@ -746,7 +746,7 @@ sub create_widgets { # add asterisks before titles when there're more than one: my @all_titles = all_title_entries($l); if (2 <= @all_titles) { - ${$_->{val}} = mygtk2::asteriskize(${$_->{val}}) foreach @all_titles; + ${$_->{val}} = mygtk3::asteriskize(${$_->{val}}) foreach @all_titles; } my $box = create_widgets_block($o, $common, $l, $update, \$ignore); @@ -810,7 +810,7 @@ sub display_help_window { load_from_uri($view, $file); - my $w = ugtk2->new(N("Help"), modal => 1); + my $w = ugtk3->new(N("Help"), modal => 1); gtkadd($w->{rwindow}, gtkpack_(Gtk2::VBox->new, 1, create_scrolled_window(gtkset_border_width($view, 5), @@ -822,7 +822,7 @@ sub display_help_window { ), ), ); - mygtk2::set_main_window_size($w->{rwindow}); + mygtk3::set_main_window_size($w->{rwindow}); $w->{real_window}->grab_focus; $w->{real_window}->show_all; $w->main; @@ -847,7 +847,7 @@ sub ask_fromW { filter_widgets($l); - my $mainw = ugtk2->new($common->{title}, %$o, if__($::main_window, transient => $::main_window), + my $mainw = ugtk3->new($common->{title}, %$o, if__($::main_window, transient => $::main_window), if_($common->{icon}, icon => $common->{icon}), banner_title => $common->{banner_title}, ); @@ -855,7 +855,7 @@ sub ask_fromW { $mainw->{box_allow_grow} = 1; my $pack = create_box_with_title($mainw, @{$common->{messages}}); - mygtk2::set_main_window_size($mainw->{rwindow}) if $mainw->{pop_it} && !$common->{auto_window_size} && (@$l || $mainw->{box_size} == 200); + mygtk3::set_main_window_size($mainw->{rwindow}) if $mainw->{pop_it} && !$common->{auto_window_size} && (@$l || $mainw->{box_size} == 200); my @more_buttons = ( if_($common->{interactive_help} || $common->{interactive_help_id}, @@ -870,7 +870,7 @@ sub ask_fromW { if ($buttons_pack) { $pack->pack_end(gtkshow($buttons_pack), 0, 0, 0); } - ugtk2::gtkadd($mainw->{window}, $pack); + ugtk3::gtkadd($mainw->{window}, $pack); $set_all->(); my $entry_to_focus = find { $_->{focus} && $_->{focus}() } @$l; @@ -899,7 +899,7 @@ sub ask_fromW { sub ask_browse_tree_info_refW { my ($o, $common) = @_; add2hash($common, { wait_message => sub { $o->wait_message(@_) } }); - ugtk2::ask_browse_tree_info($common); + ugtk3::ask_browse_tree_info($common); } @@ -935,9 +935,9 @@ sub wait_messageW { if_(ref($message_modifiable), 0, $message_modifiable), ]), ); - mygtk2::enable_sync_flush($Window); + mygtk3::enable_sync_flush($Window); $Window->{wait_messageW} = $to_modify; - mygtk2::sync_flush($Window); + mygtk3::sync_flush($Window); $Window; } sub wait_message_nextW { @@ -945,17 +945,17 @@ sub wait_message_nextW { return if $message eq $Window->{wait_messageW}->get_text; #- needed otherwise no expose_event :( $Window->{displayed} = 0; $Window->{wait_messageW}->set($message); - mygtk2::sync($Window) while !$Window->{displayed}; + mygtk3::sync($Window) while !$Window->{displayed}; } sub wait_message_endW { my ($_o, $Window) = @_; if ($Window->{pop_and_reuse}) { $reuse_timeout = Glib::Timeout->add(100, sub { - mygtk2::destroy_previous_popped_and_reuse_window(); + mygtk3::destroy_previous_popped_and_reuse_window(); }); } else { - mygtk2::may_destroy($Window); - mygtk2::flush(); + mygtk3::may_destroy($Window); + mygtk3::flush(); } } @@ -979,11 +979,11 @@ sub wait_message_with_progress_bar { $progress->set_fraction($fraction); $progress->show; $displayed = 0; - mygtk2::flush() while !$displayed; + mygtk3::flush() while !$displayed; } } else { $progress->hide; - mygtk2::flush(); + mygtk3::flush(); } }; } diff --git a/perl-install/mygtk3.pm b/perl-install/mygtk3.pm index 779e77e8f..9c6fccce4 100644 --- a/perl-install/mygtk3.pm +++ b/perl-install/mygtk3.pm @@ -1,4 +1,4 @@ -package mygtk2; +package mygtk3; use diagnostics; use strict; @@ -15,7 +15,7 @@ use Gtk2; sub init() { !check_for_xserver() and print("Cannot be run in console mode.\n"), c::_exit(0); - $::one_message_has_been_translated and warn("N() was called from $::one_message_has_been_translated BEFORE gtk2 initialisation, replace it with a N_() AND a translate() later.\n"), c::_exit(1); + $::one_message_has_been_translated and warn("N() was called from $::one_message_has_been_translated BEFORE gtk3 initialisation, replace it with a N_() AND a translate() later.\n"), c::_exit(1); Gtk2->init; Locale::gettext::bind_textdomain_codeset($_, 'UTF8') foreach 'libDrakX', if_(!$::isInstall, 'libDrakX-standalone'), @@ -52,7 +52,7 @@ sub gtkset { } my %opts = @_; - $class =~ s/^(Gtk2|Gtk2::Gdk|mygtk2)::// or internal_error("gtkset unknown class $class"); + $class =~ s/^(Gtk2|Gtk2::Gdk|mygtk3)::// or internal_error("gtkset unknown class $class"); _gtk($w, $class, 'gtkset', \%opts); } @@ -67,7 +67,7 @@ sub gtkadd { internal_error("gtkadd $class: $r should be a string in @_"); } my %opts = @_; - $class =~ s/^(Gtk2|Gtk2::Gdk|mygtk2)::// or internal_error("gtkadd unknown class $class"); + $class =~ s/^(Gtk2|Gtk2::Gdk|mygtk3)::// or internal_error("gtkadd unknown class $class"); _gtk($w, $class, 'gtkadd', \%opts); } @@ -102,7 +102,7 @@ my $global_tooltips; sub _gtk { my ($w, $class, $action, $opts) = @_; - if (my $f = $mygtk2::{"_gtk__$class"}) { + if (my $f = $mygtk3::{"_gtk__$class"}) { $w = $f->($w, $opts, $class, $action); } else { internal_error("$action $class: unknown class"); @@ -337,7 +337,7 @@ sub _gtk__Image { $w->{set_from_file} = $class =~ /using_pixmap/ ? sub { my ($w, $file) = @_; - my $pixmap = mygtk2::pixmap_from_pixbuf($w, gtknew('Pixbuf', file => $file)); + my $pixmap = mygtk3::pixmap_from_pixbuf($w, gtknew('Pixbuf', file => $file)); $w->set_from_pixmap($pixmap, undef); } : $class =~ /using_pixbuf/ ? sub { my ($w, $file) = @_; @@ -612,7 +612,7 @@ sub _gtk__ComboBox { my $set_list = sub { $w->{formatted_list} = $w->{format} ? [ map { $w->{format}($_) } @{$w->{list}} ] : $w->{list}; $w->get_model->clear; - $w->{strings} = $w->{formatted_list}; # used by Gtk2::ComboBox wrappers such as get_text() in ugtk2 + $w->{strings} = $w->{formatted_list}; # used by Gtk2::ComboBox wrappers such as get_text() in ugtk3 $w->append_text($_) foreach @{$w->{formatted_list}}; }; if (my $list_ref = delete $opts->{list_ref}) { @@ -822,7 +822,7 @@ sub _gtknew_handle_layout_children { my $pixbuf = if_($opts->{pixbuf_file}, gtknew('Pixbuf', file => delete $opts->{pixbuf_file})); $w->signal_connect( realize => sub { - ugtk2::set_back_pixbuf($w, $pixbuf); + ugtk3::set_back_pixbuf($w, $pixbuf); }); } } @@ -963,7 +963,7 @@ sub _gtk__MagicWindow { real_window => $w, child => $sub_child, pop_it => $pop_it, pop_and_reuse => $pop_and_reuse, if_($provided_banner, banner => $provided_banner), - }, 'mygtk2::MagicWindow'; + }, 'mygtk3::MagicWindow'; } # A standard About dialog. Used with: @@ -1191,10 +1191,10 @@ sub _gtknew_handle_children { #- (eg : add_accel_group set_position set_default_size #- * a few methods are handled specially my %for_real_window = map { $_ => 1 } qw(show_all size_request); -sub mygtk2::MagicWindow::AUTOLOAD { +sub mygtk3::MagicWindow::AUTOLOAD { my ($w, @args) = @_; - my ($meth) = $mygtk2::MagicWindow::AUTOLOAD =~ /mygtk2::MagicWindow::(.*)/; + my ($meth) = $mygtk3::MagicWindow::AUTOLOAD =~ /mygtk3::MagicWindow::(.*)/; my ($s1, @s2) = $meth eq 'show' ? ('real_window', 'banner', 'child') : @@ -1206,7 +1206,7 @@ sub mygtk2::MagicWindow::AUTOLOAD { ? 'real_window' : 'child'; -#- warn "mygtk2::MagicWindow::$meth", first($w =~ /HASH(.*)/), " on $s1 @s2 (@args)\n"; +#- warn "mygtk3::MagicWindow::$meth", first($w =~ /HASH(.*)/), " on $s1 @s2 (@args)\n"; $w->{$_} && $w->{$_}->$meth(@args) foreach @s2; $w->{$s1}->$meth(@args); @@ -1224,10 +1224,10 @@ sub quit_popup() { if (!$in_callback) { $in_callback = 1; my $_guard = before_leaving { undef $in_callback }; - require ugtk2; - my $w = ugtk2->new(N("Confirmation"), grab => 1); - ugtk2::_ask_okcancel($w, N("Are you sure you want to quit?"), N("Quit"), N("Cancel")); - my $ret = ugtk2::main($w); + require ugtk3; + my $w = ugtk3->new(N("Confirmation"), grab => 1); + ugtk3::_ask_okcancel($w, N("Are you sure you want to quit?"), N("Quit"), N("Cancel")); + my $ret = ugtk3::main($w); return 1 if !$ret; } } @@ -1425,7 +1425,7 @@ sub get_main_window_size() { # in order to workaround infamous 6 years old gnome bug #101968: sub get_label_width() { - first(mygtk2::get_main_window_size()) - 55 - $left_padding; + first(mygtk3::get_main_window_size()) - 55 - $left_padding; } sub set_main_window_size { @@ -1469,7 +1469,7 @@ sub enable_sync_flush { sub sync_flush { my ($w) = @_; # hackish :-( - mygtk2::sync($w) while !$w->{displayed}; + mygtk3::sync($w) while !$w->{displayed}; } diff --git a/perl-install/services.pm b/perl-install/services.pm index 09f31ba20..1c3200c99 100644 --- a/perl-install/services.pm +++ b/perl-install/services.pm @@ -220,10 +220,10 @@ sub ask_standalone_gtk { my ($l, $on_services) = services(); my @xinetd_services = map { $_->[0] } xinetd_services(); - require ugtk2; - ugtk2->import(qw(:wrappers :create)); + require ugtk3; + ugtk3->import(qw(:wrappers :create)); - my $W = ugtk2->new(N("Services")); + my $W = ugtk3->new(N("Services")); my ($x, $y, $w_popup); my $nopop = sub { $w_popup and $w_popup->destroy; undef $w_popup }; my $display = sub { @@ -244,7 +244,7 @@ sub ask_standalone_gtk { my $b = Gtk2::EventBox->new; $b->set_events('pointer_motion_mask'); gtkadd($W->{window}, gtkadd($b, gtkpack_($W->create_box_with_title, - 0, mygtk2::gtknew('Title1', label => N("Services and daemons")), + 0, mygtk3::gtknew('Title1', label => N("Services and daemons")), 1, gtkset_size_request(create_scrolled_window(create_packtable({ col_spacings => 10, row_spacings => 3 }, map { my $service = $_; diff --git a/perl-install/share/po/translation_size.pl b/perl-install/share/po/translation_size.pl index ff491d08e..178baaefd 100755 --- a/perl-install/share/po/translation_size.pl +++ b/perl-install/share/po/translation_size.pl @@ -20,7 +20,7 @@ use lib qw(../..); use common; -use ugtk2; +use ugtk3; use install_gtk; !@ARGV and die "Usage: LANGUAGE=lang_to_test $0 string_to_translate\n(for example: LANGUAGE=ja $0 Advanced)\n"; diff --git a/perl-install/standalone/diskdrake b/perl-install/standalone/diskdrake index e3b304c4a..7e5645509 100755 --- a/perl-install/standalone/diskdrake +++ b/perl-install/standalone/diskdrake @@ -34,7 +34,7 @@ use fs; use log; use c; -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/diskdrake_hd.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/diskdrake_hd.png"; my %options; my @l = @ARGV; diff --git a/perl-install/standalone/display_help b/perl-install/standalone/display_help index 3894d04e3..bc219eb8a 100755 --- a/perl-install/standalone/display_help +++ b/perl-install/standalone/display_help @@ -22,8 +22,8 @@ use lib qw(/usr/lib/libDrakX); use common; use any; -use mygtk2 qw(gtknew); -use ugtk2 qw(:wrappers :create); +use mygtk3 qw(gtknew); +use ugtk3 qw(:wrappers :create); use Gtk2::WebKit; my $view = gtknew('WebKit_View', no_popup_menu => 1); @@ -31,11 +31,11 @@ my $view = gtknew('WebKit_View', no_popup_menu => 1); my $websettings = $view->get_settings; $websettings->set_property('allow-scripts-to-close-windows', 1); $view->set_settings($websettings); -$view->signal_connect('close-web-view', sub { ugtk2::exit(0) }); +$view->signal_connect('close-web-view', sub { ugtk3::exit(0) }); $view->open($ARGV[0]); -# FIXME: merge this with mcc code into new mygtk2::set_standalone_main_window_size()? +# FIXME: merge this with mcc code into new mygtk3::set_standalone_main_window_size()? my ($rootwin_width, $rootwin_height) = gtkroot()->get_size; my ($default_width, $default_height); my $wm = any::running_window_manager(); @@ -51,7 +51,7 @@ if (!$is_firstime) { } # TODO: got XID from mcc/... ? (transient & modal hints?) -my $w = ugtk2->new(N("Help"), width => $default_width, height => $default_height); +my $w = ugtk3->new(N("Help"), width => $default_width, height => $default_height); gtkadd($w->{rwindow}, gtkpack_(Gtk2::VBox->new, diff --git a/perl-install/standalone/drakautoinst b/perl-install/standalone/drakautoinst index e1d27a72a..63b8c4974 100755 --- a/perl-install/standalone/drakautoinst +++ b/perl-install/standalone/drakautoinst @@ -104,8 +104,8 @@ my $o_old = $o; # BUG (maybe install's $::o ?) my %struct_gui; if (!$::isEmbedded && $in->isa('interactive::gtk')) { - require ugtk2; - ugtk2->import(qw(:helpers :wrappers :create)); + require ugtk3; + ugtk3->import(qw(:helpers :wrappers :create)); my %tree; $struct_gui{$_} = 'General' foreach qw(lang isUpgrade autoExitInstall timezone default_packages); @@ -138,7 +138,7 @@ if (!$::isEmbedded && $in->isa('interactive::gtk')) { exists $struct_gui{$_} and push @{$tree{$struct_gui{$_}}}, [ $_ , $pixmap{$_}, h2widget($o->{$_}, "\$o->\{$_}") ] foreach keys %$o; - my $W = ugtk2->new('$o edition'); + my $W = ugtk3->new('$o edition'); my @box_to_hide; my $nb_pages=0; my $notebook = Gtk2::Notebook->new; diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot index fec394ce3..dc2b2267b 100755 --- a/perl-install/standalone/drakboot +++ b/perl-install/standalone/drakboot @@ -66,27 +66,27 @@ if ($is_bootloader_mode) { $in->exit(0); } -require ugtk2; -ugtk2->import(qw(:helpers :wrappers :create)); -require mygtk2; -mygtk2->import(qw(gtknew)); +require ugtk3; +ugtk3->import(qw(:helpers :wrappers :create)); +require mygtk3; +mygtk3->import(qw(gtknew)); autologin_choice(); sub run_boot_window { my ($title, $pack_list, $apply_sub) = @_; - my $w = ugtk2->new($title); + my $w = ugtk3->new($title); my $window = $w->{window}; mygtk3::register_main_window($w->{real_window}); - $window->signal_connect(delete_event => sub { ugtk2->exit(0) }); + $window->signal_connect(delete_event => sub { ugtk3->exit(0) }); unless ($::isEmbedded) { $window->set_border_width(2); ### menus definition # the menus are not shown but they provides shiny shortcut like C-q my @menu_items = ([ N("/_File"), undef, undef, undef, '<Branch>' ], - [ N("/File/_Quit"), N("<control>Q"), sub { ugtk2->exit(0) }, undef, '<Item>' ], + [ N("/File/_Quit"), N("<control>Q"), sub { ugtk3->exit(0) }, undef, '<Item>' ], ); create_factory_menu($w->{rwindow}, @menu_items); ######### menus end @@ -94,10 +94,10 @@ sub run_boot_window { gtkadd($window, gtknew('VBox', children => [ @$pack_list, 0, create_okcancel({ - cancel_clicked => sub { ugtk2->exit(0) }, + cancel_clicked => sub { ugtk3->exit(0) }, ok_clicked => sub { $apply_sub->(); - ugtk2->exit(0); + ugtk3->exit(0); } }) ])); $window->show_all; diff --git a/perl-install/standalone/drakbug b/perl-install/standalone/drakbug index d483605b3..a960a248d 100755 --- a/perl-install/standalone/drakbug +++ b/perl-install/standalone/drakbug @@ -26,8 +26,8 @@ use standalone; use MDK::Common; use common; BEGIN { $::no_ugtk_init = 1 } -use mygtk2 qw(gtknew); -use ugtk2 qw(:all); +use mygtk3 qw(gtknew); +use ugtk3 qw(:all); use Config; use URI::Escape; use run_program; @@ -56,12 +56,12 @@ if (!check_for_xserver()) { c::_exit(0); } -mygtk2::init(); +mygtk3::init(); -$ugtk2::wm_icon = 'drakbug-16'; -my $window = ugtk2->new(N("%s Bug Report Tool", N("Mageia")), center => 1); +$ugtk3::wm_icon = 'drakbug-16'; +my $window = ugtk3->new(N("%s Bug Report Tool", N("Mageia")), center => 1); $window->{rwindow}->set_border_width(5); -$window->{window}->signal_connect("delete_event", sub { ugtk2->exit(0) }); +$window->{window}->signal_connect("delete_event", sub { ugtk3->exit(0) }); my $mdk_app = { N("%s Control Center", N("Mageia")) => 'drakconf', @@ -175,7 +175,7 @@ gtkadd($window->{window}, }), gtkpack(create_hbox('end'), gtksignal_connect(Gtk2::Button->new(N("Report")), clicked => \&report_bug_to_bugzilla), - gtksignal_connect(Gtk2::Button->new(N("Close")), clicked => sub { ugtk2->exit(0) }), + gtksignal_connect(Gtk2::Button->new(N("Close")), clicked => sub { ugtk3->exit(0) }), )))); if (defined $prog) { @@ -197,7 +197,7 @@ $button_browse->signal_connect('file-set', sub { $com_app->set_text($button_brow $window->{window}->show_all; $window->main; -ugtk2->exit(0); +ugtk3->exit(0); sub update_app { my ($text) = @_; diff --git a/perl-install/standalone/drakclock b/perl-install/standalone/drakclock index fdda6e96d..71653b7b1 100755 --- a/perl-install/standalone/drakclock +++ b/perl-install/standalone/drakclock @@ -6,8 +6,8 @@ use POSIX; use common; # i18n : IMPORTANT to get correct namespace (drakconf instead of libDrakX) BEGIN { unshift @::textdomains, 'drakconf' } -use mygtk2 qw(gtknew); -use ugtk2 qw(:all); +use mygtk3 qw(gtknew); +use ugtk3 qw(:all); use interactive; use standalone; use timezone; @@ -21,14 +21,14 @@ my $timer; my $first = 1; my $its_reset = 0; -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/time-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/time-mdk.png"; my $ntpd = $timezone::ntp . 'd'; my $ntpfile = '/etc/' . $timezone::ntp . '.conf'; -my $my_win = ugtk2->new(N("Date, Clock & Time Zone Settings")); +my $my_win = ugtk3->new(N("Date, Clock & Time Zone Settings")); -$my_win->{window}->signal_connect(delete_event => sub { ugtk2->exit(0) }); +$my_win->{window}->signal_connect(delete_event => sub { ugtk3->exit(0) }); my $calendar = gtknew('Calendar'); $calendar->signal_connect($_ => \&cal_changed) foreach 'month-changed', 'day-selected', 'day-selected-double-click', 'prev-month', 'next-month', 'prev-year', 'next-year'; @@ -103,7 +103,7 @@ $my_win->{window}->add(gtknew('VBox', border_width => $::isEmbedded ? 0 : 5, chi ]), 0, create_okcancel(my $w = { - cancel_clicked => sub { ugtk2->exit(0) }, + cancel_clicked => sub { ugtk3->exit(0) }, ok_clicked => sub { my $need_date = 1; any::disable_x_screensaver(); @@ -156,7 +156,7 @@ $my_win->{window}->add(gtknew('VBox', border_width => $::isEmbedded ? 0 : 5, chi -e '/sbin/hwclock' and system('/sbin/hwclock', '--systohc'); any::enable_x_screensaver(); system(qw(dcop kicker Panel restart)) if $ENV{DESKTOP} eq 'kde'; - ugtk2->exit(0); + ugtk3->exit(0); }, }, undef, undef, '', @@ -230,7 +230,7 @@ $drawing_area->show; $my_win->{window}->show_all; my ($midx, $midy) = ($drawing_area->allocation->width/2, $drawing_area->allocation->height/2); $my_win->main; -ugtk2->exit(0); +ugtk3->exit(0); sub ntp_widget_state { my ($state) = @_; @@ -345,7 +345,7 @@ sub Repaint { my $dRadians_min_real = POSIX::floor($dRadians_min / $PI * 30) * $PI / 30; my $dRadians_sec_real = $dRadians_sec; my $gc = $drawing_area->style->white_gc; - # fix race on ugtk2->exit that causes a crash (#33894) + # fix race on ugtk3->exit that causes a crash (#33894) return 0 if !$gc; $pixmap->draw_rectangle($drawing_area->style->white_gc, 1, 0, 0, $width, $height); my ($midx, $midy) = ($width / 2, $height / 2); diff --git a/perl-install/standalone/drakdvb b/perl-install/standalone/drakdvb index ce735cafa..9ed351b71 100755 --- a/perl-install/standalone/drakdvb +++ b/perl-install/standalone/drakdvb @@ -22,14 +22,14 @@ use lib qw(/usr/lib/libDrakX); use MDK::Common; use common; use standalone; -use mygtk2; +use mygtk3; use interactive; -use ugtk2 qw(:create :helpers :wrappers); +use ugtk3 qw(:create :helpers :wrappers); use Gtk2::SimpleList; my $title = N("DVB"); -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/tv-mdk.png"; -my $w = ugtk2->new($title); +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/tv-mdk.png"; +my $w = ugtk3->new($title); $w->{window}->signal_connect('destroy' => \&exitapp); mygtk3::register_main_window($w->{real_window}); my $in = 'interactive'->vnew; @@ -77,7 +77,7 @@ sub detect_channels() { $buttons{detect}->set_sensitive(1); $channel_list->set_sensitive(1); }; - $wait = ugtk2->new(N("Please wait"), grab => 1); + $wait = ugtk3->new(N("Please wait"), grab => 1); $wait->{window}->signal_connect('destroy' => \&exitapp); if ($pid = fork()) { gtkadd($wait->{window}, @@ -142,7 +142,7 @@ sub launch_tv() { gtkadd($w->{window}, gtknew('VBox', spacing => 5, children => [ - $::isEmbedded ? () : (0, Gtk2::Banner->new($ugtk2::wm_icon, $title)), + $::isEmbedded ? () : (0, Gtk2::Banner->new($ugtk3::wm_icon, $title)), 1, gtknew('ScrolledWindow', width => 300, height => 400, child => $channel_list), 0, gtknew('HButtonBox', layout => 'end', children_loose => [ $buttons{detect} = gtknew('Button', text => N("Detect Channels"), clicked => \&detect_channels), diff --git a/perl-install/standalone/drakedm b/perl-install/standalone/drakedm index 77a9180cc..687846932 100755 --- a/perl-install/standalone/drakedm +++ b/perl-install/standalone/drakedm @@ -26,7 +26,7 @@ use interactive; use services; use run_program; -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/drakedm-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/drakedm-mdk.png"; my $in = 'interactive'->vnew('su'); diff --git a/perl-install/standalone/drakfloppy b/perl-install/standalone/drakfloppy index c7a21b1ed..11597c6aa 100755 --- a/perl-install/standalone/drakfloppy +++ b/perl-install/standalone/drakfloppy @@ -29,23 +29,23 @@ use lib qw(/usr/lib/libDrakX); use standalone; #- warning, standalone must be loaded very first, for 'explanations' use common; -use mygtk2 qw(gtknew); -use ugtk2 qw(:create :dialogs :helpers :wrappers); +use mygtk3 qw(gtknew); +use ugtk3 qw(:create :dialogs :helpers :wrappers); use detect_devices; -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/drakfloppy-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/drakfloppy-mdk.png"; require_root_capability(); -my $window = ugtk2->new(N("Boot Floppy")); +my $window = ugtk3->new(N("Boot Floppy")); unless ($::isEmbedded) { - $window->{rwindow}->signal_connect(delete_event => sub { ugtk2->exit(0) }); + $window->{rwindow}->signal_connect(delete_event => sub { ugtk3->exit(0) }); $window->{rwindow}->set_border_width(5); ### menus definition # the menus are not shown but they provides shiny shortcut like C-q create_factory_menu($window->{rwindow}, ( { path => N("/_File"), item_type => '<Branch>' }, - { path => N("/File/_Quit"), accelerator => N("<control>Q"), callback => sub { ugtk2->exit(0) } }, + { path => N("/File/_Quit"), accelerator => N("<control>Q"), callback => sub { ugtk3->exit(0) } }, ) ); } @@ -96,7 +96,7 @@ $window->{window}->add( ), 1, gtknew('VBox'), 0, create_okcancel({ - cancel_clicked => sub { ugtk2->exit(0) }, + cancel_clicked => sub { ugtk3->exit(0) }, ok_clicked => \&build_it, }, undef, undef, '', @@ -108,7 +108,7 @@ $window->{window}->add( $window->{rwindow}->show_all; $window->main; -ugtk2->exit(0); +ugtk3->exit(0); my $remove_but; @@ -301,7 +301,7 @@ sub build_it() { my $log = join('', <$STATUS>); if (close $STATUS) { info_dialog(N("Floppy creation completed"), N("The creation of the boot floppy has been successfully completed \n")); - ugtk2->exit; + ugtk3->exit; } else { err_dialog(N("Error"), #-PO: Do not alter the <span ..> and </span> tags diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont index c4657ffc1..4599d76f7 100755 --- a/perl-install/standalone/drakfont +++ b/perl-install/standalone/drakfont @@ -87,14 +87,14 @@ use lib qw(/usr/lib/libDrakX); use standalone; #- warning, standalone must be loaded very first, for 'explanations' -use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version -use ugtk2 qw(:create :dialogs :helpers :wrappers); +use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk3 version +use ugtk3 qw(:create :dialogs :helpers :wrappers); use common; use run_program; require_root_capability(); -$ugtk2::wm_icon = "drakfont"; +$ugtk3::wm_icon = "drakfont"; # global variables needed by each functions my $xlsfonts = 0; @@ -476,9 +476,9 @@ sub backend_mod() { sub interactive_mode() { $interactive = 1; - $window1 = ugtk2->new(N("Font Installation")); - mygtk2::register_main_window($window1->{real_window}); - $window1->{rwindow}->signal_connect(delete_event => sub { ugtk2->exit(0) }); + $window1 = ugtk3->new(N("Font Installation")); + mygtk3::register_main_window($window1->{real_window}); + $window1->{rwindow}->signal_connect(delete_event => sub { ugtk3->exit(0) }); $window1->{rwindow}->set_position('center') if !$::isEmbedded; my $button = {}; @@ -510,7 +510,7 @@ sub interactive_mode() { $window1->{rwindow}->show_all; $window1->{rwindow}->realize; $window1->main; - ugtk2->exit(0); + ugtk3->exit(0); } $list_all_font_path || $xlsfonts || $windows || @install || @uninstall ? backend_mod() : interactive_mode(); diff --git a/perl-install/standalone/drakhelp b/perl-install/standalone/drakhelp index 8a8048c81..cc7aa434c 100755 --- a/perl-install/standalone/drakhelp +++ b/perl-install/standalone/drakhelp @@ -48,7 +48,7 @@ if (-f $instpath) { local $ENV{HOME} = '/root' if !$<; run_program::raw({ detach => 1 }, 'display_help', "file://$ancpath"); } else { - $ugtk2::wm_icon = "help"; + $ugtk3::wm_icon = "help"; my $in = interactive->vnew; $in->ask_warn(N("%s Help Center", N("Mageia")), N("No Help entry for %s\n", $idlabel)); } diff --git a/perl-install/standalone/drakperm b/perl-install/standalone/drakperm index 1ad449519..c7fae3143 100755 --- a/perl-install/standalone/drakperm +++ b/perl-install/standalone/drakperm @@ -7,10 +7,10 @@ use standalone; use MDK::Common; use common; -use mygtk2 qw(gtknew gtkset); -use ugtk2 qw(:create :dialogs :helpers :wrappers); +use mygtk3 qw(gtknew gtkset); +use ugtk3 qw(:create :dialogs :helpers :wrappers); -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/drakperm-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/drakperm-mdk.png"; require_root_capability(); #- vars declaration @@ -30,10 +30,10 @@ my ($editable, $modified) = (0, 0); my @rules; #- Widget declaration -my $w = ugtk2->new(N("Security Permissions")); +my $w = ugtk3->new(N("Security Permissions")); $w->{rwindow}->set_size_request(620, 400) unless $::isEmbedded; my $W = $w->{window}; -$W->signal_connect(delete_event => sub { ugtk2->exit }); +$W->signal_connect(delete_event => sub { ugtk3->exit }); my $model = Gtk2::ListStore->new("Gtk2::Gdk::Pixbuf", ("Glib::String") x 5); my $permList = Gtk2::TreeView->new_with_model($model); @@ -129,7 +129,7 @@ Select permissions to see/edit", $level), alignment => [ 0, 0 ]), 0, gtknew('VBox'), ]), 0, create_okcancel({ - cancel_clicked => sub { ugtk2->exit }, + cancel_clicked => sub { ugtk3->exit }, ok_clicked => \&save_perm, }, undef, undef, '', @@ -160,7 +160,7 @@ $permList->get_selection->signal_connect('changed' => sub { }); $w->main; -ugtk2->exit; +ugtk3->exit; sub hide_up_button_iffirst_item { @@ -211,7 +211,7 @@ sub save_perm() { close $F; } $modified = 0; - ugtk2->exit; + ugtk3->exit; } sub load_perms() { diff --git a/perl-install/standalone/draksec b/perl-install/standalone/draksec index f78b5f63a..b4d99469f 100755 --- a/perl-install/standalone/draksec +++ b/perl-install/standalone/draksec @@ -26,8 +26,8 @@ use common; use standalone; use vars qw($MODE %options); use interactive; -use mygtk2 qw(gtknew gtkset); -use ugtk2 qw(:helpers :wrappers :ask :create); +use mygtk3 qw(gtknew gtkset); +use ugtk3 qw(:helpers :wrappers :ask :create); use run_program; use security::level; use security::msec; @@ -43,7 +43,7 @@ use security::l10n; my $_in = 'interactive'->vnew('su'); # enforce being root -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/draksec-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/draksec-mdk.png"; my ($w); ############################ I18N ################################### @@ -66,7 +66,7 @@ sub resize { gtkset($_[0], width => 50) } # factorize this with drakrpm and harddrake2 sub wait_msg { - my $mainw = ugtk2->new(N("Please wait"), (modal => 1, transient => $w->{real_window})); + my $mainw = ugtk3->new(N("Please wait"), (modal => 1, transient => $w->{real_window})); $mainw->{window}->add(gtknew('WrappedLabel', text => $_[0])); $mainw->{rwindow}->show_all; gtkset_mousecursor_wait($mainw->{rwindow}->window); @@ -84,7 +84,7 @@ sub new_nonedit_combo { } #my $msec = security::msec->new; -$w = ugtk2->new(N("Security Level and Checks")); +$w = ugtk3->new(N("Security Level and Checks")); my $window = $w->{window}; @@ -98,7 +98,7 @@ unless ($::isEmbedded) { # Connect the signals $window->signal_connect('delete_event', sub { $window->destroy }); -$window->signal_connect('destroy', sub { ugtk2->exit }); +$window->signal_connect('destroy', sub { ugtk3->exit }); $window->add(my $vbox = gtkshow(gtknew('VBox'))); @@ -231,7 +231,7 @@ gtkpack_($vbox, 0, create_okcancel(my $oc = { - cancel_clicked => sub { ugtk2->exit(0) }, + cancel_clicked => sub { ugtk3->exit(0) }, ok_clicked => sub { log::explanations("Setting up right delegation"); my %rev_auth = reverse %auth; @@ -242,7 +242,7 @@ gtkpack_($vbox, write_rules(); remove_wait_msg($w); - ugtk2->exit(0); + ugtk3->exit(0); } }, undef, undef, '' @@ -253,4 +253,4 @@ $oc->{cancel}->can_default(1); $oc->{cancel}->grab_default; $w->main; -ugtk2->exit(0); +ugtk3->exit(0); diff --git a/perl-install/standalone/draksound b/perl-install/standalone/draksound index 6a8e899ea..a51dffbca 100755 --- a/perl-install/standalone/draksound +++ b/perl-install/standalone/draksound @@ -29,7 +29,7 @@ use detect_devices; my $in = 'interactive'->vnew('su'); -$ugtk2::wm_icon = 'draksound-16'; +$ugtk3::wm_icon = 'draksound-16'; my $modules_conf = modules::any_conf->read; if (my @devices = detect_devices::probe_category('multimedia/sound')) { diff --git a/perl-install/standalone/drakups b/perl-install/standalone/drakups index 8524daf2a..266c6fd1b 100755 --- a/perl-install/standalone/drakups +++ b/perl-install/standalone/drakups @@ -6,7 +6,7 @@ use standalone; use common; use mouse; use detect_devices; -use ugtk2 qw(:create :dialogs :helpers :wrappers); +use ugtk3 qw(:create :dialogs :helpers :wrappers); use interactive; use Libconf qw(:functions); use Libconf::Glueconf::NUT::Ups_conf; @@ -313,7 +313,7 @@ my @pages = ( #$in = 'interactive'->vnew('su'); # require_root_capability(); $in = 'interactive'->vnew; -$ugtk2::wm_icon = "drakups"; +$ugtk3::wm_icon = "drakups"; if (!$::testing) { $in->do_pkgs->ensure_is_installed('nut-server', '/usr/sbin/upsd') or $in->exit(1); @@ -326,7 +326,7 @@ if (member('--wizard', @ARGV)) { $in->exit($@ ? 1 : 0); } -$w = ugtk2->new(N("UPS Management")); +$w = ugtk3->new(N("UPS Management")); if (!$::isEmbedded) { mygtk3::register_main_window($w->{real_window}); $w->{window}->set_size_request(500, 550); diff --git a/perl-install/standalone/drakxservices b/perl-install/standalone/drakxservices index 91317d1f4..5d814354e 100755 --- a/perl-install/standalone/drakxservices +++ b/perl-install/standalone/drakxservices @@ -10,7 +10,7 @@ use interactive; use services; use log; -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/service-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/service-mdk.png"; my $in = 'interactive'->vnew('su'); begin: my $l = services::ask($in); diff --git a/perl-install/standalone/drakxtv b/perl-install/standalone/drakxtv index 9b56007e2..e8cf7d9be 100755 --- a/perl-install/standalone/drakxtv +++ b/perl-install/standalone/drakxtv @@ -29,7 +29,7 @@ use detect_devices; use lang; use log; -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/tv-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/tv-mdk.png"; my $in = 'interactive'->vnew; diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2 index 588ac6841..bd1bcd9d0 100755 --- a/perl-install/standalone/harddrake2 +++ b/perl-install/standalone/harddrake2 @@ -12,11 +12,11 @@ use common; # i18n: IMPORTANT: to get correct namespace (drakconf instead of only libDrakX) BEGIN { unshift @::textdomains, 'drakconf' } -use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version -use ugtk2 qw(:create :helpers :wrappers); +use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk3 version +use ugtk3 qw(:create :helpers :wrappers); use interactive; use modules::parameters; -use harddrake::data; #- needs to stay after use-ugtk2 as long as this module defines globals containing some N() +use harddrake::data; #- needs to stay after use-ugtk3 as long as this module defines globals containing some N() use fsedit; use pkgs; use POSIX qw(:sys_wait_h); @@ -188,8 +188,8 @@ my %menu_options = ( 'PARALLEL_ZIP_DETECTION' => [ $menus{options}, N("/Autodetect parallel _zip drives") ], ); -$ugtk2::wm_icon = "harddrake"; -$w = ugtk2->new(N("Hardware Configuration")); +$ugtk3::wm_icon = "harddrake"; +$w = ugtk3->new(N("Hardware Configuration")); # fake diagnostics pragma: local $::main_window = $w->{real_window}; @@ -548,7 +548,7 @@ $w->main; sub quit_global() { kill(15, $pid) if $pid; setVarsInSh($conffile, \%options) if !$::testing; - ugtk2->exit(0); + ugtk3->exit(0); } sub show_hide { diff --git a/perl-install/standalone/localedrake b/perl-install/standalone/localedrake index cb2b81da6..231c528ea 100755 --- a/perl-install/standalone/localedrake +++ b/perl-install/standalone/localedrake @@ -34,7 +34,7 @@ if (defined $klang) { my $locale = lang::read($>); my $in = 'interactive'->vnew; -$ugtk2::wm_icon = "localedrake"; +$ugtk3::wm_icon = "localedrake"; $::Wizard_title = N("LocaleDrake"); any::selectLanguage_and_more_standalone($in, $locale); diff --git a/perl-install/standalone/logdrake b/perl-install/standalone/logdrake index d5f391b05..2c420affd 100755 --- a/perl-install/standalone/logdrake +++ b/perl-install/standalone/logdrake @@ -28,10 +28,10 @@ use c; use common; use interactive; use do_pkgs; -use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version -use ugtk2 qw(:create :dialogs :helpers :wrappers); +use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk3 version +use ugtk3 qw(:create :dialogs :helpers :wrappers); -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/logdrake-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/logdrake-mdk.png"; my $in = 'interactive'->vnew('su'); my ($isExplain, $Explain, $isFile, $File, $isWord, $Word); @@ -50,9 +50,9 @@ my $isTail = $isFile; $| = 1 if $isTail; my $h = chomp_(`hostname -s`); -$ugtk2::wm_icon = "logdrake"; +$ugtk3::wm_icon = "logdrake"; my $explain_title = N("%s Tools Logs", N("Mageia")); -my $my_win = ugtk2->new($isExplain ? $explain_title : N("Logs")); +my $my_win = ugtk3->new($isExplain ? $explain_title : N("Logs")); unless ($::isEmbedded) { $my_win->{window}->set_border_width(5); @@ -186,7 +186,7 @@ $my_win->{window}->show_all; search() if $isFile; $my_win->main; -sub quit() { ugtk2->exit(0) } +sub quit() { ugtk3->exit(0) } #------------------------------------------------------------- # search functions @@ -364,7 +364,7 @@ sub log_output { } sub insert_text_n_scroll() { - ugtk2::gtktext_insert($log_text, \@logs, append => 1); + ugtk3::gtktext_insert($log_text, \@logs, append => 1); $log_text->scroll_to_iter($log_buf->get_end_iter, 0, 1, 0.5, 0.5); undef @logs; } diff --git a/perl-install/standalone/scannerdrake b/perl-install/standalone/scannerdrake index 112953b27..f36cf4967 100755 --- a/perl-install/standalone/scannerdrake +++ b/perl-install/standalone/scannerdrake @@ -39,7 +39,7 @@ foreach (@ARGV) { /^--dynamic=(.*)$/ and do { dynamic(); exit() }; } -$ugtk2::wm_icon = "scannerdrake"; +$ugtk3::wm_icon = "scannerdrake"; my $in = 'interactive'->vnew('su'); if (!files_exist(qw(/usr/bin/scanimage /etc/sane.d/dll.conf)) || diff --git a/perl-install/ugtk3.pm b/perl-install/ugtk3.pm index 3db9ff814..d1db5ed79 100644 --- a/perl-install/ugtk3.pm +++ b/perl-install/ugtk3.pm @@ -1,4 +1,4 @@ -package ugtk2; +package ugtk3; use diagnostics; use strict; @@ -36,7 +36,7 @@ $EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ]; use c; use log; use common; -use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version +use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk3 version use Gtk2; @@ -53,8 +53,8 @@ sub wm_icon() { $wm_icon || $::Wizard_pix_up || "wiz_default_up.png" } # variables, and second, to "see" directly in the code the user interface # you're building. -sub gtkdestroy { mygtk2::may_destroy($_[0]) } -sub gtkflush() { mygtk2::flush() } +sub gtkdestroy { mygtk3::may_destroy($_[0]) } +sub gtkflush() { mygtk3::flush() } sub gtkhide { $_[0]->hide; $_[0] } sub gtkmove { $_[0]->window->move($_[1], $_[2]); $_[0] } sub gtkpack { gtkpowerpack(1, 1, @_) } @@ -152,9 +152,9 @@ sub gtkradio { } @_; } -sub gtkroot() { mygtk2::root_window() } -sub gtkcolor { &mygtk2::rgb2color } -sub gtkset_background { &mygtk2::set_root_window_background } +sub gtkroot() { mygtk3::root_window() } +sub gtkcolor { &mygtk3::rgb2color } +sub gtkset_background { &mygtk3::set_root_window_background } sub gtkset_text { my ($w, $s) = @_; @@ -360,7 +360,7 @@ sub create_box_with_title { my ($txt) = @_; ref($txt) ? $txt : gtknew('WrappedLabel', text_markup => $txt, # workaround infamous 6 years old gnome bug #101968: - width => mygtk2::get_label_width()); + width => mygtk3::get_label_width()); }; gtkpack__($box, if_($::isWizard, gtknew('Label', height => 10)), @@ -635,13 +635,13 @@ sub may_set_icon { } } -sub gtktext_insert { &mygtk2::_text_insert } -sub icon_paths { &mygtk2::_icon_paths } -sub add_icon_path { &mygtk2::add_icon_path } +sub gtktext_insert { &mygtk3::_text_insert } +sub icon_paths { &mygtk3::_icon_paths } +sub add_icon_path { &mygtk3::add_icon_path } sub set_main_window_size { my ($o) = @_; - mygtk2::set_main_window_size($o->{rwindow}); + mygtk3::set_main_window_size($o->{rwindow}); } # extracts interesting font metrics for a given widget @@ -748,7 +748,7 @@ sub new { if_(!$::isInstall, icon_no_error => wm_icon()), if_($o->{transient}, transient_for => $o->{transient}), ); - mygtk2::register_main_window($window->{real_window}) if !$opts{do_not_track_main_window}; + mygtk3::register_main_window($window->{real_window}) if !$opts{do_not_track_main_window}; $window->set_border_width(10) if !$window->{pop_it} && !$::noborderWhenEmbedded; $o->{rwindow} = $o->{window} = $window; @@ -763,7 +763,7 @@ sub main { gtkset_mousecursor_normal(); $o->show; - mygtk2::main($o->{rwindow}, + mygtk3::main($o->{rwindow}, sub { $o->{retval} ? !$o_completed || $o_completed->() : !$o_canceled || $o_canceled->() }); $o->{retval}; } @@ -807,11 +807,11 @@ END { &exit() } # Full UI managed functions that will return to you the value that the # user chose. -sub ask_warn { my $w = ugtk2->new(shift @_, grab => 1); $w->_ask_warn(@_); main($w) } -sub ask_yesorno { my $w = ugtk2->new(shift @_, grab => 1); $w->_ask_okcancel(@_, N("Yes"), N("No")); main($w) } -sub ask_okcancel { my $w = ugtk2->new(shift @_, grab => 1); $w->_ask_okcancel(@_, N("Is this correct?"), N("Ok"), N("Cancel")); main($w) } -sub ask_from_entry { my $w = ugtk2->new(shift @_, grab => 1); $w->_ask_from_entry(@_); main($w) } -sub ask_dir { my $w = ugtk2->new(shift @_, grab => 1); $w->_ask_dir(@_); main($w) } +sub ask_warn { my $w = ugtk3->new(shift @_, grab => 1); $w->_ask_warn(@_); main($w) } +sub ask_yesorno { my $w = ugtk3->new(shift @_, grab => 1); $w->_ask_okcancel(@_, N("Yes"), N("No")); main($w) } +sub ask_okcancel { my $w = ugtk3->new(shift @_, grab => 1); $w->_ask_okcancel(@_, N("Is this correct?"), N("Ok"), N("Cancel")); main($w) } +sub ask_from_entry { my $w = ugtk3->new(shift @_, grab => 1); $w->_ask_from_entry(@_); main($w) } +sub ask_dir { my $w = ugtk3->new(shift @_, grab => 1); $w->_ask_dir(@_); main($w) } sub _ask_from_entry($$@) { my ($o, @msgs) = @_; @@ -852,7 +852,7 @@ sub _ask_okcancel($@) { sub create_file_selector { my (%opts) = @_; - my $w = ugtk2->new(delete $opts{title}, modal => 1); + my $w = ugtk3->new(delete $opts{title}, modal => 1); my ($message, $save, $want_a_dir) = (delete $opts{message}, delete $opts{save}, delete $opts{want_a_dir}); my $action = $want_a_dir ? ($save ? 'create_folder' : 'select_folder') : ($save ? 'save' : 'open'); add2hash(\%opts, { width => 480, height => 250 }); @@ -901,7 +901,7 @@ sub _ask_dir { sub ask_browse_tree_info { my ($common) = @_; - my $w = ugtk2->new($common->{title}); + my $w = ugtk3->new($common->{title}); my $tree_model = Gtk2::TreeStore->new("Glib::String", "Gtk2::Gdk::Pixbuf", "Glib::String"); my $tree = Gtk2::TreeView->new_with_model($tree_model); @@ -918,7 +918,7 @@ sub ask_browse_tree_info { gtknew('VBox', spacing => 5, children => [ 0, gtknew('Title2', label => $common->{message}, # workaround infamous 6 years old gnome bug #101968: - width => mygtk2::get_label_width()), + width => mygtk3::get_label_width()), 1, gtknew('VBox', children => [ 1, gtknew('ScrolledWindow', child => $tree), 0, gtknew('Frame', text => N("Info"), child => @@ -1163,7 +1163,7 @@ sub ask_browse_tree_info_given_widgets { $curr = $iter; } #- the following test for equality is because we can have a button_press_event first, then - #- two changed events, the first being on a different row :/ (is it a bug in gtk2?) - that + #- two changed events, the first being on a different row :/ (is it a bug in gtk3?) - that #- happens in rpmdrake when doing a "search" and directly trying to select a found package if ($mouse_toggle_pending eq $model->get($iter, 0)) { $toggle->(1); @@ -1318,8 +1318,8 @@ sub set_popdown_strings { my $menu = Gtk2::Menu->new; # keep string list around for ->set_text compatibilty helper $w->{strings} = \@strs; - #$w->set_menu((ugtk2::create_factory_menu($window, [ "File", (undef) x 3, '<Branch>' ], map { [ "File/" . $_, (undef) x 3, '<Item>' ] } @strs))[0]); - $menu->append(ugtk2::gtkshow(Gtk2::MenuItem->new_with_label($_))) foreach @strs; + #$w->set_menu((ugtk3::create_factory_menu($window, [ "File", (undef) x 3, '<Branch>' ], map { [ "File/" . $_, (undef) x 3, '<Item>' ] } @strs))[0]); + $menu->append(ugtk3::gtkshow(Gtk2::MenuItem->new_with_label($_))) foreach @strs; $w->set_menu($menu); $w; } @@ -1399,34 +1399,34 @@ sub set_text { package Gtk2::Label; sub set { my ($label, $text) = @_; - mygtk2::gtkset($label, text => $text); + mygtk3::gtkset($label, text => $text); } package Gtk2::WrappedLabel; sub new { my ($_type, $o_text, $o_align) = @_; - mygtk2::gtknew('WrappedLabel', text => $o_text || '', alignment => [ $o_align || 0, 0.5 ]); + mygtk3::gtknew('WrappedLabel', text => $o_text || '', alignment => [ $o_align || 0, 0.5 ]); } package Gtk2::Entry; sub new_with_text { my ($_class, $o_text) = @_; - mygtk2::gtknew('Entry', text => $o_text); + mygtk3::gtknew('Entry', text => $o_text); } package Gtk2::Banner; use MDK::Common; -use mygtk2 qw(gtknew); -use ugtk2 qw(:helpers :wrappers); +use mygtk3 qw(gtknew); +use ugtk3 qw(:helpers :wrappers); sub set_pixmap { my ($darea) = @_; return if !$darea->realized; - ugtk2::set_back_pixbuf($darea, $darea->{back_pixbuf}); + ugtk3::set_back_pixbuf($darea, $darea->{back_pixbuf}); update_text($darea); } @@ -1441,15 +1441,15 @@ sub update_text { sub new { my ($_class, $icon, $text, $o_options) = @_; - mygtk2::import_style_ressources(); + mygtk3::import_style_ressources(); my $darea = gtknew('DrawingArea', widget_name => 'Banner'); $darea->{back_pixbuf} = gtknew('Pixbuf', file => 'banner-background'); my $d_height = $darea->{back_pixbuf}->get_height; $darea->set_size_request(-1, $d_height); $darea->modify_font(Gtk2::Pango::FontDescription->from_string("13")); - eval { $darea->{icon} = ugtk2::gtkcreate_pixbuf($icon) }; - $darea->{icon} ||= ugtk2::gtkcreate_pixbuf(ugtk2::wm_icon()); - my $blue_part = eval { gtknew('Pixbuf', file => 'banner-blue-part', flip => mygtk2::text_direction_rtl()) }; + eval { $darea->{icon} = ugtk3::gtkcreate_pixbuf($icon) }; + $darea->{icon} ||= ugtk3::gtkcreate_pixbuf(ugtk3::wm_icon()); + my $blue_part = eval { gtknew('Pixbuf', file => 'banner-blue-part', flip => mygtk3::text_direction_rtl()) }; my $blue_width = $blue_part->get_width; $darea->{text} = $text; require lang; @@ -1633,13 +1633,13 @@ sub show { package Gtk2::GUI_Update_Guard; use MDK::Common::Func qw(before_leaving); -use ugtk2; +use ugtk3; sub new { my ($_class) = @_; # prevent a perl_checker warning in callers my $old_signal = $SIG{ALRM}; $SIG{ALRM} = sub { - ugtk2::gtkflush(); + ugtk3::gtkflush(); alarm(1); }; alarm(1); |