summaryrefslogtreecommitdiff
path: root/Master/tlpkg/installer
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-02-02 06:18:19 +0000
committerNorbert Preining <preining@logic.at>2009-02-02 06:18:19 +0000
commit1665be4acaf4101aba8b29f2b5b994329b10eda3 (patch)
tree77b20d5241f1bafbd24f2bebb455dcc1df401269 /Master/tlpkg/installer
parenta3a0384b038f114a589c4750bfd2bb14ad858c7f (diff)
much advanced wizard
git-svn-id: svn://tug.org/texlive/trunk@12050 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/installer')
-rw-r--r--Master/tlpkg/installer/install-menu-perltk.pl4
-rw-r--r--Master/tlpkg/installer/install-menu-wizard.pl574
2 files changed, 486 insertions, 92 deletions
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl
index fdbfa388329..5786a299097 100644
--- a/Master/tlpkg/installer/install-menu-perltk.pl
+++ b/Master/tlpkg/installer/install-menu-perltk.pl
@@ -752,8 +752,8 @@ sub menu_select_symlink {
}
sub menu_select_binsystems {
- our $f2r;
- our $f2;
+ my $f2r;
+ my $f2;
my $sw = $mainwindow->Toplevel(-title => $labels{'binsys'});
$sw->transient($mainwindow);
$sw->grab();
diff --git a/Master/tlpkg/installer/install-menu-wizard.pl b/Master/tlpkg/installer/install-menu-wizard.pl
index 8f13884b5c7..0ca2f86e7a9 100644
--- a/Master/tlpkg/installer/install-menu-wizard.pl
+++ b/Master/tlpkg/installer/install-menu-wizard.pl
@@ -5,8 +5,33 @@
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
-# TODO: The problem with resizing comes from embedded \n in Labels!!!!!
-# That has to be done in some different way!
+# HOW TO ADD A SCREEN:
+# 1) create a sub called something like
+# ask_yourscreen
+# 2) in the beginning of the sub call
+# $current_screen = "yourscreen";
+# 3) set the screen_subs hash
+# $screen_subs{"yourscreen"} = \&ask_yourscreen;
+# 4) call at the end of the screen
+# unpack_buttons();
+# pack_buttons("cancel", "prev", "next"); # if you are in the middle
+# if you want to change something on the $prv, $nxt, $can buttons
+# please do it *between* the two calls, then call
+# pack_buttons("-no-config", "cancel", "prev", "next");
+# Normally the text of $nxt button is set according to the existence of
+# a following screen to either Next or Install, and in the latter case
+# the -command is changed to \&installation_window
+# Calling with "-no-config" as first argument does inhibit that.
+# 5) add you screen to the either the list
+# @quick_screens -> for the not customization path
+# @all_screens -> for the all screens path
+#
+# The list of screens can be set using the run_menu(@screens), and
+# install_tl does transfer a call to
+# install-tl -gui "wizard:welcome,path,scheme,integration,install"
+# to
+# run_menu("welcome", "path", "scheme", "integration", "install");
+# which in turn will only show these screens.
use strict;
$^W = 1;
@@ -19,12 +44,16 @@ $::menurevision = $1;
our %vars;
our $tlpdb;
our $texlive_release;
+our @collections_std;
+our @collections_lang;
+our @collections_lang_doc;
our $MENU_INSTALL = 0;
our $MENU_ABORT = 1;
our $MENU_QUIT = 2;
our $MENU_ALREADYDONE = 3;
+
my $return = $MENU_INSTALL;
my $custom = 0;
@@ -42,21 +71,21 @@ no utf8;
#
# LAYOUT of the wizard
#
-# /-----------------------------------------\
-# |
-# | /------------ Frame $ftitle -------\ |
-# | | Lab $tit | |
-# | \----------------------------------/ |
-# | |
-# | /------------ Frame $fmain --------\ |
-# | | | |
-# | \----------------------------------/ |
-# | |
-# | /------------ Frame $fbuttons -----\ |
+# /---------------------------------------------------\
+# | |
+# | /------------ Frame $ftitle -----------------\ |
+# | | Lab $tit | |
+# | \--------------------------------------------/ |
+# | |
+# | /------------ Frame $fmain ------------------\ |
+# | | | |
+# | \--------------------------------------------/ |
+# | |
+# | /------------ Frame $fbuttons ---------------\ |
# | | But $can <$spi> But $prv <$spii> But $nxt | |
-# | \----------------------------------/ |
-# | |
-# \-----------------------------------------/
+# | \--------------------------------------------/ |
+# | |
+# \---------------------------------------------------/
#
my $ftitle;
my $tit;
@@ -115,16 +144,58 @@ my $dest = $vars{'TEXDIR'};
my $mw;
+my $current_screen;
+my @quick_screens = qw/welcome path install/;
+my @all_screens = qw/welcome path systems scheme stdcoll langcoll install/;
+
+my @screens = @quick_screens;
+
+my %screen_subs;
+$screen_subs{"welcome"} = \&reset_start;
+$screen_subs{"path"} = \&ask_path;
+$screen_subs{"systems"} = \&ask_systems;
+$screen_subs{"scheme"} = \&ask_scheme;
+$screen_subs{"stdcoll"} = \&ask_stdcoll;
+$screen_subs{"langcoll"} = \&ask_langcoll;
+$screen_subs{"install"} = \&ask_go;
+
+sub next_screen {
+ # returns the name of the next screen
+ for my $i (0..$#screens) {
+ if ($screens[$i] eq $current_screen) {
+ return ( $i == $#screens ? undef : $screens[$i+1]);
+ }
+ }
+}
+sub prev_screen {
+ # returns the name of the prev screen
+ for my $i (0..$#screens) {
+ if ($screens[$i] eq $current_screen) {
+ return ($i ? $screens[$i-1] : undef);
+ }
+ }
+}
+sub run_screen {
+ my $what = shift;
+ debug("current screen = $current_screen\nwhat = $what\n");
+ if (defined($screen_subs{$what})) {
+ &{$screen_subs{$what}}();
+ } else {
+ tlwarn("Undefined screen: $what\n");
+ }
+}
######################################################################
push @::info_hook,
sub {
+ return unless defined($mw);
update_status(join(" ",@_));
$mw->update;
};
push @::warn_hook,
sub {
+ return unless defined($mw);
update_status(join(" ",@_));
$mw->update;
};
@@ -242,11 +313,27 @@ sub unpack_buttons {
}
sub pack_buttons {
+ my ($first) = @_;
+ my $skip_buttonconfig = 0;
+ if (defined($first) && ($first eq "-no-config")) {
+ $skip_buttonconfig = 1;
+ }
if (member("cancel", @_)) {
$can->pack(-side => "left");
$spi->pack(-side => "left");
}
if (member("next", @_)) {
+ # in case we pack the next button and there is no other screen we assume
+ # that this is the install screen
+ if (!$skip_buttonconfig) {
+ if (!defined(next_screen($current_screen))) {
+ $nxt->configure(-text => "Install",
+ -command => \&installation_window);
+ } else {
+ $nxt->configure(-text => "Next >",
+ -command => sub { run_screen(next_screen()); } );
+ }
+ }
$nxt->pack(-side => "right");
$spii->pack(-side => "right");
}
@@ -255,7 +342,25 @@ sub pack_buttons {
}
}
+
+
+################# WELCOME SCREEN ######################################
sub run_menu {
+ my @args = @_;
+
+ if (@args) {
+ my $allok = 1;
+ for my $s (@args) {
+ if (!defined($screen_subs{$s})) {
+ tlwarn("screen $s not defined, switching to normal wizard mode!");
+ $allok = 0;
+ last;
+ }
+ }
+ @screens = @args if $allok;
+ }
+ print "screens: @screens\n";
+
calc_depends();
$mw = Tk::MainWindow->new;
@@ -266,47 +371,127 @@ sub run_menu {
$fmain = $mw->Frame(); ## DEBUG: -relief => "ridge", -borderwidth => 2);
$fbuttons = $mw->Frame;
- $can = $fbuttons->Button(-width => 10, -relief => "ridge");
+ $can = $fbuttons->Button(-width => 10, -relief => "ridge", -text => "Cancel",
+ -command => sub { $return = $MENU_ABORT; $mw->destroy; });
$spi = $fbuttons->Label(-width => 6);
- $nxt = $fbuttons->Button(-width => 10, -relief => "ridge");
+ $nxt = $fbuttons->Button(-width => 10, -relief => "ridge", -text => "Next >",
+ -command => sub { run_screen(next_screen()); } );
$spii= $fbuttons->Label(-width => 2);
- $prv = $fbuttons->Button(-width => 10, -relief => "ridge");
+ $prv = $fbuttons->Button(-width => 10, -relief => "ridge", -text => "< Back",
+ -command => sub { run_screen(prev_screen()); } );
reset_start();
$ftitle->pack(-side => "top", -expand => 1, -fill => "both", -padx => "8m", -pady => "8m");
$fmain->pack(-side => "top", -expand => 1, -fill => "both", -padx => "8m", -pady => "8m");
- $fbuttons->pack(-side => "bottom", -expand => 1, -fill => "both", -padx => "8m", -pady => "8m");
+ $fbuttons->pack(-side => "bottom", -expand => 1, -fill => "x", -padx => "8m", -pady => "8m");
- $mw->configure(-width => 600, -height => 440);
- $mw->packPropagate(0);
Tk::MainLoop();
return($return);
}
+
sub reset_start {
+ $current_screen = "welcome";
for ($fmain->children) {
$_->destroy;
}
+ $fmain->update;
+ $mw->update;
my $inf = $fmain->Label(-text => "Welcome to the installation of TeX Live 2008\nhttp://tug.org/texlive\n\nThis wizard will guide you through the installation.");
$inf->pack(-padx => "3m", -pady => "3m");
- $fmain->configure(-height => $fmain->reqheight, -width => $fmain->reqwidth);
-
unpack_buttons();
- $can->configure(-text => "Cancel",
- -command => sub { $mw->destroy; do_cleanup(); exit(1); });
- $prv->configure(-text => "< Back", -command => \&run_menu);
- $nxt->configure(-text => "Next >", -command => \&ask_path);
pack_buttons("cancel", "next");
+
+ $fmain->update;
+ $mw->update;
}
+############### BINARY SYSTEM SCREEN ############################
+
+sub ask_systems {
+ $current_screen = "systems";
+ for ($fmain->children) {
+ $_->destroy;
+ }
+ $fmain->update;
+ $mw->update;
+
+ my $af = $fmain->Frame;
+ my $bf = $fmain->Frame;
+ my $lab = $af->Label(-text => "Binary system(s):");
+ $lab->pack(-side => "left");
+ my $val = $af->Label(-textvar => \$vars{'n_systems_selected'});
+ $val->pack(-side => "left", -padx => "3m");
+ my $but = $af->Button(-text => "Change", -command => \&change_systems, -relief => "ridge", -width => 10);
+ $but->pack(-side => "right");
+
+ my $inf = $bf->Label(-text => "Selects the list of binary systems to be installed.");
+ $inf->pack(-padx => "3m", -pady => "3m");
+
+ $af->pack(-expand => 1, -fill => "both");
+ $bf->pack(-expand => 1, -fill => "both");
+
+ unpack_buttons();
+ pack_buttons("cancel", "prev", "next");
+
+ $fmain->update;
+ $mw->update;
+}
+
+sub change_systems {
+ our $f2r;
+ our $f2;
+ my $sw = $mw->Toplevel(-title => $labels{'binsys'});
+ $sw->transient($mw);
+ $sw->grab();
+ my @diskarchs = ();
+ foreach my $key (keys %vars) {
+ if ($key=~/binary_(.*)/) {
+ push @diskarchs, $1;
+ }
+ }
+ $sw->Label(-text => $text{'selectsys'})->pack(-padx => "2m", -pady => "2m");
+ $f2 = $sw->Frame;
+ my $f2l = $f2->Frame;
+ foreach my $sys (sort @diskarchs) {
+ $f2l->Checkbutton(-variable => \$vars{"binary_$sys"}, -text => platform_desc($sys))->pack(-anchor => 'w');
+ }
+ $f2l->pack(-side => 'left');
+ $f2->pack(-padx => "2m", -pady => "2m");
+ my $f3 = $sw->Frame;
+ my $okbutton = $f3->Button(-text => $text{'ok'},
+ -command => sub { callback_select_systems() ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ my $cancelbutton = $f3->Button(-text => $text{'cancel'},
+ -command => sub { $sw->destroy })->pack(-side => 'right', -padx => "2m", -pady => "2m");
+ $f3->pack(-expand => 'x');
+ $sw->bind('<Return>' => [ $okbutton, 'Invoke']);
+ $sw->bind('<Escape>' => [ $cancelbutton, 'Invoke']);
+}
+
+sub callback_select_systems() {
+ if ($vars{"binary_win32"}) {
+ $vars{"collection-wintools"} = 1;
+ } else {
+ $vars{"collection-wintools"} = 0;
+ }
+ calc_depends();
+ update_numbers();
+}
+
+
+############## SCHEME SCREEN #####################################
+
sub ask_scheme {
+ $current_screen = "scheme";
for ($fmain->children) {
$_->destroy;
}
+ $fmain->update;
+ $mw->update;
my $af = $fmain->Frame;
my $bf = $fmain->Frame;
@@ -319,26 +504,75 @@ sub ask_scheme {
my $inf = $bf->Label(-text => "A scheme defines what will be installed.\nThe predefined scheme-full installs all of TeX Live (recommended).");
$inf->pack(-padx => "3m", -pady => "3m");
+
$af->pack(-expand => 1, -fill => "both");
$bf->pack(-expand => 1, -fill => "both");
unpack_buttons();
- $nxt->configure(-command => \&ask_go, -text => "Next >");
- $prv->configure(-text => "< Back", -command => \&ask_path);
pack_buttons("cancel", "prev", "next");
+
+ $fmain->update;
+ $mw->update;
+}
+
+sub change_scheme {
+ my $sw = $mw->Toplevel(-title => $labels{'scheme'});
+ $sw->transient($mw);
+ $sw->grab();
+ my @schemes;
+ foreach my $pkg ($tlpdb->list_packages) {
+ my $tlpobj = $tlpdb->{'tlps'}{$pkg};
+ if ($tlpobj->category eq "Scheme") {
+ push @schemes, $pkg;
+ $vars{"$pkg"}=($vars{'selected_scheme'} eq $pkg)? 1:0;
+ }
+ }
+ @schemes=sort @schemes;
+ my $selected = $vars{'selected_scheme'};
+ $sw->Label(-text => $text{'selectscheme'})->pack(-padx => "2m", -pady => "2m");
+ my $f2 = $sw->Frame;
+ my $f2l = $f2->Frame;
+ my $f2r = $f2->Frame;
+ my $nrfh = $#schemes / 2;
+ my $i = 0;
+ foreach my $scheme (@schemes) {
+ my $tlpobj = $tlpdb->get_package("$scheme");
+ if ($i < $nrfh) {
+ $f2l->Radiobutton(-variable => \$selected, -value => $scheme,
+ -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f2r->Radiobutton(-variable => \$selected, -value => $scheme,
+ -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ $f2l->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ $f2r->pack(-side => 'right', -padx => "2m", -pady => "2m");
+ $f2->pack;
+ my $f3 = $sw->Frame;
+ my $okbutton = $f3->Button(-text => $text{'ok'}, -relief => "ridge",
+ -command => sub { select_scheme($selected) ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ my $cancelbutton = $f3->Button(-text => $text{'cancel'}, -relief => "ridge",
+ -command => sub { $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ $f3->pack(-expand => 'x');
+ $sw->bind('<Return>' => [ $okbutton, 'Invoke']);
+ $sw->bind('<Escape>' => [ $cancelbutton, 'Invoke']);
}
+
+################## PATH SCREEN ################################
+
sub ask_path {
+ $current_screen = "path";
for ($fmain->children) {
$_->destroy;
}
+ $fmain->update;
+ $mw->update;
my $af = $fmain->Frame;
my $bf = $fmain->Frame;
my $cf = $fmain->Frame;
- $af->pack(-expand => 1, -fill => "both");
- $cf->pack(-expand => 1, -fill => "both");
- $bf->pack(-expand => 1, -fill => "both");
my $lab = $af->Label(-text => "Destination Folder:");
$lab->pack(-side => "left");
@@ -348,7 +582,15 @@ sub ask_path {
$but->pack(-side => "right");
my $pa = $cf->Checkbutton(-text => "Use letter-size paper instead of A4 by default", -variable => \$vars{"option_letter"});
- my $cb = $cf->Checkbutton(-text => "Further customization", -variable => \$custom);
+ my $cb = $cf->Checkbutton(-text => "Further customization",
+ -variable => \$custom,
+ -command => sub {
+ if ($custom) {
+ @screens = @all_screens;
+ } else {
+ @screens = @quick_screens;
+ }
+ });
$pa->pack(-anchor => "w");
$cb->pack(-anchor => "w");
@@ -356,24 +598,15 @@ sub ask_path {
my $inf = $bf->Label(-text => "Total size needed: $vars{'total_size'} MB\n\nThe destination folder will contain the installation.\nIt is recommended to keep the year as last component.");
$inf->pack(-padx => "3m", -pady => "3m");
- unpack_buttons();
- $nxt->configure(-command => sub { $custom ? ask_scheme() : ask_go() ; });
- $prv->configure(-text => "< Back", -command => \&ask_path);
- pack_buttons("cancel", "prev", "next");
-}
-
-sub ask_go {
- for ($fmain->children) {
- $_->destroy;
- }
+ $af->pack(-expand => 1, -fill => "both");
+ $cf->pack(-expand => 1, -fill => "both");
+ $bf->pack(-expand => 1, -fill => "both");
- my $inf = $fmain->Label(-justify => "left", -text => "We are ready to install TeX Live 2008.\nThe following settings will be used.\nIf you want to change something please go back,\notherwise press the \"Install\" button.\n\nDestination folder: $dest\nSelected scheme: $vars{'selected_scheme'}");
- $inf->pack(-padx => "3m");
-
unpack_buttons();
- $nxt->configure(-command => \&installation_window, -text => "Install");
- $prv->configure(-text => "< Back", -command => \&ask_path);
pack_buttons("cancel", "prev", "next");
+
+ $fmain->update;
+ $mw->update;
}
sub change_path {
@@ -423,6 +656,194 @@ sub callback_change_texdir {
$dest = $vars{'TEXDIR'};
}
+################## STD COLLECTIONS SCREEN ####################
+
+sub ask_stdcoll {
+ $current_screen = "stdcoll";
+ for ($fmain->children) {
+ $_->destroy;
+ }
+ $fmain->update;
+ $mw->update;
+
+ my $af = $fmain->Frame;
+ my $bf = $fmain->Frame;
+ my $lab = $af->Label(-text => "Standard collections:");
+ $lab->pack(-side => "left");
+ my $but = $af->Button(-text => "Change", -command => \&change_stdcoll, -relief => "ridge", -width => 10);
+ $but->pack(-side => "right");
+
+ my $inf = $bf->Label(-text => "Select the from all available collections.");
+ $inf->pack(-padx => "3m", -pady => "3m");
+
+ $af->pack(-expand => 1, -fill => "both");
+ $bf->pack(-expand => 1, -fill => "both");
+
+ unpack_buttons();
+ pack_buttons("cancel", "prev", "next");
+
+ $fmain->update;
+ $mw->update;
+}
+
+sub change_stdcoll {
+ my $sw = $mw->Toplevel(-title => $labels{'stdcoll'});
+ $sw->transient($mw);
+ $sw->grab();
+ my $fb = $sw->Frame;
+ my $fc = $sw->Frame;
+ my $fd = $sw->Frame;
+ my $f1 = $fb->Frame;
+ my $f2 = $fb->Frame;
+ my %lvars = %vars;
+ $sw->Label(-text => $text{'selectstdcol'})->pack(-padx => "2m", -pady => "2m");
+ my $halfcol = $#collections_std / 2;
+ my $i = 0;
+ foreach my $coll (sort @collections_std) {
+ my $tlpobj = $tlpdb->get_package("$coll");
+ if ($i < $halfcol) {
+ $f1->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f2->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ $f1->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ $f2->pack(-side => 'right', -padx => "2m", -pady => "2m");
+ $fb->pack(-padx => "2m", -pady => "2m");
+ $fd->pack();
+ $fd->Button(-text => $text{'selectall'},
+ -command => sub { select_collections(\%lvars, @collections_std) })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ $fd->Button(-text => $text{'selectnone'},
+ -command => sub { deselect_collections(\%lvars, @collections_std) })->pack(-side => 'right', -padx => "2m", -pady => "2m");
+ $fc->pack(-expand => 'x', -padx => "2m", -pady => "2m");
+ my $okbutton = $fc->Button(-text => $text{'ok'},
+ -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ my $cancelbutton = $fc->Button(-text => $text{'cancel'},
+ -command => sub { $sw->destroy })->pack(-side => 'right', -padx => "2m", -pady => "2m");
+ $sw->bind('<Return>' => [ $okbutton, 'Invoke']);
+ $sw->bind('<Escape>' => [ $cancelbutton, 'Invoke']);
+}
+
+sub callback_select_collection {
+ calc_depends();
+ update_numbers();
+}
+
+################# LANGUAGE COLLECTIONS #######################
+
+sub ask_langcoll {
+ $current_screen = "langcoll";
+ for ($fmain->children) {
+ $_->destroy;
+ }
+ $fmain->update;
+ $mw->update;
+
+ my $af = $fmain->Frame;
+ my $bf = $fmain->Frame;
+ my $lab = $af->Label(-text => "Language collections:");
+ $lab->pack(-side => "left");
+ my $but = $af->Button(-text => "Change", -command => \&change_langcoll, -relief => "ridge", -width => 10);
+ $but->pack(-side => "right");
+
+ my $inf = $bf->Label(-text => "Select language support and documentation.");
+ $inf->pack(-padx => "3m", -pady => "3m");
+
+ $af->pack(-expand => 1, -fill => "both");
+ $bf->pack(-expand => 1, -fill => "both");
+
+ unpack_buttons();
+ pack_buttons("cancel", "prev", "next");
+
+ $fmain->update;
+ $mw->update;
+}
+
+sub change_langcoll {
+ my $sw = $mw->Toplevel(-title => $labels{'langcoll'});
+ $sw->transient($mw);
+ $sw->grab();
+ my $f1 = $sw->Frame;
+ $f1->pack;
+ my $f1lang = $f1->Labelframe(-text => $text{'selectlang'});
+ my $f1doc = $f1->Labelframe(-text => $text{'selectdoc'});
+ $f1lang->pack(-side => 'left', -padx => "2m", -pady => "2m", -ipadx => "2m", -ipady => "2m");
+ $f1doc->pack(-side => 'right', -padx => "2m", -pady => "2m", -ipadx => "2m", -ipady => "2m", -expand => 1, -fill => "y");
+ my $f1langT = $f1lang->Frame; $f1langT->pack;
+ my $f1langL = $f1lang->Frame; $f1langL->pack;
+ my $f1langLa = $f1langL->Frame; $f1langLa->pack(-side => 'left');
+ my $f1langLb = $f1langL->Frame; $f1langLb->pack(-side => 'right');
+ my $langh = $#collections_lang / 2;
+ my $i = 0;
+ my %lvars = %vars;
+ foreach my $coll (sort @collections_lang) {
+ my $tlpobj = $tlpdb->get_package("$coll");
+ if ($i < $langh) {
+ $f1langLa->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f1langLb->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ my $f1langB = $f1lang->Frame;
+ $f1langB->pack(-expand => 'x');
+ $f1langB->Button(-text => $text{'selectall'},
+ -command => sub { select_collections(\%lvars, @collections_lang) })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ $f1langB->Button(-text => $text{'selectnone'},
+ -command => sub { deselect_collections(\%lvars, @collections_lang) })->pack(-side => 'right', -padx => "2m", -pady => "2m");
+
+ my $f1docT = $f1doc->Frame; $f1docT->pack;
+ my $f1docL = $f1doc->Frame; $f1docL->pack;
+ my $f1docLa = $f1docL->Frame; $f1docLa->pack(-side => 'left');
+ my $f1docLb = $f1docL->Frame; $f1docLb->pack(-side => 'right');
+ my $doch = $#collections_lang_doc / 2;
+ $i = 0;
+ foreach my $coll (sort @collections_lang_doc) {
+ my $tlpobj = $tlpdb->get_package("$coll");
+ if ($i < $doch) {
+ $f1docLa->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f1docLb->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ my $f1docB = $f1doc->Frame;
+ $f1docB->pack(-expand => 1, -side => "bottom");
+ $f1docB->Button(-text => $text{'selectall'},
+ -command => sub { select_collections(\%lvars, @collections_lang_doc) })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ $f1docB->Button(-text => $text{'selectnone'},
+ -command => sub { deselect_collections(\%lvars, @collections_lang_doc) })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ my $f2 = $sw->Frame; $f2->pack(-expand => 'x');
+ my $okbutton = $f2->Button(-text => $text{'ok'},
+ -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ my $cancelbutton = $f2->Button(-text => $text{'cancel'},
+ -command => sub { $sw->destroy })->pack(-side => 'right', -padx => "2m", -pady => "2m");
+ $sw->bind('<Return>' => [ $okbutton, 'Invoke']);
+ $sw->bind('<Escape>' => [ $cancelbutton, 'Invoke']);
+}
+
+
+################## INSTALL SCREEN #############################
+
+sub ask_go {
+ $current_screen = "install";
+ for ($fmain->children) {
+ $_->destroy;
+ }
+ $fmain->update;
+ $mw->update;
+
+ my $inf = $fmain->Label(-justify => "left", -text => "We are ready to install TeX Live 2008.\nThe following settings will be used.\nIf you want to change something please go back,\notherwise press the \"Install\" button.\n\nDestination folder: $dest\nSelected scheme: $vars{'selected_scheme'}");
+ $inf->pack(-padx => "3m");
+
+ unpack_buttons();
+ pack_buttons("cancel", "prev", "next");
+
+ $fmain->update;
+ $mw->update;
+}
+
sub installation_window {
# create a progress bar window
$::sww = $mw->Toplevel(-title => "installation process",
@@ -463,7 +884,7 @@ sub installation_window {
}
$can->packForget;
$prv->packForget;
- my $lab = $fmain->ROText(-height => 16);
+ my $lab = $fmain->ROText(-height => 16, -relief => "flat", -wrap => "word");
my $linechar = $lab->index("end");
$lab->markSet("finaltext", $linechar);
$lab->markGravity("finaltext", "left");
@@ -476,50 +897,23 @@ sub installation_window {
-command => sub { $mw->destroy; });
}
-sub change_scheme {
- my $sw = $mw->Toplevel(-title => $labels{'scheme'});
- $sw->transient($mw);
- $sw->grab();
- my @schemes;
- foreach my $pkg ($tlpdb->list_packages) {
- my $tlpobj = $tlpdb->{'tlps'}{$pkg};
- if ($tlpobj->category eq "Scheme") {
- push @schemes, $pkg;
- $vars{"$pkg"}=($vars{'selected_scheme'} eq $pkg)? 1:0;
- }
+################### HELPER FUNCTIONS ###########################
+
+sub select_collections {
+ my $varref = shift;
+ foreach (@_) {
+ $varref->{$_} = 1;
}
- @schemes=sort @schemes;
- my $selected = $vars{'selected_scheme'};
- $sw->Label(-text => $text{'selectscheme'})->pack(-padx => "2m", -pady => "2m");
- my $f2 = $sw->Frame;
- my $f2l = $f2->Frame;
- my $f2r = $f2->Frame;
- my $nrfh = $#schemes / 2;
- my $i = 0;
- foreach my $scheme (@schemes) {
- my $tlpobj = $tlpdb->get_package("$scheme");
- if ($i < $nrfh) {
- $f2l->Radiobutton(-variable => \$selected, -value => $scheme,
- -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
- } else {
- $f2r->Radiobutton(-variable => \$selected, -value => $scheme,
- -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
- }
- $i++;
+}
+
+sub deselect_collections {
+ my $varref = shift;
+ foreach (@_) {
+ $varref->{$_} = 0;
}
- $f2l->pack(-side => 'left', -padx => "2m", -pady => "2m");
- $f2r->pack(-side => 'right', -padx => "2m", -pady => "2m");
- $f2->pack;
- my $f3 = $sw->Frame;
- my $okbutton = $f3->Button(-text => $text{'ok'}, -relief => "ridge",
- -command => sub { my $s = shift; print "s=$selected\n"; select_scheme($selected) ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m");
- my $cancelbutton = $f3->Button(-text => $text{'cancel'}, -relief => "ridge",
- -command => sub { $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m");
- $f3->pack(-expand => 'x');
- $sw->bind('<Return>' => [ $okbutton, 'Invoke']);
- $sw->bind('<Escape>' => [ $cancelbutton, 'Invoke']);
}
+################### END OF MODULE RETURN 1 FOR REQUIRE ###########
1;