summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2010-07-13 03:01:27 +0000
committerNorbert Preining <preining@logic.at>2010-07-13 03:01:27 +0000
commitf29fbae89a6e75f54a02b1a98949768b0758511d (patch)
tree84a53585c9e4bebd90b5e9606e34ba7caf01765f
parent78b07969f47c3592e7494e75767dcd2671e6958c (diff)
remove tlmgr GUI v1 and support for tlmgr gui-old
git-svn-id: svn://tug.org/texlive/trunk@19414 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl50
-rw-r--r--Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl230
-rw-r--r--Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl113
-rw-r--r--Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl490
-rw-r--r--Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl46
-rw-r--r--Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.icobin48539 -> 0 bytes
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl551
7 files changed, 1 insertions, 1479 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index fa7defc2c46..2ec87b4899e 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -113,8 +113,6 @@ $::machinereadable = 0;
our %opts;
-my $old_gui = 0;
-
main() if $ismain;
sub main {
@@ -286,10 +284,6 @@ sub main {
my %suppargs;
%suppargs = %{$actionoptions{$action}}
if defined($actionoptions{$action});
- if ($action eq "gui-old") {
- %suppargs = %{$actionoptions{"gui"}}
- if defined($actionoptions{"gui"});
- }
my @notvalidargs;
for my $k (keys %opts) {
my @allargs = keys %suppargs;
@@ -461,9 +455,6 @@ sub execute_action {
finish(0);
} elsif ($action =~ m/^generate$/i) {
action_generate();
- } elsif ($action =~ m/^gui-old$/i) {
- $old_gui = 1;
- action_gui();
} elsif ($action =~ m/^gui$/i) {
action_gui();
} elsif ($action =~ m/^platform$/i) {
@@ -734,9 +725,6 @@ sub handle_execute_actions
# account
#
sub action_remove {
- if ($opts{"gui"}) {
- action_gui("remove");
- }
# we do the following:
# - (not implemented) order collections such that those depending on
# other collections are first removed, and then those which only
@@ -871,8 +859,6 @@ sub action_remove {
# [xdvi|...|context] paper [help|papersize|--list]
#
sub action_paper {
- action_gui("config") if $opts{"gui"};
-
init_local_db();
chomp(my $texmfsysconfig = `kpsewhich -var-value=TEXMFSYSCONFIG`);
$ENV{"TEXMFCONFIG"} = $texmfsysconfig;
@@ -920,9 +906,6 @@ sub action_paper {
# SHOW
#
sub action_show {
- if ($opts{"gui"}) {
- action_gui("config");
- }
init_local_db();
foreach my $pkg (@ARGV) {
my $tlpdb = $localtlpdb;
@@ -1818,9 +1801,6 @@ sub machine_line {
}
sub action_update {
- if ($opts{"gui"}) {
- action_gui("update");
- }
init_local_db(1);
$opts{"no-depends"} = 1 if $opts{"no-depends-at-all"};
@@ -2706,9 +2686,6 @@ sub action_update {
# anymore! That has all to be done by hand.
#
sub action_install {
- if ($opts{"gui"}) {
- action_gui("install");
- }
init_local_db(1);
return if !check_on_writable();
# initialize the TLMedia from $location
@@ -2884,9 +2861,6 @@ sub action_list {
# OPTION
#
sub action_option {
- if ($opts{"gui"}) {
- action_gui("config");
- }
my $what = shift @ARGV;
$what = "show" unless defined($what);
init_local_db();
@@ -3064,9 +3038,6 @@ sub action_platform {
warn("action `platform' not supported on Windows\n");
return();
}
- if ($opts{"gui"}) {
- action_gui("platform");
- }
my $what = shift @ARGV;
init_local_db(1);
info("platform: dry run, no changes will be made\n") if $opts{"dry-run"};
@@ -3317,10 +3288,6 @@ sub action_generate {
# GUI
#
sub action_gui {
- my ($guiscreen) = @_;
- # yes, two times to make perl warnings shut up ...
- $::guiscreen = $guiscreen;
- $::guiscreen = $guiscreen;
eval { require Tk; };
if ($@) {
# that didn't work out, give some usefull error message and stop
@@ -3368,12 +3335,7 @@ Error message from creating MainWindow:
# another GUI instance (or better trying to ...)
$opts{"gui"} = 0;
- if ($old_gui) {
- unshift (@INC, "$Master/texmf/scripts/texlive/tlmgrgui");
- require("tlmgrgui.pl");
- } else {
- require("tlmgrgui.pl");
- }
+ require("tlmgrgui.pl");
# should not be reached
exit(1);
}
@@ -3386,9 +3348,6 @@ sub action_uninstall {
printf STDERR "Please use \"Add/Remove Programs\" from the Control Panel to removing TeX Live!\n";
finish(1);
}
- if ($opts{"gui"}) {
- action_gui("uninstall");
- }
return if !check_on_writable();
my $force = defined($opts{"force"}) ? $opts{"force"} : 0;
if (!$force) {
@@ -5808,13 +5767,6 @@ action needs the option C<backupdir> set (see Options -> General).
Finally, the status area at the bottom of the window gives additional
information what is going on.
-=head2 the old (v1) GUI
-
-For the time being the first GUI written for C<tlmgr> is still included
-and available via <tlmgr gui-old>. Note that there is no development
-of this GUI anymore, so at some point it might stop to actually work,
-or even get removed from the packages.
-
=head1 MACHINE-READABLE OUTPUT
Given the C<--machine-readable> option, C<tlmgr> writes to stdout in the
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl b/Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl
deleted file mode 100644
index ed5b2ead841..00000000000
--- a/Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl
+++ /dev/null
@@ -1,230 +0,0 @@
-# guinb1.pl
-# $Id$
-#
-# Copyright 2008 Tomasz Luczak
-# Copyright 2008, 2009 Norbert Preining
-#
-# GUI for tlmgr
-#
-
-
-sub validate_search_input {
- my ($w, $iw, $str, @l) = @_;
- my $found = -1;
- for (my $i = 0; $i < @l; $i++) {
- my $pkg = $l[$i];
- $pkg =~ s/^\s*(\(i\) )?//;
- if ($pkg =~ m;$str;i) {
- $found = $i;
- last;
- }
- }
- if ($found >= 0) {
- $w->selectionClear(0,"end");
- $w->yview($found);
- $w->selectionSet($found);
- update_info_window($w, $iw, @l);
- } else {
- $w->selectionClear(0,"end");
- }
- return(1);
-}
-
-sub find_next_search_match {
- my ($w, $e, $iw, @l) = @_;
- # first get the current selection
- my @cursel = $w->curselection;
- if (!@cursel) {
- push @cursel, 0;
- }
- my $str = $e->get;
- my $found = -1;
- for (my $i = $cursel[0] + 1; $i < @l; $i++) {
- my $pkg = $l[$i];
- $pkg =~ s/^\s*(\(i\) )?//;
- if ($pkg =~ m;$str;i) {
- $found = $i;
- last;
- }
- }
- if ($found >= 0) {
- $w->selectionClear(0,"end");
- $w->yview($found);
- $w->selectionSet($found);
- update_info_window($w, $iw, @l);
- }
-}
-
-sub update_info_window {
- my ($lb, $iw, @l) = @_;
- my @selind = $lb->curselection;
- return if (!@selind);
- my $pkgname = $l[$selind[0]];
- $pkgname =~ s/^\s*(\(i\) )?//;
- my $tlp;
- my $longdesc;
- my $shortdesc;
- if (defined($tlmediatlpdb)) {
- $tlp = $tlmediatlpdb->get_package($pkgname);
- } else {
- $tlp = $localtlpdb->get_package($pkgname);
- }
- if (defined($tlp)) {
- $longdesc = $tlp->longdesc;
- $shortdesc = $tlp->shortdesc;
- }
- my $text = "";
- if ($shortdesc) {
- $text .= $shortdesc;
- $text .= "\n\n";
- }
- if ($longdesc) {
- my @words = split /\s+/, $longdesc;
- my $i = 0;
- while (@words) {
- my $w = shift @words;
- my $l = length($w);
- if ($i + $l + 1 < 45) {
- $text .= " $w";
- $i += $l + 1;
- } else {
- $text .= "\n$w";
- $i = $l;
- }
- }
- }
- if ($text eq "") {
- $text = __("(no description available)");
- }
- $iw->delete("0.0", "end");
- $iw->insert("0.0", "$text");
- $iw->see("0.0");
-}
-
-sub do_listframe {
- my ($f, $title, $listref, $buttonsref, $with_force, $with_deps) = @_;
-
- # row 1, column 1-2
- my $f_title = $f->Frame(-relief => 'ridge', -borderwidth => 2);
- $f_title->Label( -text => $title,
- -foreground => "blue",
- -font => "helvetica 10 bold"
- )->pack(-side => "top");
- $f_title->Label( -text => __("Use Ctrl or Shift or drag to select more")
- )->pack(-side => "top");
- $f_title->grid( -row => 1, -column => 1, -columnspan => 2,
- -padx => "2m", -pady => "2m", -sticky => "we");
-
- # column 1, row 2-3
-
- my $f_listf = $f->Labelframe(-text => __("Select packages"));
- $f_listf->grid( -row => 2, -column => 1, -rowspan => 2,
- -sticky => "nswe", -padx => "2m", -pady => "1m");
-
- my $f_listf_lb;
- my $f_textf_text;
- my $f_listf_searchf = $f_listf->Frame;
- $f_listf_searchf->pack(-pady => "1m");
- my $f_listf_searchf_label =
- $f_listf_searchf->Label(-text => __("Search"))->pack( -anchor => "w",
- -side => "left",
- -padx => "1m",
- -pady => "1m");
- my $f_listf_searchf_entry = $f_listf_searchf->Entry( -validate => "key",
- -validatecommand =>
- sub { validate_search_input($f_listf_lb,
- $f_textf_text,
- $_[0],
- @$listref); });
- my $f_listf_searchf_button = $f_listf_searchf->Button(-text => __("Next"),
- -command => sub { find_next_search_match($f_listf_lb,
- $f_listf_searchf_entry,
- $f_textf_text,
- @$listref); });
- $f_listf_searchf_entry->pack(
- -anchor => "w", -side => "left", -padx => "1m", -pady => "1m");
- $f_listf_searchf_button->pack(
- -anchor => "w", -side => "left", -padx => "1m", -pady => "1m");
-
- $f_listf_lb = $f_listf->Scrolled("Listbox",
- -listvariable => $listref,
- -selectmode => "extended",
- -scrollbars => "ose"
- );
- $f_listf_lb->bind('<<ListboxSelect>>',
- sub { update_info_window ($f_listf_lb, $f_textf_text, @$listref); });
- $f_listf_lb->pack(-fill => "both", -expand => 1);
-
- # row 2 column 2
- my $f_textf = $f->Labelframe(-text => __("Information on the selected item"));
- $f_textf->grid(-row => 2, -column => 2, -sticky => "nswe",
- -padx => "2m", -pady => "1m");
-
- # we would like to have -scrollbars => "oe" here so that it does disappear
- # if the text is not too long, but this doesn't work since Windows Perl/Tk
- # is broken and does not update the scrollbar properly, you have to first
- # select something while scrolling, then finally it works. Ok, so show
- # it all the time ...
- $f_textf_text = $f_textf->Scrolled("ROText",
- -scrollbars => "e",
- -width => 45, -wrap => "word");
-
- $f_textf_text->pack(-expand => 1, -fill => "both");
-
- # row 3 column 2
- my $f_buttonf = $f->Labelframe();
- $f_buttonf->grid(-row => 3, -column => 2,
- -padx => "2m", -pady => "2m", -sticky => "we");
-
- my $f_buttonf_optionsf = $f_buttonf->Frame();
- if ($with_force) {
- my $foo = $f_buttonf_optionsf->Checkbutton(-text => __("Force"),
- -variable => \$opts{"force"}
- )->pack(-side => 'left');
- $balloon->attach($foo,-balloonmsg => __("Force the removal of a package even if it is referenced in a collection."));
- }
- if ($with_deps) {
- my $foo = $f_buttonf_optionsf->Checkbutton(-text => __("without depends"),
- -variable => \$opts{"no-depends"}
- )->pack(-side => 'left');
- $balloon->attach($foo,-balloonmsg => __("For collections: install or remove will not install/remove the dependencies"));
- }
- $f_buttonf_optionsf->pack;
- foreach my $k (keys %$buttonsref) {
- $f_buttonf->Button(-text => $buttonsref->{$k}{'-text'},
- -state => $::action_button_state,
- -command => sub { my @l = $f_listf_lb->curselection;
- my @pl;
- foreach my $i (@l) {
- my @all = @$listref;
- my $foo = $all[$i];
- $foo =~ s/^\s*(\(i\) )?//;
- push @pl, $foo;
- }
- my $coderef = $buttonsref->{$k}{'-command'};
- my @allargs;
- if (defined($buttonsref->{$k}{'-args'})) {
- push @allargs, @{$buttonsref->{$k}{'-args'}};
- }
- push @allargs, @pl;
- &$coderef(@allargs);
- $f_listf_lb->configure(-listvariable => $listref);
- })->pack( -expand => 0, -fill => "both",
- -padx => "2m", -pady => "2m");
- }
- $f->gridRowconfigure(1,-weight => 0);
- $f->gridRowconfigure(2,-weight => 1);
- $f->gridRowconfigure(3,-weight => 0);
- $f->gridColumnconfigure(1,-weight => 1);
- $f->gridColumnconfigure(2,-weight => 1);
- return($f_textf_text, $f_listf_lb);
-}
-
-1;
-
-### Local Variables:
-### perl-indent-level: 2
-### tab-width: 2
-### indent-tabs-mode: nil
-### End:
-# vim:set tabstop=2 expandtab: #
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl
deleted file mode 100644
index 07dcb5b395a..00000000000
--- a/Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl
+++ /dev/null
@@ -1,113 +0,0 @@
-# gui-arch.pl
-# $Id$
-#
-# Copyright 2008 Tomasz Luczak
-# Copyright 2008, 2009 Norbert Preining
-#
-# GUI for tlmgr
-#
-
-
-our $back_arch = $back->add("arch",-label => __("Architectures"));
-$screens{"arch"} = $back_arch;
-
-# this will be loaded only on unix systems!
-#
-
-our @archsavail;
-our @archsinstalled;
-our %archs;
-our $currentarch;
-
-our %archsbuttons;
-our $arch_frame;
-our $subframe;
-
-push @update_function_list, \&init_archs;
-
-$back_arch->Label(-text => __("Select architectures to support"))->pack(-padx => "5m", -pady => "5m");
-
-
-sub init_archs {
- if (!defined($tlmediatlpdb)) {
- @archsavailable = ();
- } else {
- @archsavail = $tlmediatlpdb->available_architectures;
- }
- $currentarch = $localtlmedia->platform();
- @archsinstalled = $localtlpdb->available_architectures;
- foreach my $a (@archsavail) {
- $archs{$a} = 0;
- if (grep(/^$a$/,@archsinstalled)) {
- $archs{$a} = 1;
- }
- }
- foreach my $a (keys %archsbuttons) {
- $archsbuttons{$a}->destroy;
- }
- $arch_frame->destroy if defined($arch_frame);
- $subframe->destroy if defined($subframe);
- $subframe = $back_arch->Frame;
- foreach my $a (@archsavail) {
- $archsbuttons{$a} =
- $subframe->Checkbutton(-command => sub { check_on_removal($a); },
- -variable => \$archs{$a},
- -text => platform_desc($a)
- )->pack(-anchor => 'w');
- }
- $subframe->pack;
- $arch_frame = $back_arch->Frame;
- $arch_frame->pack(-padx => "10m", -pady => "5m");
- $arch_frame->Button(-text => __("Apply changes"),
- -state => $::action_button_state,
- -command => sub { apply_changes(); })->pack(-side => 'left', -padx => "3m");
- $arch_frame->Button(-text => __("Reset changes"),
- -state => $::action_button_state,
- -command => sub { init_archs(); })->pack(-side => 'left', -padx => "3m");
-}
-
-sub check_on_removal {
- my $a = shift;
- if (!$archs{$a} && $a eq $currentarch) {
- # removal not supported
- $archs{$a} = 1;
- $arch_frame->Dialog(-title => "info",
- -text => __("Removals of the main architecture not possible!"),
- -buttons => [ __("Ok") ])->Show;
- }
-}
-
-
-sub apply_changes {
- my @todo_add;
- my @todo_remove;
- foreach my $a (@archsavail) {
- if (!$archs{$a} && grep(/^$a$/,@archsinstalled)) {
- push @todo_remove, $a;
- next;
- }
- if ($archs{$a} && !grep(/^$a$/,@archsinstalled)) {
- push @todo_add, $a;
- next;
- }
- }
- if (@todo_add) {
- execute_action_gui ( "arch", "add", @todo_add );
- }
- if (@todo_remove) {
- execute_action_gui ( "arch", "remove", @todo_remove );
- }
- if (@todo_add || @todo_remove) {
- reinit_local_tlpdb();
- init_archs();
- }
-}
-
-1;
-
-### Local Variables:
-### perl-indent-level: 2
-### tab-width: 2
-### indent-tabs-mode: nil
-### End:
-# vim:set tabstop=2 expandtab: #
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl
deleted file mode 100644
index baccd0ecc81..00000000000
--- a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl
+++ /dev/null
@@ -1,490 +0,0 @@
-# gui-config2.pl
-# $Id$
-#
-# Copyright 2008 Tomasz Luczak
-# Copyright 2008, 2009 Norbert Preining
-#
-# GUI for tlmgr
-#
-
-our $back_config = $back->add("config",-label => __("Configuration"), -justify => "left");
-$screens{"config"} = $back_config;
-
-my @fileassocdesc;
-$fileassocdesc[0] = __("None");
-$fileassocdesc[1] = __("Only new");
-$fileassocdesc[2] = __("All");
-
-my %defaults;
-for my $key (keys %TeXLive::TLConfig::TLPDBOptions) {
- if ($TeXLive::TLConfig::TLPDBOptions{$key}->[0] eq "b") {
- $defaults{$key} = ($localtlpdb->option($key) ? __("Yes") : __("No"));
- } else {
- if ($key eq "file_assocs") {
- $defaults{$key} = $fileassocdesc[$localtlpdb->option($key)];
- } else {
- $defaults{$key} = $localtlpdb->option($key);
- }
- }
-}
-
-# this will be loaded only on unix systems!
-#
-my @config_set_l;
-my @config_set_m;
-my @config_set_r;
-
-my $back_config_set = $back_config->Labelframe(-text => __("Default settings"));
-$back_config_set->pack(-fill => "both", -padx => "2m", -pady => "2m");
-
-push @config_set_l,
- $back_config_set->Label(-text => __("Default package repository"), -anchor => "w");
-push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{"location"});
-push @config_set_r,
- $back_config_set->Button(-text => __("Change"),
- -state => $::action_button_state,
- -command => sub { menu_default_location(); });
-
-
-push @config_set_l,
- $back_config_set->Label(-text => __("Create formats on installation"), -anchor => "w");
-push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{"create_formats"});
-push @config_set_r,
- $back_config_set->Button(-text => __("Toggle"),
- -state => $::action_button_state,
- -command => sub { toggle_setting("create_formats"); });
-
-push @config_set_l,
- $back_config_set->Label(-text => __("Install macro/font sources"), -anchor => "w");
-push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{"install_srcfiles"});
-push @config_set_r,
- $back_config_set->Button(-text => __("Toggle"),
- -state => $::action_button_state,
- -command => sub { toggle_setting("install_srcfiles"); });
-
-push @config_set_l,
- $back_config_set->Label(-text => __("Install macro/font docs"), -anchor => "w");
-push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{"install_docfiles"});
-push @config_set_r,
- $back_config_set->Button(-text => __("Toggle"),
- -state => $::action_button_state,
- -command => sub { toggle_setting("install_docfiles"); });
-
-push @config_set_l,
- $back_config_set->Label(-text => __("Default backup directory"), -anchor => "w");
-push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{"backupdir"});
-push @config_set_r,
- $back_config_set->Button(-text => __("Change"),
- -state => $::action_button_state,
- -command => sub {
- my $dir = $back_config->chooseDirectory();
- if (defined($dir) && ($default_backupdir ne $dir)) {
- # see warning concerning UTF8 or other encoded dir names!!
- $localtlpdb->option("backupdir", $dir);
- $default_backupdir = $dir;
- $localtlpdb->save;
- }
- });
-
-push @config_set_l,
- $back_config_set->Label(-text => __("Auto backup setting"), -anchor => "w");
-push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{"autobackup"});
-push @config_set_r,
- $back_config_set->Button(-text => __("Change"),
- -state => $::action_button_state,
- -command => sub { select_autobackup($p); }, -anchor => "w");
-
-if (!win32()) {
- push @config_set_l,
- $back_config_set->Label(-text => __("Link destination for programs"), -anchor => "w");
- push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{"sys_bin"});
- push @config_set_r,
- $back_config_set->Button(-text => __("Change"),
- -state => $::action_button_state,
- -command => sub {
- my $dir = $back_config->chooseDirectory();
- if (defined($dir) && ($defaults{"sys_bin"} ne $dir)) {
- # see warning concerning UTF8 or other encoded dir names!!
- $localtlpdb->option("sys_bin", $dir);
- $defaults{"sys_bin"} = $dir;
- $localtlpdb->save;
- }
- });
-
- push @config_set_l,
- $back_config_set->Label(-text => __("Link destination for info docs"), -anchor => "w");
- push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{"sys_info"});
- push @config_set_r,
- $back_config_set->Button(-text => __("Change"),
- -state => $::action_button_state,
- -command => sub {
- my $dir = $back_config->chooseDirectory();
- if (defined($dir) && ($defaults{"sys_info"} ne $dir)) {
- # see warning concerning UTF8 or other encoded dir names!!
- $localtlpdb->option("sys_info", $dir);
- $defaults{"sys_info"} = $dir;
- $localtlpdb->save;
- }
- });
-
- push @config_set_l,
- $back_config_set->Label(-text => __("Link destination for man pages"), -anchor => "w");
- push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{"sys_man"});
- push @config_set_r,
- $back_config_set->Button(-text => __("Change"),
- -state => $::action_button_state,
- -command => sub {
- my $dir = $back_config->chooseDirectory();
- if (defined($dir) && ($defaults{"sys_man"} ne $dir)) {
- # see warning concerning UTF8 or other encoded dir names!!
- $localtlpdb->option("sys_man", $dir);
- $defaults{"sys_man"} = $dir;
- $localtlpdb->save;
- }
- });
-}
-
-if (win32()) {
- push @config_set_l,
- $back_config_set->Label(-text => __("Create shortcuts in menu and on desktop"), -anchor => "w");
- push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{"desktop_integration"});
- push @config_set_r,
- $back_config_set->Button(-text => __("Toggle"),
- -state => $::action_button_state,
- -command => sub { toggle_setting("desktop_integration"); });
-
- if (admin()) {
- push @config_set_l,
- $back_config_set->Label(-text => __("Install for all users"), -anchor => "w");
- push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{"w32_multi_user"});
- push @config_set_r,
- $back_config_set->Button(-text => __("Toggle"),
- -state => $::action_button_state,
- -command => sub { toggle_setting("w32_multi_user"); });
- }
-
- push @config_set_l,
- $back_config_set->Label(-text => __("Change file associations"), -anchor => "w");
- push @config_set_m,
- $back_config_set->Label(-textvariable => \$defaults{'file_assocs'});
- push @config_set_r,
- $back_config_set->Button(-text => __("Change"),
- -state => $::action_button_state,
- -command => sub { select_file_assocs($p); }, -anchor => "w");
-
-}
-
-for my $i (0..$#config_set_l) {
- $config_set_l[$i]->grid( $config_set_m[$i], $config_set_r[$i],
- -padx => "1m", -pady => "1m", -sticky => "nwe");
-}
-
-#############
-
-my $lower = $back_config->Frame;
-$lower->pack(-fill => "both");
-
-my $back_config_pap = $lower->Labelframe(-text => __("Paper settings"));
-
-
-my $back_config_pap_l1 = $back_config_pap->Label(-text => __("Default paper for all"), -anchor => "w");
-my $back_config_pap_m1 = $back_config_pap->Button(-text => "A4",
- -state => $::action_button_state,
- -command => sub { change_paper("all", "a4"); });
-my $back_config_pap_r1 = $back_config_pap->Button(-text => "letter",
- -state => $::action_button_state,
- -command => sub { change_paper("all", "letter"); });
-
-$back_config_pap_l1->grid( $back_config_pap_m1, $back_config_pap_r1,
- -padx => "2m", -pady => "2m", -sticky => "nswe");
-
-my %papers;
-my %defaultpaper;
-
-sub init_paper_xdvi {
- if (!win32()) {
- @{$papers{"xdvi"}} = TeXLive::TLPaper::get_paper_list("xdvi");
- $defaultpaper{"xdvi"} = ${$papers{"xdvi"}}[0];
- }
-}
-sub init_paper_pdftex {
- @{$papers{"pdftex"}} = TeXLive::TLPaper::get_paper_list("pdftex");
- $defaultpaper{"pdftex"} = ${$papers{"pdftex"}}[0];
-}
-sub init_paper_dvips {
- @{$papers{"dvips"}} = TeXLive::TLPaper::get_paper_list("dvips");
- $defaultpaper{"dvips"} = ${$papers{"dvips"}}[0];
-}
-sub init_paper_dvipdfm {
- @{$papers{"dvipdfm"}} = TeXLive::TLPaper::get_paper_list("dvipdfm");
- $defaultpaper{"dvipdfm"} = ${$papers{"dvipdfm"}}[0];
-}
-sub init_paper_context {
- if (defined($localtlpdb->get_package("bin-context"))) {
- @{$papers{"context"}} = TeXLive::TLPaper::get_paper_list("context");
- $defaultpaper{"context"} = ${$papers{"context"}}[0];
- }
-}
-sub init_paper_dvipdfmx {
- @{$papers{"dvipdfmx"}} = TeXLive::TLPaper::get_paper_list("dvipdfmx");
- $defaultpaper{"dvipdfmx"} = ${$papers{"dvipdfmx"}}[0];
-}
-
-my %init_paper_subs;
-$init_paper_subs{"xdvi"} = \&init_paper_xdvi;
-$init_paper_subs{"pdftex"} = \&init_paper_pdftex;
-$init_paper_subs{"dvips"} = \&init_paper_dvips;
-$init_paper_subs{"context"} = \&init_paper_context;
-$init_paper_subs{"dvipdfm"} = \&init_paper_dvipdfm;
-$init_paper_subs{"dvipdfmx"} = \&init_paper_dvipdfmx;
-
-sub init_all_papers {
- for my $p (keys %init_paper_subs) {
- &{$init_paper_subs{$p}}();
- }
-}
-
-init_all_papers();
-
-my (%l,%m,%r);
-foreach my $p (sort keys %papers) {
- if (($p eq "context") && !defined($localtlpdb->get_package("bin-context"))) {
- next;
- }
- $l{$p} = $back_config_pap->Label(-text => __("Default paper for") . " $p", -anchor => "w");
- $m{$p} = $back_config_pap->Label(-textvariable => \$defaultpaper{$p}, -anchor => "w");
- $r{$p} = $back_config_pap->Button(-text => __("Change"),
- -state => $::action_button_state,
- -command => sub { select_paper($p); }, -anchor => "w");
- $l{$p}->grid( $m{$p}, $r{$p},
- -padx => "2m", -pady => "2m", -sticky => "nsw");
-}
-
-$back_config_pap->pack(-side => 'left', -fill => "both", -padx => "2m", -pady => "2m");
-
-
-my $back_config_act = $lower->Labelframe(-text => __("Actions"));
-
-
-$back_config_act->Button(-text => __("Re-initialize file database"),
- -state => $::action_button_state,
- -command => sub {
- $mw->Busy(-recurse => 1);
- info("Running mktexlsr, this may take some time ...\n");
- info(`mktexlsr 2>&1`);
- $mw->Unbusy;
- })->pack(-expand => 1, -fill => "x",
- -padx => "2m", -pady => "2m");
-$back_config_act->Button(-text => __("Re-create all formats"),
- -state => $::action_button_state,
- -command => sub {
- $mw->Busy(-recurse => 1);
- info("Running fmtutil-sys --all, this may take some time ...\n");
- info(`fmtutil-sys --all 2>&1`);
- $mw->Unbusy;
- })->pack(-expand => 1, -fill => "x",
- -padx => "2m", -pady => "2m");
-$back_config_act->Button(-text => __("Update font map database"),
- -state => $::action_button_state,
- -command => sub {
- $mw->Busy(-recurse => 1);
- info("Running updmap-sys, this may take some time ...\n");
- info(`updmap-sys 2>&1`);
- $mw->Unbusy;
- })->pack(-expand => 1, -fill => "x",
- -padx => "2m", -pady => "2m");
-
-if (!win32()) {
- $back_config_act->Button(-text => __("Update symbolic links"),
- -state => $::action_button_state,
- -command => sub {
- $mw->Busy(-recurse => 1);
- info("Updating symlinks ...\n");
- execute_action_gui("path", "add");
- $mw->Unbusy;
- })->pack(-expand => 1, -fill => "x",
- -padx => "2m", -pady => "2m");
-
- $back_config_act->Button(-text => __("Remove symbolic links"),
- -state => $::action_button_state,
- -command => sub {
- $mw->Busy(-recurse => 1);
- info("Removing symlinks ...\n");
- execute_action_gui("path", "remove");
- $mw->Unbusy;
- })->pack(-expand => 1, -fill => "x",
- -padx => "2m", -pady => "2m");
-}
-
-$back_config_act->pack(-side => 'right', -fill => "both", -padx => "2m", -pady => "2m", -expand => 1, -ipadx => "2m", -ipady => "2m");
-
-
-
-sub menu_default_location {
- my $val = $default_location;
- my $sw = $mw->Toplevel(-title => __("Change default package repository"));
- $sw->transient($mw);
- $sw->grab();
- $sw->Label(-text => __("New default package repository"))->pack(-padx => "2m", -pady => "2m");
-
- my $f1 = $sw->Frame;
- my $entry = $f1->Entry(-text => $val, -width => 50);
- $entry->pack(-side => "left",-padx => "2m", -pady => "2m");
-
- my $f2 = $sw->Frame;
- $f2->Button(-text => __("Choose Directory"),
- -command => sub {
- my $var = $sw->chooseDirectory;
- if (defined($var)) {
- $entry->delete(0,"end");
- $entry->insert(0,$var);
- }
- })->pack(-side => "left",-padx => "2m", -pady => "2m");
- $f2->Button(-text => __("Default net package repository"),
- -command => sub {
- $entry->delete(0,"end");
- $entry->insert(0,$TeXLiveURL);
- })->pack(-side => "left",-padx => "2m", -pady => "2m");
- $f1->pack;
- $f2->pack;
-
- my $f = $sw->Frame;
- my $okbutton = $f->Button(-text => __("Ok"),
- -command => sub { $default_location = $entry->get;
- $localtlpdb->option("location", $default_location);
- $localtlpdb->save;
- $defaults{'location'} = $default_location;
- $sw->destroy })->pack(-side => 'left',-padx => "2m", -pady => "2m");
- my $cancelbutton = $f->Button(-text => __("Cancel"),
- -command => sub { $sw->destroy })->pack(-side => 'right',-padx => "2m", -pady => "2m");
- $f->pack(-expand => 'x');
- $sw->bind('<Return>', [ $okbutton, 'Invoke' ]);
- $sw->bind('<Escape>', [ $cancelbutton, 'Invoke' ]);
-}
-
-sub toggle_setting() {
- my ($key) = @_;
- my $new = ($localtlpdb->option($key) ? 0 : 1);
- $localtlpdb->option($key, $new);
- $defaults{$key} = ($new ? __("Yes") : __("No"));
- $localtlpdb->save;
-}
-
-
-sub change_paper {
- my ($prog, $pap) = @_;
- $mw->Busy(-recurse => 1);
- if ($prog eq "all") {
- execute_action_gui ("paper", "paper", $pap);
- init_all_papers();
- } else {
- execute_action_gui ( "paper", $prog, "paper", $pap);
- &{$init_paper_subs{$prog}}();
- }
- $mw->Unbusy;
-}
-
-sub select_paper {
- my $prog = shift;
- my $foo = $back_config->Toplevel(-title => __("Select paper format for") . " $prog");
- $foo->transient($mw);
- $foo->grab();
- my $var = $defaultpaper{$prog};
- my $opt = $foo->BrowseEntry(-label => __("Default paper for") . " $prog", -variable => \$var);
- foreach my $p (sort @{$papers{$prog}}) {
- $opt->insert("end",$p);
- }
- $opt->pack(-padx => "2m", -pady => "2m");
- my $f = $foo->Frame;
- my $okbutton = $f->Button(-text => __("Ok"), -command => sub { change_paper($prog,$var); $foo->destroy; })->pack(-side => "left", -padx => "2m", -pady => "2m");
- my $cancelbutton = $f->Button(-text => __("Cancel"), -command => sub { $foo->destroy; })->pack(-side => "left", -padx => "2m", -pady => "2m");
- $f->pack;
- $foo->bind('<Return>', [ $okbutton, 'Invoke' ]);
- $foo->bind('<Escape>', [ $cancelbutton, 'Invoke' ]);
-}
-
-sub select_autobackup {
- my $foo = $back_config->Toplevel(-title => __("Auto backup setting"));
- $foo->transient($mw);
- $foo->grab();
- my $var = $defaults{"autobackup"};
- my $opt = $foo->BrowseEntry(-label => __("Auto backup setting"),
- -variable => \$var);
- my @al;
- push @al, "-1 (" . __("keep arbitrarily many") . ")";
- push @al, "0 (" . __("disable") . ")";
- for my $i (1..100) {
- push @al, $i;
- }
- foreach my $p (@al) {
- $opt->insert("end",$p);
- }
- $opt->pack(-padx => "2m", -pady => "2m");
- my $f = $foo->Frame;
- my $okbutton = $f->Button(-text => __("Ok"),
- -command => sub {
- $var =~ s/ .*$//;
- $localtlpdb->option("autobackup", $var);
- $defaults{"autobackup"} = $var;
- $localtlpdb->save;
- $foo->destroy;
- }
- )->pack(-side => "left", -padx => "2m", -pady => "2m");
- my $cancelbutton = $f->Button(-text => __("Cancel"), -command => sub { $foo->destroy; })->pack(-side => "left", -padx => "2m", -pady => "2m");
- $f->pack;
- $foo->bind('<Return>', [ $okbutton, 'Invoke' ]);
- $foo->bind('<Escape>', [ $cancelbutton, 'Invoke' ]);
-}
-
-
-sub select_file_assocs {
- my $foo = $back_config->Toplevel(-title => __("Change file associations"));
- $foo->transient($mw);
- $foo->grab();
- my $var = $defaults{"file_assocs"};
- my $opt = $foo->BrowseEntry(-label => __("Change file associations"),
- -variable => \$var);
- my @al;
- push @al, "0 " . __("None");
- push @al, "1 " . __("Only new");
- push @al, "2 " . __("All");
- foreach my $p (@al) {
- $opt->insert("end",$p);
- }
- $opt->pack(-padx => "2m", -pady => "2m");
- my $f = $foo->Frame;
- my $okbutton = $f->Button(-text => __("Ok"),
- -command => sub {
- $var = substr($var,0,1);
- $localtlpdb->option("file_assocs", $var);
- $defaults{"file_assocs"} = $fileassocdesc[$var];
- $localtlpdb->save;
- $foo->destroy;
- }
- )->pack(-side => "left", -padx => "2m", -pady => "2m");
- my $cancelbutton = $f->Button(-text => __("Cancel"), -command => sub { $foo->destroy; })->pack(-side => "left", -padx => "2m", -pady => "2m");
- $f->pack;
- $foo->bind('<Return>', [ $okbutton, 'Invoke' ]);
- $foo->bind('<Escape>', [ $cancelbutton, 'Invoke' ]);
-}
-
-
-1;
-
-### Local Variables:
-### perl-indent-level: 2
-### tab-width: 2
-### indent-tabs-mode: nil
-### End:
-# vim:set tabstop=2 expandtab: #
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl
deleted file mode 100644
index ba3047945a1..00000000000
--- a/Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl
+++ /dev/null
@@ -1,46 +0,0 @@
-# gui-uninstall.pl
-# $Id$
-#
-# Copyright 2008 Tomasz Luczak
-# Copyright 2008, 2009 Norbert Preining
-#
-# GUI for tlmgr
-#
-
-our $back_f3 = $back->add("uninstall", -label => __("Uninstallation"), -justify => "left");
-$screens{"uninstall"} = $back_f3;
-
-if ($^O=~/^MSWin(32|64)$/i) {
- my $lab = $back_f3->Label(-justify => 'left',
- -text => __("Please use the \"Add/Remove Programs\" from the Control Panel!"));
-
- $lab->pack(-padx => "10m", -pady => "5m");
-} else {
- my $lab = $back_f3->Label(-justify => 'left',
- -text => __("Really remove the complete TeX Live %s installation?\nYour last chance to change your mind!", $TeXLive::TLConfig::ReleaseYear));
-
- $lab->pack(-padx => "10m", -pady => "5m");
-
- my $f = $back_f3->Frame;
- $f->pack(-padx => "10m", -pady => "5m");
-
- my $ok = $f->Button(-text => __("Remove TeX Live %s", $TeXLive::TLConfig::ReleaseYear),
- -state => $::action_button_state,
- -command => sub {
- system("tlmgr", "uninstall", "--force");
- $mw->Dialog(-text => __("Complete removal completed"), -buttons => [ __("Ok") ])->Show;
- $mw->destroy;
- exit(0);
- });
-
- $ok->pack(-side => 'left', -padx => "3m");
-}
-
-1;
-
-### Local Variables:
-### perl-indent-level: 2
-### tab-width: 2
-### indent-tabs-mode: nil
-### End:
-# vim:set tabstop=2 expandtab: #
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.ico b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.ico
deleted file mode 100644
index 92cafac088f..00000000000
--- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.ico
+++ /dev/null
Binary files differ
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
deleted file mode 100755
index 253b254ef44..00000000000
--- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
+++ /dev/null
@@ -1,551 +0,0 @@
-#!/usr/bin/env perl
-# $Id$
-#
-# Copyright 2008 Tomasz Luczak
-# Copyright 2008, 2009 Norbert Preining
-# This file is licensed under the GNU General Public License version 2
-# or any later version.
-#
-# GUI for tlmgr
-
-use Tk;
-use Tk::Dialog;
-use Tk::NoteBook;
-use Tk::BrowseEntry;
-use Tk::ROText;
-use Tk::Balloon;
-use TeXLive::Splashscreen;
-
-use TeXLive::TLUtils qw(setup_programs platform_desc win32 debug);
-use TeXLive::TLConfig;
-
-our $Master;
-our $tlmediatlpdb;
-our $tlmediasrc;
-our $location;
-#
-# translation facility, not fully functional by now
-#
-our %opts;
-
-sub update_status_window {
- update_status(join(" ", @_));
- $mw->update;
- $::sww->update;
-}
-
-sub init_hooks {
- push @::info_hook, \&update_status_window;
- push @::warn_hook, \&update_status_window;
- push @::debug_hook, \&update_status_window;
- push @::ddebug_hook, \&update_status_window;
- push @::dddebug_hook, \&update_status_window;
-}
-
-sub update_status {
- my ($p) = @_;
- $::progressw->insert("end", "$p");
- $::progressw->see("end");
-}
-
-my $opt_screen = $::guiscreen;
-
-
-# prepare for loading of lang.pl which expects $::lang and $::opt_lang
-$::opt_lang = $opts{"gui-lang"} if (defined($opts{"gui-lang"}));
-
-require("TeXLive/trans.pl");
-
-our @update_function_list;
-
-our $mw = MainWindow->new;
-$mw->title("TeX Live Manager $TeXLive::TLConfig::ReleaseYear");
-$mw->withdraw;
-
-# create a progress bar window
-$::sww = $mw->Toplevel(-title => "log window",
- -width => 400);
-$::sww->transient($mainwindow);
-#$::sww->grab();
-$::sww->Label(-text => "Log output")->pack;
-$::progressw = $::sww->Scrolled("ROText", -scrollbars => "e", -height => 16);
-$::progressw->pack(-expand => 1, -fill => "both");
-
-
-init_hooks();
-
-info(__("Loading local TeX Live Database\nThis may take some time, please wait!") . "\n");
-
-our $localtlmedia = TeXLive::TLMedia->new ( $Master );
-die("cannot setup TLMedia in $Master") unless (defined($localtlmedia));
-$localtlpdb = $localtlmedia->tlpdb;
-die("cannot find tlpdb!") unless (defined($localtlpdb));
-
-our @alllocalpackages = setup_list(0,$localtlpdb->list_packages);
-our @updatepackages;
-setup_programs("$Master/tlpkg/installer", $localtlmedia->platform);
-
-my $loc = $localtlpdb->option("location");
-if (defined($loc)) {
- $location = $loc;
-}
-if (defined($opts{"location"})) {
- $location = $opts{"location"};
-}
-
-our @allpackages;
-
-our $balloon = $mw->Balloon();
-
-
-push @update_function_list, \&check_location_on_ctan;
-push @update_function_list, \&init_install_media;
-push @update_function_list, \&create_update_list;
-
-#
-# check that we can actually save the database
-#
-if (check_on_writable()) {
- $::we_can_save = 1;
-} else {
- $::we_can_save = 0;
- # here we should pop up a warning window!!!
-}
-$::action_button_state = ($::we_can_save ? "normal" : "disabled");
-
-our $top = $mw->Frame;
-
-our $quit = $top->Button(-text => __("Quit"),
- -command => sub { $mw->destroy; exit(0); });
-
-my $tlmgrrev = give_version();
-chomp($tlmgrrev);
-our $about = $top->Button(-text => __("About"),
- -command => sub {
- my $sw = $mw->DialogBox(-title => __("About"),
- -buttons => [ __("Ok") ]);
- $sw->add("Label", -text => "TeX Live Manager
-$tlmgrrev
-Copyright 2008 Tomasz Luczak
-Copyright 2008, 2009 Norbert Preining
-
-Licensed under the GNU General Public License version 2 or higher
-In case of problems, please contact: texlive\@tug.org"
- )->pack(-padx => "3m", -pady => "3m");
- $sw->Show;
- });
-
-$about->pack(-side => 'right');
-$quit->pack(-side => 'right');
-
-$mw->bind('<Escape>', [ $quit, 'Invoke' ]);
-
-$top->Label(-text => __("Current package repository:") . " ")->pack(-side => 'left');
-$top->Label(-textvariable => \$location, -relief => "sunken")->pack(-side => 'left');
-
-$balloon->attach(
- $top->Button(-text => __("Load"), -command => sub { run_update_functions(); })->pack(-side => 'left'),
- -balloonmsg => __("Press this button to load the database from the package repository."));
-
-$balloon->attach(
- $top->Button(-text => __("Change"), -command => sub { menu_edit_location(); })->pack(-side => 'left'),
- -balloonmsg => __("Change package repository from where packages are fetched at installation and update time."));
-
-# here we add a bit of trickery to make sure that the verbosity level
-# as set on the cmd line (-v or -v -v) is kept during pressing the
-# debug button on and off. If -v is *not* given activating it afterwards
-# defaults to one -v, while if -v -v is given on the cmd line, we keep
-# it that way
-$balloon->attach(
- $top->Checkbutton(-text => __("Debug"),
- -onvalue => ($::opt_verbosity == 0 ? 1 : $::opt_verbosity),
- -variable => \$::opt_verbosity)->pack(-side => 'left'),
- -balloonmsg => __("Turn on debug mode."));
-
-# frame .back -borderwidth 2
-our $back = $mw->NoteBook(-borderwidth => 2, -dynamicgeometry => 1);
-
-
-# pack .top .back -side top -fill both -expand 1
-$top->pack(-side => 'top', -fill => 'x', -expand => 0);
-$back->pack(-side => 'top', -fill => 'both', -expand => 1);
-
-require ("do_listframe.pl");
-# install screen
-our $back_f1 = $back->add("install",-label => __("Installation"), -justify => "left");
-$screens{"install"} = $back_f1;
-my ($install_win, $install_lb) = do_listframe($back_f1,
- __("Adding packages"),
- \@allpackages,
- { install => { -text => __("Install selected"),
- -command => \&install_selected_packages}},
- 1,1
- );
-set_text_win($install_win, __("The database of the package repository has not been loaded.\n\nPlease use the \"Load\" (and possibly \"Change\") button to do so."));
-# update screen
-our $back_up = $back->add("update", -label => __("Update"), -justify => "left");
-$screens{"update"} = $back_up;
-my $critical_updates_present = 0;
-my ($update_win, $update_lb) = do_listframe($back_up,
- __("Updating packages"),
- \@updatepackages,
- { updateall => { -text => __("Update all"),
- -command => \&update_selected_packages,
- -args => [ "--all" ]
- },
- updatesel => { -text => __("Update selected"),
- -command => \&update_selected_packages
- }},
- 1,0
- );
-set_text_win($update_win, __("The database of the package repository has not been loaded.\n\nPlease use the \"Load\" (and possibly \"Change\") button to do so."));
-# remove screen
-our $back_f2 = $back->add("remove", -label => __("Remove"), -justify => "left");
-$screens{"remove"} = $back_f2;
-my ($remove_win, $remove_lb) = do_listframe($back_f2,
- __("Removing packages"),
- \@alllocalpackages,
- { remove => { -text => __("Remove selected"),
- -command => \&remove_selected_packages}},
- 1,1
- );
-set_text_win($remove_win, __("Please click on an item on the left for details"));
-# uninstall screen
-require("gui-uninstall.pl");
-# arch support not be done via tlmgr on win32
-if (!win32()) {
- require("gui-arch.pl");
-}
-# config screen
-require("gui-config.pl");
-
-if ($opt_load) {
- run_update_functions();
-}
-
-
-if (defined($opt_screen)) {
- $back->raise("$opt_screen");
-}
-
-info(__("Completed") . "\n");
-$mw->deiconify;
-
-
-if (!$::we_can_save) {
- my $no_write_warn = $mw->Dialog(-title => "warning",
- -text => __("You don't have permissions to change the installation in any way,\nspecifically, the directory %s is not writable.\nPlease run this program as administrator, or contact your local admin.\n\nMost buttons will be disabled.", "$Master/tlpkg/"),
- -buttons => [ __("Ok") ])->Show();
-}
-
-Tk::MainLoop();
-
-
-sub init_install_media {
- my $newroot = $location;
- if (defined($tlmediatlpdb) && ($tlmediatlpdb->root eq $newroot)) {
- # nothing to be done
- } else {
- $mw->Busy(-recurse => 1);
- info(__("Loading remote TeX Live Database\nThis may take some time, please wait!") . "\n");
- $tlmediasrc = TeXLive::TLMedia->new($newroot);
- info(__("Completed") . "\n");
- $mw->Unbusy;
- if (!defined($tlmediasrc)) {
- # something went badly wrong, maybe the newroot is wrong?
- $mw->Dialog(-title => "warning",
- -text => __("Could not load the TeX Live Database from %s\nIf you want to install or update packages, please try with a different package repository!\n\nFor configuration and removal you don\'t have to do anything.", $newroot),
- -buttons => [ __("Ok") ])->Show;
- $location = __("...please change me...");
- @allpackages = ();
- } else {
- $tlmediatlpdb = $tlmediasrc->tlpdb;
- @allpackages = setup_list(1,$tlmediatlpdb->list_packages);
- set_text_win($install_win, __("Please click on an item on the left for details"));
- set_text_win($remove_win, __("Please click on an item on the left for details"));
- set_text_win($update_win, __("Please click on an item on the left for details"));
- }
- }
-}
-
-sub set_text_win {
- my ($w, $t) = @_;
- $w->delete("0.0", "end");
- $w->insert("0.0", "$t");
- $w->see("0.0");
-}
-
-sub install_selected_packages {
- if (@_) {
- my @args = qw/install/;
- push @args, @_;
- execute_action_gui(@args);
- reinit_local_tlpdb();
- # now we check that the installation has succeeded by checking that
- # all packages in @_ are installed. Otherwise we pop up a warning window
- my $do_warn = 0;
- for my $p (@_) {
- if (!defined($localtlpdb->get_package($p))) {
- $do_warn = 1;
- last;
- }
- }
- give_warning_window(__("Installation"), @_) if $do_warn;
- }
-}
-
-sub update_selected_packages {
- if (@_) {
- my @args = qw/update/;
- # argument processing
- # in case we have critical updates present we do put the list of
- # critical updates into the argument instead of --all
- if ($critical_updates_present) {
- $opts{"self"} = 1;
- } else {
- if ($_[0] eq "--all") {
- $opts{"all"} = 1;
- # shift away the --all
- shift;
- }
- }
- push @args, @_;
- execute_action_gui(@args);
- if ($critical_updates_present) {
- # terminate here immediately so that we are sure the auto-updater
- # is run immediately
- # make sure we exit in finish(0)
- $::gui_mode = 0;
- finish(0);
- }
- reinit_local_tlpdb();
- }
-}
-
-sub remove_selected_packages {
- if (@_) {
- my @args = qw/remove/;
- push @args, @_;
- execute_action_gui(@args);
- reinit_local_tlpdb();
- my $do_warn = 0;
- for my $p (@_) {
- if (defined($localtlpdb->get_package($p))) {
- $do_warn = 1;
- last;
- }
- }
- give_warning_window(__("Remove"), @_) if $do_warn;
- }
-}
-
-sub reinit_local_tlpdb {
- $mw->Busy(-recurse => 1);
- $localtlpdb = TeXLive::TLPDB->new ("root" => "$Master");
- die("cannot find tlpdb!") unless (defined($localtlpdb));
- @alllocalpackages = setup_list(0,$localtlpdb->list_packages);
- if (defined($tlmediatlpdb)) {
- @allpackages = setup_list(1,$tlmediatlpdb->list_packages);
- }
- create_update_list();
- $mw->Unbusy;
-}
-
-#
-# create_update_list
-# checks for updates and builds up the list @updatepackages which
-# is shown on the update screen
-#
-# if critical packages do have a pending update *only* those packages
-# are shown in the list so that pressing the --all will succeed
-sub create_update_list {
- my @ret = ();
- my @archret = ();
- my @critical = $localtlpdb->expand_dependencies("-no-collections",
- $localtlpdb, @TeXLive::TLConfig::CriticalPackagesList);
- if (defined($tlmediatlpdb)) {
- foreach my $lp ($localtlpdb->list_packages) {
- next if ($lp =~ m/00texlive.installation/);
- my $lrev = $localtlpdb->get_package($lp)->revision;
- my $up = $tlmediatlpdb->get_package($lp);
- my $urev;
- if ($up) {
- $urev = $up->revision;
- } else {
- $urev = 0;
- }
- if ($urev > $lrev) {
- if ($lp =~ m/\./) {
- push @archret, $lp;
- } else {
- push @ret, $lp;
- }
- }
- }
- foreach my $p (@archret) {
- my $foundparent = 0;
- foreach my $q (@ret) {
- $foundparent = 1 if ($p =~ m/^$q\./);
- }
- push @ret, $p unless $foundparent;
- }
- # issue a warning if no updates are available, the tlmediatlpdb is loaded
- # and is not from the net
- if ($#ret < 0) {
- if ($tlmediasrc->media ne "NET") {
- set_text_win($update_win, __("No updates found.\n\nYour installation is set up to look on the disk for updates.\n\nIf you want to install from the Internet for this one time only, click on the \"Change\" button above and select \"Default net package repository\" (or any other package repository you know to be working).\n\nIf you want to change it permanently, go to the \"Configuration\" Tab and change the default package repository."));
- } else {
- set_text_win($update_win, __("Everything up-to-date!"));
- }
- }
- } else {
- @ret = ();
- }
- # sort the critical packages out
- my @critupd = ();
- OUTER: for my $p (@ret) {
- for my $cp (@critical) {
- if ($p =~ m/^$cp/) {
- push @critupd, $p;
- next OUTER;
- }
- }
- }
- if (@critupd) {
- @updatepackages = @critupd;
- # set background of critical packages to red
- for my $i (0..$#updatepackages) {
- $update_lb->itemconfigure($i, -background => "red",
- -selectforeground => "red");
- }
- $critical_updates_present = 1;
- } else {
- @updatepackages = @ret;
- $critical_updates_present = 0;
- }
- if ($critical_updates_present) {
- my $sw = $mw->DialogBox(-title => __("Warning"), -buttons => [ __("Ok") ]);
- my $t = __("Updates for the tlmgr are present.\nInstallation and upgrades won't work without being forced.\nPlease go to the update screen and press the \"update all\" button.\nThe program will terminate after the update.\nThen you can restart the program for further updates.");
- $t .= "\n\n" . __("Please wait a bit after the program has terminated so that the update can be completed.") if win32();
- $sw->add("Label", -text => $t)->pack(-padx => "3m", -pady => "3m");
- $sw->Show;
- }
-}
-
-sub setup_list {
- my $addi = shift;
- my @ret;
- my @colls;
- my @other;
- foreach my $p (@_) {
- if ($p !~ m;\.;) {
- my $pushstr = "";
- if ($addi) {
- if (defined($localtlpdb->get_package($p))) {
- $pushstr = "(i) ";
- } else {
- $pushstr = " ";
- }
- }
- $pushstr .= "$p";
- if ($p =~ m;^scheme-;) {
- push @ret, $pushstr;
- } elsif ($p =~ m;^collection-;) {
- push @colls, $pushstr;
- } else {
- push @other, $pushstr;
- }
- }
- }
- push @ret, @colls, @other;
- return(@ret);
-}
-
-
-sub menu_edit_location {
- my $key = shift;
- my $val;
- my $sw = $mw->Toplevel(-title => __("Change package repository"));
- $sw->transient($mw);
- $sw->grab();
- $sw->Label(-text => __("New package repository:"))->pack(-padx => "2m", -pady => "2m");
- my $entry = $sw->Entry(-text => $location, -width => 30);
- $entry->pack();
- my $f1 = $sw->Frame;
- $f1->Button(-text => __("Choose Directory"),
- -command => sub {
- my $var = $sw->chooseDirectory;
- if (defined($var)) {
- $entry->delete(0,"end");
- $entry->insert(0,$var);
- }
- })->pack(-side => "left", -padx => "2m", -pady => "2m");
- $f1->Button(-text => __("Default net package repository"),
- -command => sub {
- $entry->delete(0,"end");
- $entry->insert(0,$TeXLiveURL);
- })->pack(-side => "left", -padx => "2m", -pady => "2m");
- $f1->pack;
- my $f = $sw->Frame;
- my $okbutton = $f->Button(-text => __("Ok"),
- -command => sub { $location = $entry->get;
- run_update_functions();
- $sw->destroy;
- })->pack(-side => 'left', -padx => "2m", -pady => "2m");
- my $cancelbutton = $f->Button(-text => __("Cancel"),
- -command => sub { $sw->destroy })->pack(-side => 'right', -padx => "2m", -pady => "2m");
- $f->pack(-expand => 'x');
- $sw->bind('<Return>', [ $okbutton, 'Invoke' ]);
- $sw->bind('<Escape>', [ $cancelbutton, 'Invoke' ]);
-}
-
-sub run_update_functions {
- foreach my $f (@update_function_list) {
- &{$f}();
- }
-}
-
-sub check_location_on_ctan {
- # we want to check that if mirror.ctan.org
- # is used that we select a mirror once
- if ($location =~ m/$TeXLive::TLConfig::TeXLiveServerURL/) {
- $location = TeXLive::TLUtils::give_ctan_mirror();
- }
-}
-
-sub execute_action_gui {
- # my $td = $mw->Toplevel(-title => __("Status Window"));
- # $td->transient($mw);
- # $td->grab();
- # my $ok = $td->Button(-text => __("Ok"), -padx => "3m", -pady => "3m",
- # -command => sub { $td->destroy; });
- # my $lab = $td->Label(-text => __("Starting") . " @_\n");
- # $lab->pack;
- $mw->Busy(-recurse => 1);
- execute_action(@_);
- info(__("Completed") . "\n");
- $mw->Unbusy;
- # my $labb = $td->Label(-text => __("Completed"));
- # $labb->pack;
- # $ok->pack;
-}
-
-sub give_warning_window {
- my ($act, @args) = @_;
- my $sw = $mw->DialogBox(-title => __("Warning Window"), -buttons => [ __("Ok") ]);
- $sw->add("Label", -text => __("Running %s failed.\nPlease consult the log window for details.", "$act @args")
- )->pack(-padx => "3m", -pady => "3m");
- $sw->Show;
-}
-
-1;
-
-__END__
-
-
-### Local Variables:
-### perl-indent-level: 2
-### tab-width: 2
-### indent-tabs-mode: nil
-### End:
-# vim:set tabstop=2 expandtab: #