From 8ef0751fd296a6ef6bcb8b1f568bf4b3c36c1570 Mon Sep 17 00:00:00 2001 From: Manuel Pégourié-Gonnard Date: Mon, 5 Apr 2010 08:09:04 +0000 Subject: Dummy "search" routine for texdoc. Fixed problem with srchtype selection. git-svn-id: svn://tug.org/texlive/trunk@17703 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/tetex/texdoctk.pl | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Master/texmf/scripts/tetex/texdoctk.pl b/Master/texmf/scripts/tetex/texdoctk.pl index f0512882ba7..58764ac6181 100755 --- a/Master/texmf/scripts/tetex/texdoctk.pl +++ b/Master/texmf/scripts/tetex/texdoctk.pl @@ -274,7 +274,8 @@ sub tpslct { push @lbitems,$topic[$srchitems[$j]][$srchitems[$k]]; push @lbdocs,$doc[$srchitems[$j]][$srchitems[$k]]; } - $wtitle="Search results for $spec_wtitle"; + $wtitle = ($srchtype ? "File" : "Database") + . " search results for $spec_wtitle"; } # toplevel window of category $opt with two frames my $tpwin=$main->Toplevel(-title=>$wtitle); @@ -770,6 +771,7 @@ sub mksrch { $srchtype = $type; } } else { + $srchtype = $type; # get the search string $srchentry=$cmdframe->Entry(-cursor=>'xterm', -font=>$deffont, @@ -791,7 +793,11 @@ sub srchstr { $main->configure(-cursor=>'watch'); $string=$srchentry->get(); # search - @reslist = &srchdb($string); + if ($srchtype == 0) { + @reslist = &srchdb($string); + } else { + @reslist = &srchtd($string); + } # destroy entry widget and show results destroy $srchentry; $srchflag=0; @@ -804,6 +810,17 @@ sub srchstr { $main->configure(-cursor=>$defcursor); } +# search using texdoc +sub srchtd { + my ($string) = @_; + my @res; + my $idx = -1; # dummy index for @packname, @topic and @keywords + $packname[-1][0] = "texdoc"; + $topic[-1][0] = "Find documentation in TeX Live"; + $doc[-1][0] = "texdoc/texdoc.pdf"; + return (-1, 0); +} + # search a string in @packname, @topic and @keywords sub srchdb { my ($string) = @_; -- cgit v1.2.3