From f5ca71ef24478be2ca71433b0a1d5743b7edb516 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 21 May 2012 00:00:14 +0000 Subject: provide list of mirrors also in "load other repository" git-svn-id: svn://tug.org/texlive/trunk@26520 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tlmgrgui.pl | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'Master/texmf/scripts') diff --git a/Master/texmf/scripts/texlive/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui.pl index 08467db383c..9899078a302 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui.pl @@ -2524,26 +2524,43 @@ sub cb_edit_location { $sw->transient($mw); $sw->grab(); $sw->Label(-text => __("Package repository:"))->pack(@p_ii); - my $entry = $sw->Entry(-text => $location, -width => 30); - $entry->pack(); + my @mirror_list; + push @mirror_list, TeXLive::TLUtils::create_mirror_list(); + my $entry = $sw->BrowseEntry( + -listheight => 12, + -listwidth => 400, + -width => 50, + -autolistwidth => 1, + -choices => \@mirror_list, + -browsecmd => + sub { + if ($val !~ m/^ /) { + $val = ""; + } elsif ($val =~ m!(http|ftp)://!) { + $val = TeXLive::TLUtils::extract_mirror_entry($val); + } else { + $val =~ s/^\s*//; + } + }, + -variable => \$val); + # end new + $entry->pack(@p_ii); 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); + $val = $var; } })->pack(@left, @p_ii); $f1->Button(-text => __("Default net package repository"), -command => sub { - $entry->delete(0,"end"); - $entry->insert(0,$TeXLiveURL); + $val = $TeXLiveURL; })->pack(@left, @p_ii); $f1->pack; my $f = $sw->Frame; my $okbutton = $f->Button(-text => __("Ok"), - -command => sub { $location = $entry->get; + -command => sub { $location = $val; $sw->destroy; setup_location($location); })->pack(@left, @p_ii); -- cgit v1.2.3