summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2010-10-31 07:26:14 +0000
committerNorbert Preining <preining@logic.at>2010-10-31 07:26:14 +0000
commit0ea3633bbb0541335813e8d5d41387facb2e89a8 (patch)
treee4ec43a56fd84b91de1433aba63dbc3787cedbe7 /Master
parent0f9287a2467c805d9ddb249ef5b48bc131886644 (diff)
installer:
- (text mdoe) change scheme to scheme-custom if collections are changed - (gui) allow selecting scheme-custom in gui, and switch as above git-svn-id: svn://tug.org/texlive/trunk@20268 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/tlpkg/installer/install-menu-perltk.pl46
-rwxr-xr-xMaster/tlpkg/installer/install-menu-text.pl5
2 files changed, 46 insertions, 5 deletions
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl
index 7f75d0e2907..343eca2f52b 100644
--- a/Master/tlpkg/installer/install-menu-perltk.pl
+++ b/Master/tlpkg/installer/install-menu-perltk.pl
@@ -545,6 +545,7 @@ sub menu_select_scheme {
}
}
@schemes=sort @schemes;
+ push @schemes, "scheme-custom";
my $selected = $vars{'selected_scheme'};
$sw->Label(-text => __("Selected scheme"))->pack(-padx => "2m", -pady => "2m");
my $f2 = $sw->Frame;
@@ -553,14 +554,20 @@ sub menu_select_scheme {
my $nrfh = $#schemes / 2;
my $i = 0;
foreach my $scheme (@schemes) {
- my $tlpobj = $tlpdb->get_package("$scheme");
+ my $desc;
+ if ($scheme ne "scheme-custom") {
+ my $tlpobj = $tlpdb->get_package("$scheme");
+ $desc = $tlpobj->shortdesc;
+ } else {
+ $desc = "custom selection of collections";
+ }
my $b;
if ($i < $nrfh) {
$b = $f2l->Radiobutton(-variable => \$selected, -value => $scheme,
- -text => __($tlpobj->shortdesc))->pack(-anchor => 'w');
+ -text => __($desc))->pack(-anchor => 'w');
} else {
$b = $f2r->Radiobutton(-variable => \$selected, -value => $scheme,
- -text => __($tlpobj->shortdesc))->pack(-anchor => 'w');
+ -text => __($desc))->pack(-anchor => 'w');
}
if ($selected eq $scheme) {
$b->focus();
@@ -612,7 +619,21 @@ sub menu_select_standard_collections {
-command => sub { deselect_collections(\%lvars, @collections_std) })->pack(-side => 'right', -padx => "2m", -pady => "2m");
$fd->pack(-expand => 'x', -padx => "2m", -pady => "2m");
my $okbutton = $fd->Button(-text => __("Ok"),
- -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ -command => sub {
+ # we call the update only if something has changed
+ my $changed = 0;
+ for my $k (keys %lvars) {
+ if ($vars{$k} ne $lvars{$k}) {
+ $changed = 1;
+ last;
+ }
+ }
+ if ($changed) {
+ %vars = %lvars;
+ callback_select_collection();
+ }
+ $sw->destroy;
+ })->pack(-side => 'left', -padx => "2m", -pady => "2m");
my $cancelbutton = $fd->Button(-text => __("Cancel"),
-command => sub { $sw->destroy })->pack(-side => 'right', -padx => "2m", -pady => "2m");
$sw->bind('<Return>' => [ $okbutton, 'Invoke']);
@@ -675,7 +696,21 @@ sub menu_select_lang_collections {
-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 => __("Ok"),
- -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ -command => sub {
+ # we call the update only if something has changed
+ my $changed = 0;
+ for my $k (keys %lvars) {
+ if ($vars{$k} ne $lvars{$k}) {
+ $changed = 1;
+ last;
+ }
+ }
+ if ($changed) {
+ %vars = %lvars;
+ callback_select_collection();
+ }
+ $sw->destroy;
+ })->pack(-side => 'left', -padx => "2m", -pady => "2m");
my $cancelbutton = $f2->Button(-text => __("Cancel"),
-command => sub { $sw->destroy })->pack(-side => 'right', -padx => "2m", -pady => "2m");
$sw->bind('<Return>' => [ $okbutton, 'Invoke']);
@@ -861,6 +896,7 @@ sub callback_select_collection {
# special case for collection-texworks:
$editoryesno = ($vars{'collection-texworks'} ? __("Yes") : __("No"));
calc_depends();
+ select_scheme("scheme-custom");
update_numbers();
menu_update_texts();
}
diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl
index 924e31e38a7..bef9921b91e 100755
--- a/Master/tlpkg/installer/install-menu-text.pl
+++ b/Master/tlpkg/installer/install-menu-text.pl
@@ -345,6 +345,10 @@ sub collection_menu {
}
if (defined $command{"\u$answer"}) {
+ # if we play around with collections we also select custom-scheme
+ # but we do not switch back to originally afterwards, too complicated
+ # to be done
+ select_scheme("scheme-custom");
return $command{"\u$answer"}->();
} else {
return $command{'self'}->();
@@ -439,6 +443,7 @@ sub language_menu {
return $command{'self'}->();
}
if (defined $command{"\u$answer"}) {
+ select_scheme("scheme-custom");
return $command{"\u$answer"}->();
} else {
return $command{'self'}->();