summaryrefslogtreecommitdiff
path: root/Master/tlpkg/installer
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/installer')
-rw-r--r--Master/tlpkg/installer/install-menu-perltk.pl7
-rw-r--r--Master/tlpkg/installer/install-menu-wizard.pl30
2 files changed, 22 insertions, 15 deletions
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl
index fc7a35a5f8b..487b5d05b07 100644
--- a/Master/tlpkg/installer/install-menu-perltk.pl
+++ b/Master/tlpkg/installer/install-menu-perltk.pl
@@ -81,18 +81,21 @@ $::run_menu = \&run_menu_perltk;
sub setup_hooks_perltk {
+ @::info_hook = ();
push @::info_hook,
sub {
return unless defined $mainwindow;
update_status(join(" ",@_));
$mainwindow->update;
};
+ @::warn_hook = ();
push @::warn_hook,
sub {
return unless defined $mainwindow ;
update_status(join(" ",@_));
$mainwindow->update;
};
+ @::install_packages_hook = ();
push @::install_packages_hook, \&update_progressbar;
push @::install_packages_hook,
sub {
@@ -281,10 +284,6 @@ sub run_menu_perltk {
-text => $text{'wizard'},
-command => sub {
$mainwindow->destroy;
- @::warn_hook = ();
- @::debug_hook = ();
- @::info_hook = ();
- @::install_packages_hook = ();
require("installer/install-menu-wizard.pl");
setup_hooks_wizard();
$return = run_menu_wizard();
diff --git a/Master/tlpkg/installer/install-menu-wizard.pl b/Master/tlpkg/installer/install-menu-wizard.pl
index 86cbd66416c..cb19751bb6e 100644
--- a/Master/tlpkg/installer/install-menu-wizard.pl
+++ b/Master/tlpkg/installer/install-menu-wizard.pl
@@ -78,18 +78,21 @@ $::run_menu = \&run_menu_wizard;
# ####################################################################
sub setup_hooks_wizard {
+ @::info_hook = ();
push @::info_hook,
sub {
return unless defined($mw);
wizard_update_status(join(" ",@_));
$mw->update;
};
+ @::warn_hook = ();
push @::warn_hook,
sub {
return unless defined($mw);
wizard_update_status(join(" ",@_));
$mw->update;
};
+ @::install_packages_hook = ();
push @::install_packages_hook, \&wizard_update_progressbar;
push @::install_packages_hook, sub { $mw->update; };
}
@@ -184,11 +187,6 @@ sub ask_path {
my $cb = $fmain->Button(-text => $text{'advcustom'},
-relief => "ridge",
-command => sub { $mw->destroy;
- #undef &run_menu;
- @::warn_hook = ();
- @::debug_hook = ();
- @::info_hook = ();
- @::install_packages_hook = ();
require("installer/install-menu-perltk.pl");
setup_hooks_perltk();
$return = run_menu_perltk();
@@ -313,23 +311,33 @@ sub wizard_installation_window {
$_->destroy;
}
$counter->configure(-text => "4/4");
-# create a progress bar window
+ # create a progress bar window
# compute the height of the Text by the given font
$::progressw = $fmain->Scrolled("ROText", -scrollbars => "e",
-wrap => "word");
+ # we want to have the progressbar about 20px wide, so compute how
+ # many lines of the current font do fit into the remaining area
my $lines = int( ($INNERHEIGHT - 20) / $lineskip);
-
+ # it seems that on Windows the computation is not right, the
+ # progress bar overwrites the last line of the text widget
+ # remove one line here
+ $lines-- if win32();
$::progressw->configure(-height => $lines);
+ $::progressw->place(-x => 0, -y => 0, -width => $INNERWIDTH);
- my $pw = $INNERHEIGHT - ($lines * $lineskip) - 5;
+ # that is necessary otherwise the progressbar gets very strange dimensions
+ $fmain->update;
- $::progressw->place(-x => 0, -y => 0, -width => $INNERWIDTH);
-
my $percent_done = 0;
- $fmain->update;
+
+ # compute the remaining space in pixel for the progressbar
+ my $pw = $INNERHEIGHT - ($lines * $lineskip) - 5;
+ # make sure that the line we remove above for Windows is not re-added
+ # to the size of the progressbar. The 7 was found by trial and error
+ $pw -= ($lineskip + 7) if win32();
$::progress = $fmain->ProgressBar(-variable => \$percent_done,
-width => $pw, -length => $INNERWIDTH,
-from => 0, -to => 110, -blocks => 10,