summaryrefslogtreecommitdiff
path: root/Master/tlpkg/installer
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-02-05 13:08:15 +0000
committerNorbert Preining <preining@logic.at>2009-02-05 13:08:15 +0000
commitc5ce0d3b21f385962cc9f6b4753d202e516e61c6 (patch)
treed157a25fa27a56beefdc45ffa18215277c9c6b12 /Master/tlpkg/installer
parente7399656eac0ee225d3de9e0704fa310d05c387f (diff)
more fixes for switching between installers, and GUI W32 fixes
git-svn-id: svn://tug.org/texlive/trunk@12094 c570f23f-e606-0410-a88d-b1316a301751
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,