diff options
-rw-r--r-- | Master/tlpkg/etc/dev.installer-gui-rework.diff | 188 |
1 files changed, 188 insertions, 0 deletions
diff --git a/Master/tlpkg/etc/dev.installer-gui-rework.diff b/Master/tlpkg/etc/dev.installer-gui-rework.diff new file mode 100644 index 00000000000..2b17d086c64 --- /dev/null +++ b/Master/tlpkg/etc/dev.installer-gui-rework.diff @@ -0,0 +1,188 @@ +Index: install-tl +=================================================================== +--- install-tl (revision 11294) ++++ install-tl (working copy) +@@ -268,10 +268,7 @@ + + # $finished == 1 if the menu call already did the installation + my $finished = 0; +-@::start_install_hook = (); +-@::end_install_hook = (); +-@::start_postinst_hook = (); +-@::start_install_hook = (); ++@::info_hook = (); + + my $system_tmpdir=get_system_tmpdir(); + my $media; +@@ -481,9 +478,6 @@ + sub do_installation { + # do the actual installation + my $h; +- foreach $h (@::start_install_hook) { +- &$h(); +- } + prepare_installation(); + if (!$vars{'from_dvd'}) { + calc_depends(); +@@ -518,9 +512,6 @@ + create_uninstaller($vars{'TEXDIR'}, $vars{'TEXDIRW'}, + $vars{'TEXMFSYSVAR'}, $vars{'TEXMFSYSCONFIG'}); + } +- foreach $h (@::start_postinst_hook) { +- &$h(); +- } + do_postinst_stuff(); + # now we save every scheme that is fully covered by the stuff we have + # installed to the $localtlpdb +@@ -539,9 +530,6 @@ + } + } + $localtlpdb->save unless $vars{'from_dvd'}; +- foreach $h (@::end_install_hook) { +- &$h(); +- } + } + + sub dump_vars { +Index: tlpkg/TeXLive/TLMedia.pm +=================================================================== +--- tlpkg/TeXLive/TLMedia.pm (revision 11294) ++++ tlpkg/TeXLive/TLMedia.pm (working copy) +@@ -117,9 +117,6 @@ + # even if opt_doc is false + $real_opt_doc = 1; + } +- foreach my $h (@::install_packages_hook) { +- &$h("install: $pkg"); +- } + my $container; + my @installfiles; + my $location = $self->location; +Index: tlpkg/TeXLive/TLUtils.pm +=================================================================== +--- tlpkg/TeXLive/TLUtils.pm (revision 11294) ++++ tlpkg/TeXLive/TLUtils.pm (working copy) +@@ -806,7 +806,7 @@ + my $infostr = sprintf("Installing [%0${td}d/$totalnr]: $package",$n); + info("$infostr\n"); + foreach my $h (@::install_packages_hook) { +- &$h($infostr); ++ &$h($n,$totalnr); + } + my $real_opt_doc = $opt_doc; + # if we install a package from the Documentation class we +@@ -1523,7 +1523,12 @@ + =cut + + sub info { +- logit(\*STDOUT, 0, @_); ++ my $str = shift; ++ logit(\*STDOUT, 0, $str); ++ chomp($str); ++ for my $i (@::info_hook) { ++ &{$i}($str); ++ } + } + + =pod +Index: tlpkg/installer/install-menu-perltk.pl +=================================================================== +--- tlpkg/installer/install-menu-perltk.pl (revision 11294) ++++ tlpkg/installer/install-menu-perltk.pl (working copy) +@@ -100,29 +100,26 @@ + my $optsrcstate; + my $optdocstate; + +-push @::start_install_hook, +- sub { +- update_statusbar("Starting installation"); ++push @::info_hook, ++ sub { ++ update_status(join(" ",@_)); + $mainwindow->update; + }; +-push @::start_postinst_hook, +- sub { +- update_statusbar("Starting post-installation Jobs"); +- $mainwindow->update; +- }; +-push @::end_install_hook, +- sub { +- update_statusbar("Installation finished"); +- $mainwindow->update; +- }; ++push @::install_packages_hook, \&update_progressbar; ++push @::install_packages_hook, ++ sub { $mainwindow->update; $::sww->update; }; + +-push @::install_packages_hook, \&update_statusbar; +-push @::install_packages_hook, sub { $mainwindow->update; }; +- +-sub update_statusbar { +- my $p = shift; +- $::statusbar->configure(-text => "$p"); ++sub update_status { ++ my ($p) = @_; ++ $::progressw->insert("end", "$p\n"); ++ $::progressw->see("end"); + } ++sub update_progressbar { ++ my ($n,$total) = @_; ++ if (defined($n) && defined($total)) { ++ $::progress->value(int($n*100/$total)); ++ } ++} + + my %text = ( title => 'TeX Live 2008 Installation', + basicinfo => 'Basic Information', +@@ -369,7 +366,20 @@ + my $f3 = $fr->Frame; + $f3->Button( + -text => $text{'install'}, +- -command => sub { do_installation(); ++ -command => sub { ++ # create a progress bar window ++ $::sww = $mainwindow->Toplevel(-title => "installation process", ++ -width => 400); ++ $::sww->transient($mainwindow); ++ $::sww->grab(); ++ $::sww->Label(-text => "Installation process")->pack; ++ $::progressw = $::sww->ROText(-height => 16); ++ $::progressw->pack(-expand => 1, -fill => "both"); ++ $::progress = $::sww->ProgressBar( ++ -width => 20, -length => 400, -from => 0, -to => 100, -blocks => 50); ++ $::progress->value(0); ++ $::progress->pack(-expand => 1, -fill => "x"); ++ do_installation(); + $return = $MENU_ALREADYDONE; + my $t = $text{'finished'}; + if (!win32()) { +@@ -379,11 +389,13 @@ + $t =~ s/TEXDIR/$::vars{'TEXDIR'}/g; + $t =~ s/PLATFORM/$::vars{'this_platform'}/g; + $t =~ s/\\n/\n/g; +- my $sw = $mainwindow->DialogBox(-title => $text{'finbut'}, -buttons => [ $text{'finbut'} ]); +- $sw->add("Label", -text => $t)->pack; +- $sw->Show; +- #$fr->Dialog(-text => $t, -buttons => [ $text{'finbut'} ])->Show; +- $mainwindow->destroy }, ++ $::progressw->insert("end",$t); ++ $::progressw->see("end"); ++ my $f = $::sww->Frame; ++ $f->Button(-text => $text{'finbut'}, ++ -command => sub { $mainwindow->destroy; })->pack; ++ $f->pack; ++ }, + )->pack(-side => 'left'); + my $quitbutton = $f3->Button( + -text => $text{'quit'}, +@@ -392,9 +404,6 @@ + $mw->bind('<Escape>', [ $quitbutton, 'Invoke' ]); + $row++; + $f3->grid(-row => $row, -column => 1, -columnspan => 3); +- $::statusbar = $fr->Label(-text => $text{'status'}); +- $row++; +- $::statusbar->grid(-row => $row, -column => 1, -columnspan => 3); + menu_update_texts(); + $fr->gridColumnconfigure(2, -minsize => 300); + $mw->pack(-expand => 1, -fill => "both"); |