From e1a1d3d2e14a141ff17ab5c550eb966092a19aa9 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 22 May 2015 03:10:54 -0400 Subject: drop remaining unused splash bits should have been done in commit 5a382f9b0c1fac53338afd7ddd2478a6e36f03e3 --- perl-install/standalone/drakboot | 134 +-------------------------------------- 1 file changed, 1 insertion(+), 133 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot index f9c337d80..77e1922c6 100755 --- a/perl-install/standalone/drakboot +++ b/perl-install/standalone/drakboot @@ -44,7 +44,7 @@ my $cmdline = cat_('/proc/cmdline'); my $is_bootloader_mode = !$in->isa('interactive::gtk') || any { /^--boot$/ } @ARGV; -if ($is_bootloader_mode || any { /^--splash$/ } @ARGV) { +if ($is_bootloader_mode) { $all_hds = fsedit::get_hds(); fs::get_raw_hds('', $all_hds); fs::get_info_from_fstab($all_hds); @@ -115,68 +115,6 @@ sub run_boot_window { $in->exit(0); } -sub splash_choice() { - require bootsplash; - my ($cur_res, $bootsplash_available) = bootsplash::get_framebuffer_resolution(); - $bootsplash_available = 1 if $::testing; - - my $theme = bootsplash::themes_read_sysconfig($cur_res); - $bootsplash_available or $theme->{enabled} = 0; - - my $boot_pic = gtknew('Image', file => $bootsplash::default_thumbnail); - change_image($boot_pic, $theme->{name}, $cur_res); - - my $theme_combo = gtknew('ComboBox', text => $theme->{name}, list => [ bootsplash::themes_list_for_resolution($cur_res) ]); - $theme_combo->entry->signal_connect(changed => sub { - $theme->{name} = $theme_combo->entry->get_text; - change_image($boot_pic, $theme->{name}, $cur_res); - }); - - my $splash_box; - my $boot_warn = 1; - my %modes = ( - text => N("Text only"), - splash => N("Silent"), - ); - my $mode_combo = gtknew('ComboBox', text => $modes{$theme->{enabled} ? $cmdline =~ /\bsplash\b/ && $cmdline =~ /\bquiet\b/ ? 'splash' : 'text' : 'text'}, list => [ values %modes ]); - $mode_combo->entry->signal_connect(changed => sub { - $theme->{enabled} = $mode_combo->entry->get_text ne $modes{text}; - if ($boot_warn && !$bootsplash_available && $theme->{enabled}) { - if ($in->ask_yesorno(N("Warning"), - [ N("Your system bootloader is not in framebuffer mode. To activate graphical boot, select a graphic video mode from the bootloader configuration tool.") . "\n" . - N("Do you want to configure it now?") ])) { - enable_framebuffer(); - #- it would be nice to get available themes for new cur_res here - } - $boot_warn = 0; - } - $splash_box->set_sensitive($theme->{enabled}); - }); - - my $_thm_button = gtknew('Button', text => N("Install themes")); - - run_boot_window(N("Graphical boot theme selection"), - [ - 1, gtknew('VBox', spacing => 5, border_width => 5, children => [ - 0, gtknew('HBox', padding => 12, spacing => 5, children_tight => [ gtknew('Label', text => N("Graphical boot mode:")), $mode_combo ]), - 0, $splash_box = gtknew('HBox', sensitive => $theme->{enabled}, children_loose => [ - gtkadd(gtkcreate_frame(N("Theme")), - gtknew('VBox', border_width => 12, spacing => 12, children_tight => [ - $theme_combo, $boot_pic ])), ]), - ]), - ], - sub { - if ($theme->{enabled}) { - bootsplash::switch($theme->{name}); - } else { - bootsplash::remove(); - } - my $text = $mode_combo->entry->get_text; - my $mode = find { $modes{$_} eq $text } keys %modes; - set_splash_append($mode); - }); -} - sub autologin_choice() { my @users = sort(list_users()); my @sessions = sort(split(' ', `/usr/sbin/chksession -l`)); @@ -233,73 +171,3 @@ sub autologin_choice() { any::set_autologin($in->do_pkgs, $auto_mode); }); } - - -#------------------------------------------------------------- -# launch autologin functions -#------------------------------------------------------------- - -sub change_image { - my ($boot_pic, $theme, $res) = @_; - my $img_file = bootsplash::theme_get_image_for_resolution($theme, $res); - -f $img_file or return; - my $boot_pixbuf = gtknew('Pixbuf', file => $img_file); - $boot_pixbuf = $boot_pixbuf->scale_simple(300, 200, 'nearest'); - $boot_pic->set_from_pixbuf($boot_pixbuf); -} - -sub set_splash_append { - my ($mode) = @_; - if ($mode ne 'splash') { - bootloader::remove_append_simple($bootloader, 'splash'); - bootloader::remove_append_simple($bootloader, 'quiet'); - } else { - bootloader::set_append_simple($bootloader, 'splash'); - bootloader::set_append_simple($bootloader, 'quiet'); - } - modify_bootloader($bootloader, $all_hds); -} - -sub enable_framebuffer() { - my $vga = bootsplash::get_framebuffer_resolution(); - my ($current_entry) = $cmdline =~ /^BOOT_IMAGE=(\S+)/; - my %entries = ( - $current_entry => 1 - ); - local $::isWizard = 1; - local $::Wizard_no_previous = 1; - local $::Wizard_finished = 1; - $::Wizard_title = N("Boot Style Configuration"); - eval { - $in->ask_from(N("Video mode"), - N("Please choose a video mode, it will be applied to each of the boot entries selected below. -Be sure your video card supports the mode you choose."), - [ - { label => N("Video mode"), val => \$vga, - list => [ '', Xconfig::resolution_and_depth::bios_vga_modes() ], - format => \&Xconfig::resolution_and_depth::to_string - }, - map { - { text => $_->{label}, val => \$entries{$_->{label}}, type => 'bool' }; - } grep { $_->{label} !~ /failsafe|floppy|memtest/ } @{$bootloader->{entries}} - ]); - if ($vga) { - $vga = $vga->{bios} if ref($vga); - while (my ($label, $e) = each %entries) { - $e or next; - my $entry = find { $_->{label} eq $label } @{$bootloader->{entries}}; - $entry->{vga} = $vga; - } - modify_bootloader($bootloader, $all_hds); - } - }; - die if $@ && $@ !~ /^wizcancel/; - $::WizardWindow->destroy unless $::isEmbedded; - $vga; -} - -sub modify_bootloader { - my ($bootloader, $all_hds) = @_; - bootloader::action($bootloader, 'write', $all_hds); - bootloader::action($bootloader, 'when_config_changed'); -} -- cgit v1.2.1