diff options
Diffstat (limited to 'perl-install/install/steps_gtk.pm')
-rw-r--r-- | perl-install/install/steps_gtk.pm | 106 |
1 files changed, 52 insertions, 54 deletions
diff --git a/perl-install/install/steps_gtk.pm b/perl-install/install/steps_gtk.pm index 1e715d0a8..caeaf997c 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; @@ -46,14 +46,14 @@ sub new($$) { run_program::run('xset', 'm', '1/8', '1'); } any::disable_x_screensaver(); - run_program::raw({ detach => 1 }, 'drakx-matchbox-window-manager'); + run_program::raw({ detach => 1 }, 'mutter'); install::gtk::init_gtk($o); install::gtk::init_sizes($o); install::gtk::install_theme($o); 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; @@ -180,7 +180,7 @@ sub leavingStep { sub charsetChanged { my ($o) = @_; - Gtk2->set_locale; + c::init_setlocale(); install::gtk::load_font($o); install::gtk::create_steps_window($o); } @@ -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")), @@ -260,15 +260,15 @@ sub reallyChooseDesktop { tip => $tips{$val->[0]}, toggled => sub { $choice = $val if $_[0]->get_active }, active => $choice == $val, - $prev ? (group => $prev->get_group) : ()); + $prev ? (join => $prev) : ()); $prev->signal_connect(key_press_event => sub { my (undef, $event) = @_; if (!$event || ($event->keyval & 0x7f) == 0xd) { - Gtk2->main_quit; + Gtk3->main_quit; } }); my $img = gtksignal_connect( - gtkadd(Gtk2::EventBox->new, gtknew('Image', file => "desktop-$val->[0]")), + gtkadd(Gtk3::EventBox->new, gtknew('Image', file => "desktop-$val->[0]")), 'button-press-event' => sub { my %title = ( KDE => N("KDE Desktop"), @@ -276,19 +276,19 @@ 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}, - gtkpack_(Gtk2::VBox->new, + 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, Gtk2::HSeparator->new, - 0, gtkpack(create_hbox('end'), - gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit }) - ), - ), + 0, gtknew('HSeparator'), + 0, gtknew('HButtonBox', layout => 'end', children_loose => [ + gtknew('Button', text => N("Close"), clicked => sub { Gtk3->main_quit }) + ]), + ]), ); $wp->{real_window}->set_size_request(-1, -1); $wp->{real_window}->grab_focus; @@ -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,23 +341,21 @@ 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}, - gtknew('ScrolledWindow', child => - gtknew('VBox', children => [ - 1, $o->{gtk_display_compssUsers}->($entry), - 1, '', - if_($individual, - 0, gtknew('CheckButton', text => N("Individual package selection"), active_ref => $individual), - ), - 0, $w_size, - 0, Gtk2::HSeparator->new, - 0, gtknew('HButtonBox', layout => 'edge', children_tight => [ - gtknew('Install_Button', text => N("Help"), clicked => sub { - interactive::gtk::display_help($o, { interactive_help_id => 'choosePackageGroups' }) }), - gtknew('Button', text => N("Unselect All"), clicked => sub { $_->set_active(0) foreach @entries }), - gtknew('Button', text => N("Next"), clicked => sub { Gtk2->main_quit }), - ]), - ]), + ugtk3::gtkadd($w->{window}, + gtknew('VBox', children => [ + 1, gtknew('ScrolledWindow', child => $o->{gtk_display_compssUsers}->($entry)), + if_($individual, + 0, gtknew('CheckButton', text => N("Individual package selection"), active_ref => $individual), + ), + 0, $w_size, + 0, gtknew('HSeparator'), + 0, gtknew('HButtonBox', layout => 'edge', children_tight => [ + gtknew('Install_Button', text => N("Help"), clicked => sub { + interactive::gtk::display_help($o, { interactive_help_id => 'choosePackageGroups' }) }), + gtknew('Button', text => N("Unselect All"), clicked => sub { $_->set_active(0) foreach @entries }), + gtknew('Button', text => N("Next"), clicked => sub { Gtk3->main_quit }), + ]), + ], ) ); $w->main; @@ -548,7 +546,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; @@ -571,8 +569,8 @@ sub installPackages { my ($title); my $pl = $f; $pl =~ s/\.png$/.pl/; eval(cat_($pl)) if -e $pl; - $banner->{text} = $title; - Gtk2::Banner::update_text($banner); + # FIXME: This hasn't actually worked for years: + #Gtk3::Banner::update_text($banner, $title); } }; @@ -588,8 +586,8 @@ 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 => [ - gtknew('Image_using_pixmap', file_ref => \$advertising_image, show_ref => \$show_advertising), + ugtk3::gtkadd($w->{window}, my $box = gtknew('VBox', children_tight => [ + gtknew('Image', file_ref => \$advertising_image, show_ref => \$show_advertising), ])); $box->pack_end(gtkshow(gtknew('VBox', border_width => 7, spacing => 3, children_loose => [ @@ -616,7 +614,7 @@ sub installPackages { $details->hide if !@install::any::advertising_images; $w->sync; foreach ($cancel, $details) { - gtkset_mousecursor_normal($_->window); + gtkset_mousecursor_normal($_->get_window); } $advertize->(0); @@ -628,7 +626,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 +640,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 +682,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,9 +696,9 @@ 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 ]); + $e->{widget} = gtknew('Label_Right', width => $::real_windowwidth * 0.72, alignment => [ 1, 1 ], line_wrap => 1); push @table, [], [ gtknew('HBox', children_tight => [ $e->{widget}, gtknew('Alignment', width => 10) ]), gtknew('Button', text => N("Configure"), clicked => sub { @@ -730,7 +728,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 +752,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 +776,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), @@ -788,7 +786,7 @@ It will then continue from the hard disk drive and the packages will remain avai 0, gtknew('HButtonBox', layout => 'edge', children_tight => [ gtknew('Install_Button', text => N("Help"), clicked => sub { interactive::gtk::display_help($o, { interactive_help_id => 'choosePackagesTree' }) }), - gtknew('Button', text => N("Next"), clicked => sub { Gtk2->main_quit }), + gtknew('Button', text => N("Next"), clicked => sub { Gtk3->main_quit }), ]), ]), ); |