diff options
Diffstat (limited to 'khelpcenter/htmlsearch')
23 files changed, 1977 insertions, 0 deletions
diff --git a/khelpcenter/htmlsearch/Makefile.am b/khelpcenter/htmlsearch/Makefile.am new file mode 100644 index 000000000..d4d00fb5f --- /dev/null +++ b/khelpcenter/htmlsearch/Makefile.am @@ -0,0 +1,39 @@ +khelpcenter_en_data_DATA = long.html short.html wrapper.html nomatch.html syntax.html +khelpcenter_en_datadir = $(kde_datadir)/khelpcenter/en + +star_DATA = star.png star_blank.png +stardir = $(kde_datadir)/khelpcenter/pics + +INCLUDES = $(all_includes) +METASOURCES = AUTO + +lib_LTLIBRARIES = libhtmlsearch.la libkcm_htmlsearch.la + +libhtmlsearch_la_SOURCES = htmlsearch.cpp progressdialog.cpp +libhtmlsearch_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +libhtmlsearch_la_LIBADD = $(LIB_TDEIO) + +libkcm_htmlsearch_la_SOURCES = kcmhtmlsearch.cpp klangcombo.cpp ktagcombobox.cpp +libkcm_htmlsearch_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +libkcm_htmlsearch_la_LIBADD = $(LIB_TDEIO) + +noinst_HEADERS = kcmhtmlsearch.h htmlsearch.h + +xdg_apps_DATA = htmlsearch.desktop + +bin_PROGRAMS = tdehtmlindex + +wrapperdir = $(kde_datadir)/khelpcenter/ +wrapper_SCRIPTS = meinproc_wrapper + +tdehtmlindex_SOURCES = index.cpp +tdehtmlindex_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor +tdehtmlindex_LDADD = libhtmlsearch.la $(LIB_TDEUI) + +xpm_DATA = unchecked.xpm checked.xpm +xpmdir = $(kde_datadir)/khelpcenter/pics + +messages: + $(XGETTEXT) index.cpp $(libhtmlsearch_la_SOURCES) -o $(podir)/htmlsearch.pot + $(XGETTEXT) $(libkcm_htmlsearch_la_SOURCES) -o $(podir)/kcmhtmlsearch.pot + diff --git a/khelpcenter/htmlsearch/checked.xpm b/khelpcenter/htmlsearch/checked.xpm new file mode 100644 index 000000000..1ed190249 --- /dev/null +++ b/khelpcenter/htmlsearch/checked.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char*unchecked[]={ +"16 16 4 1", +"# c #000000", +"+ c #ffffff", +"D c #000000", +". c None", +"................", +"............++++", +"..++++++++++DDD+", +"..+########DDD+.", +"..+#++++++DDD+..", +"+DDD+...+DDD#+..", +"++DDD+++DDD+#+..", +"..+DDDDDDD++#+..", +"..+#DDDDD+.+#+..", +"..+#++DD+..+#+..", +"..+#+++++..+#+..", +"..+#++++++++#+..", +"..+##########+..", +"..++++++++++++..", +"................", +"................"}; diff --git a/khelpcenter/htmlsearch/htmlsearch.cpp b/khelpcenter/htmlsearch/htmlsearch.cpp new file mode 100644 index 000000000..5fd0f4640 --- /dev/null +++ b/khelpcenter/htmlsearch/htmlsearch.cpp @@ -0,0 +1,487 @@ +#include <tqregexp.h> +#include <tqdir.h> +#include <assert.h> + +#include <tdeapplication.h> +#include <kdebug.h> +#include <kstandarddirs.h> +#include <kprocess.h> +#include <tdelocale.h> +#include <tdeconfig.h> + + +#include "progressdialog.h" +#include "htmlsearch.moc" + + +HTMLSearch::HTMLSearch() + : TQObject(), _proc(0) +{ +} + + +TQString HTMLSearch::dataPath(const TQString& _lang) +{ + return kapp->dirs()->saveLocation("data", TQString("khelpcenter/%1").arg(_lang)); +} + + +void HTMLSearch::scanDir(const TQString& dir) +{ + assert( dir.at( dir.length() - 1 ) == '/' ); + + TQStringList::ConstIterator it; + + if ( TDEStandardDirs::exists( dir + "index.docbook" ) ) { + _files.append(dir + "index.docbook"); + progress->setFilesScanned(++_filesScanned); + } else { + TQDir d(dir, "*.html", TQDir::Name|TQDir::IgnoreCase, TQDir::Files | TQDir::Readable); + TQStringList const &list = d.entryList(); + TQString adir = d.canonicalPath () + "/"; + TQString file; + for (it=list.begin(); it != list.end(); ++it) + { + file = adir + *it; + if ( !_files.contains( file ) ) { + _files.append(file); + progress->setFilesScanned(++_filesScanned); + } + } + } + + TQDir d2(dir, TQString::null, TQDir::Name|TQDir::IgnoreCase, TQDir::Dirs); + TQStringList const &dlist = d2.entryList(); + for (it=dlist.begin(); it != dlist.end(); ++it) + if (*it != "." && *it != "..") + { + scanDir(dir + *it + "/"); + kapp->processEvents(); + } +} + + +bool HTMLSearch::saveFilesList(const TQString& _lang) +{ + TQStringList dirs; + + // throw away old files list + _files.clear(); + + // open config file + TDEConfig *config = new TDEConfig("khelpcenterrc"); + config->setGroup("Scope"); + + // add KDE help dirs + if (config->readBoolEntry("KDE", true)) + dirs = kapp->dirs()->findDirs("html", _lang + "/"); + kdDebug() << "got " << dirs.count() << " dirs\n"; + + // TODO: Man and Info!! + + // add local urls + TQStringList add = config->readListEntry("Paths"); + TQStringList::Iterator it; + for (it = add.begin(); it != add.end(); ++it) { + if ( ( *it ).at( ( *it ).length() - 1 ) != '/' ) + ( *it ) += '/'; + dirs.append(*it); + } + + _filesScanned = 0; + + for (it = dirs.begin(); it != dirs.end(); ++it) + scanDir(*it); + + delete config; + + return true; +} + + +bool HTMLSearch::createConfig(const TQString& _lang) +{ + TQString fname = dataPath(_lang) + "/htdig.conf"; + + // locate the common dir + TQString wrapper = locate("data", TQString("khelpcenter/%1/wrapper.html").arg(_lang)); + if (wrapper.isEmpty()) + wrapper = locate("data", TQString("khelpcenter/en/wrapper.html")); + if (wrapper.isEmpty()) + return false; + wrapper = wrapper.left(wrapper.length() - 12); + + // locate the image dir + TQString images = locate("data", "khelpcenter/pics/star.png"); + if (images.isEmpty()) + return false; + images = images.left(images.length() - 8); + + // This is an example replacement for the default bad_words file + // distributed with ht://Dig. It was compiled by Marjolein Katsma + // <HSH@taxon.demon.nl>. + TQString bad_words = i18n( "List of words to exclude from index", + "above:about:according:across:actually:\n" + "adj:after:afterwards:again:against:all:\n" + "almost:alone:along:already:also:although:\n" + "always:among:amongst:and:another:any:\n" + "anyhow:anyone:anything:anywhere:are:aren:\n" + "arent:around:became:because:become:\n" + "becomes:becoming:been:before:beforehand:\n" + "begin:beginning:behind:being:below:beside:\n" + "besides:between:beyond:billion:both:but:\n" + "can:cant:cannot:caption:could:couldnt:\n" + "did:didnt:does:doesnt:dont:down:during:\n" + "each:eight:eighty:either:else:elsewhere:\n" + "end:ending:enough:etc:even:ever:every:\n" + "everyone:everything:everywhere:except:few:\n" + "fifty:first:five:for:former:formerly:forty:\n" + "found:four:from:further:had:has:hasnt:have:\n" + "havent:hence:her:here:hereafter:hereby:\n" + "herein:heres:hereupon:hers:herself:hes:him:\n" + "himself:his:how:however:hundred:\n" + "inc:indeed:instead:into:isnt:its:\n" + "itself:last:later:latter:latterly:least:\n" + "less:let:like:likely:ltd:made:make:makes:\n" + "many:may:maybe:meantime:meanwhile:might:\n" + "million:miss:more:moreover:most:mostly:\n" + "mrs:much:must:myself:namely:neither:\n" + "never:nevertheless:next:nine:ninety:\n" + "nobody:none:nonetheless:noone:nor:not:\n" + "nothing:now:nowhere:off:often:once:\n" + "one:only:onto:others:otherwise:our:ours:\n" + "ourselves:out:over:overall:own:page:per:\n" + "perhaps:rather:recent:recently:same:\n" + "seem:seemed:seeming:seems:seven:seventy:\n" + "several:she:shes:should:shouldnt:since:six:\n" + "sixty:some:somehow:someone:something:\n" + "sometime:sometimes:somewhere:still:stop:\n" + "such:taking:ten:than:that:the:their:them:\n" + "themselves:then:thence:there:thereafter:\n" + "thereby:therefore:therein:thereupon:these:\n" + "they:thirty:this:those:though:thousand:\n" + "three:through:throughout:thru:thus:tips:\n" + "together:too:toward:towards:trillion:\n" + "twenty:two:under:unless:unlike:unlikely:\n" + "until:update:updated:updates:upon:\n" + "used:using:very:via:want:wanted:wants:\n" + "was:wasnt:way:ways:wed:well:were:\n" + "werent:what:whats:whatever:when:whence:\n" + "whenever:where:whereafter:whereas:whereby:\n" + "wherein:whereupon:wherever:wheres:whether:\n" + "which:while:whither:who:whoever:whole:\n" + "whom:whomever:whose:why:will:with:within:\n" + "without:wont:work:worked:works:working:\n" + "would:wouldnt:yes:yet:you:youd:youll:your:\n" + "youre:yours:yourself:yourselves:youve" ); + + TQFile f; + f.setName( dataPath(_lang) + "/bad_words" ); + if (f.open(IO_WriteOnly)) + { + TQTextStream ts( &f ); + TQStringList words = TQStringList::split ( TQRegExp ( "[\n:]" ), + bad_words, false); + for ( TQStringList::ConstIterator it = words.begin(); + it != words.end(); ++it ) + ts << *it << endl; + f.close(); + } + + f.setName(fname); + if (f.open(IO_WriteOnly)) + { + kdDebug() << "Writing config for " << _lang << " to " << fname << endl; + + TQTextStream ts(&f); + + ts << "database_dir:\t\t" << dataPath(_lang) << endl; + ts << "start_url:\t\t`" << dataPath(_lang) << "/files`" << endl; + ts << "local_urls:\t\tfile:/=/" << endl; + ts << "local_urls_only:\ttrue" << endl; + ts << "maximum_pages:\t\t1" << endl; + ts << "image_url_prefix:\t" << images << endl; + ts << "star_image:\t\t" << images << "star.png" << endl; + ts << "star_blank:\t\t" << images << "star_blank.png" << endl; + ts << "compression_level:\t6" << endl; + ts << "max_hop_count:\t\t0" << endl; + + ts << "search_results_wrapper:\t" << wrapper << "wrapper.html" << endl; + ts << "nothing_found_file:\t" << wrapper << "nomatch.html" << endl; + ts << "syntax_error_file:\t" << wrapper << "syntax.html" << endl; + ts << "bad_word_list:\t\t" << dataPath(_lang) << "/bad_words" << endl; + ts << "external_parsers:\t" << "text/xml\t" << locate( "data", "khelpcenter/meinproc_wrapper" ) << endl; + f.close(); + return true; + } + + return false; +} + + +#define CHUNK_SIZE 15 + +bool HTMLSearch::generateIndex(TQString _lang, TQWidget *parent) +{ + if (_lang == "C") + _lang = "en"; + + if (!createConfig(_lang)) + return false; + + // create progress dialog + progress = new ProgressDialog(parent); + progress->show(); + kapp->processEvents(); + + // create files list ---------------------------------------------- + if (!saveFilesList(_lang)) + return false; + + progress->setState(1); + + // run htdig ------------------------------------------------------ + TDEConfig *config = new TDEConfig("khelpcenterrc", true); + TDEConfigGroupSaver saver(config, "htdig"); + TQString exe = config->readPathEntry("htdig", kapp->dirs()->findExe("htdig")); + + if (exe.isEmpty()) + { + delete config; + return false; + } + bool initial = true; + bool done = false; + int count = 0; + + _filesToDig = _files.count(); + progress->setFilesToDig(_filesToDig); + _filesDigged = 0; + + TQDir d; d.mkdir(dataPath(_lang)); + + while (!done) + { + // kill old process + delete _proc; + + // prepare new process + _proc = new TDEProcess(); + *_proc << exe << "-v" << "-c" << dataPath(_lang)+"/htdig.conf"; + if (initial) + { + *_proc << "-i"; + initial = false; + } + + kdDebug() << "Running htdig" << endl; + + connect(_proc, TQT_SIGNAL(receivedStdout(TDEProcess *,char*,int)), + this, TQT_SLOT(htdigStdout(TDEProcess *,char*,int))); + + connect(_proc, TQT_SIGNAL(processExited(TDEProcess *)), + this, TQT_SLOT(htdigExited(TDEProcess *))); + + _htdigRunning = true; + + // write out file + TQFile f(dataPath(_lang)+"/files"); + if (f.open(IO_WriteOnly)) + { + TQTextStream ts(&f); + + for (int i=0; i<CHUNK_SIZE; ++i, ++count) + if (count < _filesToDig) { + ts << "file://" + _files[count] << endl; + } else { + done = true; + break; + } + f.close(); + } + else + { + kdDebug() << "Could not open `files` for writing" << endl; + delete config; + return false; + } + + + // execute htdig + _proc->start(TDEProcess::NotifyOnExit, TDEProcess::Stdout ); + + kapp->enter_loop(); + + if (!_proc->normalExit() || _proc->exitStatus() != 0) + { + delete _proc; + delete progress; + delete config; + return false; + } + + // _filesDigged += CHUNK_SIZE; + progress->setFilesDigged(_filesDigged); + kapp->processEvents(); + } + + progress->setState(2); + + // run htmerge ----------------------------------------------------- + exe = config->readPathEntry("htmerge", kapp->dirs()->findExe("htmerge")); + if (exe.isEmpty()) + { + delete config; + return false; + } + delete _proc; + _proc = new TDEProcess(); + *_proc << exe << "-c" << dataPath(_lang)+"/htdig.conf"; + + kdDebug() << "Running htmerge" << endl; + + connect(_proc, TQT_SIGNAL(processExited(TDEProcess *)), + this, TQT_SLOT(htmergeExited(TDEProcess *))); + + _htmergeRunning = true; + + _proc->start(TDEProcess::NotifyOnExit, TDEProcess::Stdout); + + kapp->enter_loop(); + + if (!_proc->normalExit() || _proc->exitStatus() != 0) + { + delete _proc; + delete progress; + delete config; + return false; + } + + delete _proc; + + progress->setState(3); + kapp->processEvents(); + + delete progress; + delete config; + + return true; +} + + + +void HTMLSearch::htdigStdout(TDEProcess *, char *buffer, int len) +{ + TQString line = TQString(buffer).left(len); + + int cnt=0, index=-1; + while ( (index = line.find("file://", index+1)) > 0) + cnt++; + _filesDigged += cnt; + + cnt=0; + index=-1; + while ( (index = line.find("not changed", index+1)) > 0) + cnt++; + _filesDigged -= cnt; + + progress->setFilesDigged(_filesDigged); +} + + +void HTMLSearch::htdigExited(TDEProcess *p) +{ + kdDebug() << "htdig terminated " << p->exitStatus() << endl; + _htdigRunning = false; + kapp->exit_loop(); +} + + +void HTMLSearch::htmergeExited(TDEProcess *) +{ + kdDebug() << "htmerge terminated" << endl; + _htmergeRunning = false; + kapp->exit_loop(); +} + + +void HTMLSearch::htsearchStdout(TDEProcess *, char *buffer, int len) +{ + _searchResult += TQString::fromLocal8Bit(buffer,len); +} + + +void HTMLSearch::htsearchExited(TDEProcess *) +{ + kdDebug() << "htsearch terminated" << endl; + _htsearchRunning = false; + kapp->exit_loop(); +} + + +TQString HTMLSearch::search(TQString _lang, TQString words, TQString method, int matches, + TQString format, TQString sort) +{ + if (_lang == "C") + _lang = "en"; + + createConfig(_lang); + + TQString result = dataPath(_lang)+"/result.html"; + + // run htsearch ---------------------------------------------------- + TDEConfig *config = new TDEConfig("khelpcenterrc", true); + TDEConfigGroupSaver saver(config, "htdig"); + TQString exe = config->readPathEntry("htsearch", kapp->dirs()->findExe("htsearch")); + if (exe.isEmpty()) + { + delete config; + return TQString::null; + } + _proc = new TDEProcess(); + *_proc << exe << "-c" << dataPath(_lang)+"/htdig.conf" << + TQString("words=%1;method=%2;matchesperpage=%3;format=%4;sort=%5").arg(words).arg(method).arg(matches).arg(format).arg(sort); + + kdDebug() << "Running htsearch" << endl; + + connect(_proc, TQT_SIGNAL(receivedStdout(TDEProcess *,char*,int)), + this, TQT_SLOT(htsearchStdout(TDEProcess *,char*,int))); + connect(_proc, TQT_SIGNAL(processExited(TDEProcess *)), + this, TQT_SLOT(htsearchExited(TDEProcess *))); + + _htsearchRunning = true; + _searchResult = ""; + + _proc->start(TDEProcess::NotifyOnExit, TDEProcess::Stdout); + + kapp->enter_loop(); + + if (!_proc->normalExit() || _proc->exitStatus() != 0) + { + kdDebug() << "Error running htsearch... returning now" << endl; + delete _proc; + delete config; + return TQString::null; + } + + delete _proc; + + // modify the search result + _searchResult = _searchResult.replace("http://localhost/", "file:/"); + _searchResult = _searchResult.replace("Content-type: text/html", TQString::null); + + // dump the search result + TQFile f(result); + if (f.open(IO_WriteOnly)) + { + TQTextStream ts(&f); + + ts << _searchResult << endl; + + f.close(); + delete config; + return result; + } + delete config; + return TQString::null; +} diff --git a/khelpcenter/htmlsearch/htmlsearch.desktop b/khelpcenter/htmlsearch/htmlsearch.desktop new file mode 100644 index 000000000..e70b40a96 --- /dev/null +++ b/khelpcenter/htmlsearch/htmlsearch.desktop @@ -0,0 +1,239 @@ +[Desktop Entry] +Exec=tdecmshell htmlsearch +Icon=help_index +Type=Application +DocPath=kcontrol/help-index.html + +X-TDE-ModuleType=Library +X-TDE-Library=htmlsearch +X-TDE-FactoryName=htmlsearch +X-TDE-ControlModuleType=User + +Name=Index +Name[af]=Indeks +Name[ar]=الفهرس +Name[az]=İndeks +Name[be]=Індэкс +Name[bg]=Индекс +Name[bn]=সূচি +Name[br]=Meneger +Name[bs]=Indeks +Name[ca]=Índex +Name[cs]=Rejstřík +Name[csb]=Indeks +Name[cy]=Mynegai +Name[da]=Indeks +Name[de]=Stichwortverzeichnis +Name[el]=Ευρετήριο +Name[eo]=Indekso +Name[es]=Índice +Name[et]=Indeks +Name[eu]=Indizea +Name[fa]=نمایه +Name[fi]=Hakemisto +Name[fy]=Yndeks +Name[ga]=Innéacs +Name[gl]=Índice +Name[he]=אינדקס +Name[hi]=सूची +Name[hr]=Indeks +Name[hu]=Keresési index +Name[id]=Indeks +Name[is]=Yfirlit +Name[it]=Indice +Name[ja]=インデックス +Name[ka]=ინდექსი +Name[kk]=Индекс +Name[km]=លិបិក្រម +Name[ko]=찾아보기 +Name[lo]=ດັດສະນີ +Name[lt]=Rodyklė +Name[lv]=Indekss +Name[mk]=Индекс +Name[mn]=Товчоон +Name[ms]=Indeks +Name[mt]=Indiċi +Name[nb]=Indeks +Name[ne]=अनुक्रमणिका +Name[nn]=Indeks +Name[nso]=Palo ya Bangwadi +Name[pa]=ਤਤਕਰਾ +Name[pl]=Indeks +Name[pt]=Índice +Name[pt_BR]=Índice +Name[ru]=Индекс +Name[rw]=Umubarendanga +Name[se]=Indeaksa +Name[sk]=Katalóg +Name[sl]=Indeks +Name[sr]=Индекс +Name[sr@Latn]=Indeks +Name[ss]=Indzikimba +Name[ta]=பொருளடக்கம் +Name[te]=సూచిక +Name[tg]=Феҳрист +Name[th]=ดัชนี +Name[tr]=İndeks +Name[tt]=İsemlek +Name[uk]=Індекс +Name[uz]=Indeks +Name[uz@cyrillic]=Индекс +Name[ven]=Mafhelelo a bugu +Name[vi]=Danh mục +Name[wa]=Indecse +Name[xh]=Isalathiso +Name[zh_CN]=索引 +Name[zh_TW]=索引 +Name[zu]=Uhlelo lokuqukethwe + +Comment=Index generation +Comment[af]=Indeks genereering +Comment[ar]=توليد الفهارس +Comment[az]=İndeks yaratma +Comment[be]=Стварэнне індэксу +Comment[bg]=Създаване на индекс +Comment[bn]=সূচি উত্পাদন +Comment[br]=Genel ar meneger +Comment[bs]=Pravljenje indeksa +Comment[ca]=Generació de l'índex +Comment[cs]=Vytvoření rejstříku +Comment[csb]=Generowanié indeksu +Comment[cy]=Cynhyrchu mynegai +Comment[da]=Indeksgenerering +Comment[de]=Erstellung des Stichwortverzeichnisses +Comment[el]=Δημιουργία περιεχομένων +Comment[eo]=Indekskreado +Comment[es]=Generación del índice +Comment[et]=Indeksi tekitamine +Comment[eu]=Indizea sortu +Comment[fa]=تولید نمایه +Comment[fi]=Hakemiston luonti +Comment[fr]=Génération d'index +Comment[fy]=Yndeksgeneraasje +Comment[gl]=Xeración de Índices +Comment[he]=יצירת אינדקס +Comment[hi]=सूची बनाएँ +Comment[hr]=Generiranje indeksa +Comment[hu]=Index létrehozása +Comment[id]=Pembuatan Index +Comment[is]=Yfirlitsgerð +Comment[it]=Generazione dell'indice +Comment[ja]=インデックスを生成 +Comment[ka]=ინდექსის შექმნა +Comment[kk]=Индексті құру +Comment[km]=ការបង្កើតលិបិក្រម +Comment[ko]=찾아보기 생성 +Comment[lo]=ສ້າງດັດສະນີ +Comment[lt]=Rodyklės generavimas +Comment[lv]=Indeksa ģenerēšana +Comment[mk]=Генерирање на индекс +Comment[mn]=Товчоон үүсгэх +Comment[ms]=Penjanaan indeks +Comment[mt]=Ġenerazzjoni tal-Indiċi +Comment[nb]=Indekslaging +Comment[nds]=Index maken +Comment[ne]=अनुक्रमणिका उत्पादन +Comment[nl]=Indexgeneratie +Comment[nn]=Indekslaging +Comment[nso]=Thlagiso ya Palo ya Bangwadi +Comment[oc]=Generacion de l'index +Comment[pa]=ਤਤਕਰਾ ਬਣਾਓ +Comment[pl]=Generowanie indeksu +Comment[pt]=Geração de índices +Comment[pt_BR]=Geração de índice +Comment[ro]=Generează indexul +Comment[ru]=Создание индекса +Comment[rw]=Irema ry'Umubarendanga +Comment[se]=Indeaksaráhkadeapmi +Comment[sk]=Generovanie katalógu +Comment[sl]=Ustvarjanje indeksa +Comment[sr]=Генерисање индекса +Comment[sr@Latn]=Generisanje indeksa +Comment[sv]=Indexskapare +Comment[ta]=பொருளடக்க இயக்கம் +Comment[te]=సూచిక ను తయారుచెయుట +Comment[tg]=Эҷоди феҳрист +Comment[th]=สร้างดัชนี +Comment[tr]=İndeks oluşturma +Comment[tt]=İsemlek ürçetü +Comment[uk]=Утворення індексу +Comment[uz]=Indeksni yaratish +Comment[uz@cyrillic]=Индексни яратиш +Comment[ven]=Murafho wa Index +Comment[vi]=Tạo danh mục +Comment[wa]=Ahiver l' indecse +Comment[xh]=Ulwenziwo Lwesalathiso +Comment[zh_CN]=索引生成 +Comment[zh_TW]=產生索引 +Comment[zu]=Ukugaywa kohlelo lokuqukethwe + +Keywords=Help,HTML,Search,Index,htdig,htsearch,htmerge,Scope,Language +Keywords[ar]=مساعدة,HTML,بحث,فهرس,htdig,htsearch,htmerge,Scope,اللغة +Keywords[az]=Yardım,HTML,Axtar,İndeks,htdig,htmerge,Dil +Keywords[be]=Дапамога,Даведка,Пошук,Індэкс,Мова,Help,HTML,Search,Index,htdig,htsearch,htmerge,Scope,Language +Keywords[bg]=помощ, индекс, търсене, обхват, език, Help, HTML, Search, Index, htdig, htsearch, htmerge, Scope, Language +Keywords[ca]=Ajuda,HTML,Cerca,Índex,htdig,htsearch,htmerge,Scope,Llengua +Keywords[cs]=Nápověda,HTML,Hledat,Index,htdig,htsearch,htmerge,Rejstřík,Jazyk,Rozsah +Keywords[csb]=pòmòc,HTML,szëkôj,szëkba,indeks,htdig,htsearch,htmerge,òbjim,jãzëk +Keywords[cy]=Cymorth,HTML,Chwilio,Mynegai,htdig,htsearch,htmerge,Amrediad,Iaith +Keywords[da]=Hjælp,HTML,Søg,Indeks,htdig,htsearch,htmerge,Scope,Sprog +Keywords[de]=Hilfe,HTML,Suche,Index,Stichwortverzeichnis,htdig,Sprachen +Keywords[el]=Βοήθεια,HTML,Αναζήτηση,Ευρετήριο,htdig,htsearch,htmerge,Scope,Γλώσσα +Keywords[eo]=helpo,HTML,serĉo,indekso,htdig,htsearch,htmerge,areo,lingvo +Keywords[es]=Ayuda,HTML,Búsqueda,Índice,htdig,htsearch,htmerge,Ámbito,Idioma +Keywords[et]=abi,HTML,otsing,indeks,htdig,htsearch,htmerge,skoop,keel +Keywords[eu]=Laguntza,HTML,Bilatu,Indizea,htdig,htsearch,htmerge,Scope,Hizkuntza +Keywords[fa]=کمک، زنگام، جستجو، نمایه، htdig، htsearch، htmerge، دامنه، زبان +Keywords[fi]=Ohje,HTML,Etsi,Indeksi,htdig,htsearch,htmerge,Kieli +Keywords[fr]=aide,HTML,recherche,index,htdig,htsearch,htmerge,pays,langue +Keywords[fy]=help,html,zoeken,sykje,yndeks,htdig,htsearch,htmerge,scope,taal +Keywords[ga]=Cabhair,HTML,Cuardach,Innéacs,htdig,htsearch,htmerge,Scóip,Teanga +Keywords[gl]=Axuda,HTML,Procura,Índice,htdig,htsearch,htmerge,Scope,Lingua +Keywords[he]=עזרה,HTML,חיפוש,אינדקס,htdig,htsearch,htmerge,טווח,שפה,Help,Search,Index,htdig,htsearch,htmerge,Scope,Language +Keywords[hi]=मदद,एचटीएमएल,खोज,तालिका,एचटीडिक,एचटीसर्च,एचटीमर्ज,स्कोप,भाषा +Keywords[hr]=Help,HTML,Search,Index,htdig,htsearch,htmerge,Scope,Language,Pomoć,Pretraživanje,Traži,Pretraga,Indeks,Opseg,Raspon,Jezik +Keywords[hu]=segítség,HTML,keresés,index,htdig,htsearch,htmerge,érvényességi kör,nyelv +Keywords[id]=Bantuan,HTML,Cari,Indeks,htdig,htsearch,htmerge,Scope,Language +Keywords[is]=Hjálp,HTML,leit,yfirlit,htdig,svæði,tungumál +Keywords[it]=aiuto,HTML,cerca,indice,htdig,htsearch,htmerge,scope,lingua +Keywords[ja]=ヘルプ,HTML,検索,インデックス,htdig,htsearch,htmerge,スコープ,言語 +Keywords[km]=ជំនួយ,HTML,ស្វែងរក,លិបិក្រម,htdig,htsearch,htmerge,វិសាលភាព,ភាសា +Keywords[lo]=ຊ່ວຍເຫລືອ,HTML,ຄົ້ນຫາດັດສະນີ,htdig,htsearch,htmerge,Scope,ພາສາ +Keywords[lt]=Pagalba,HTML,Paieška,Sąrašas,htdig,htsearch,htmerge,Sritis,Kalba +Keywords[lv]=Palīdzība,HTML,Meklēt,Indekss,htdig,htsearch,htmerge,Mērķis,Valoda +Keywords[mk]=Help,HTML,Search,Index,htdig,htsearch,htmerge,Scope,Language, Помош,Пребарувај,Индекс,Опфат,Јазик +Keywords[mn]=Тусламж,HTML,Хайх,Товчоо,Товчоон,htdig,Хэлүүд +Keywords[mt]=Help,HTML,Search,Index,htdig,htsearch,htmerge,Scope,Language,Għajnuna,Fittex,Indiċi +Keywords[nb]=Hjelp,HTML,Søk,Indeks,htdig,htsearch,htmerge,språk +Keywords[nds]=Hülp,HTML,Söken,Index,htdig,htsearch,htmerge,Scope,Spraak +Keywords[ne]=मद्दत,HTML, खोजी, अनुक्रमणिका,htdig,htsearch,htmerge, क्षेत्र, भाषा +Keywords[nl]=help,html,zoeken,index,htdig,htsearch,htmerge,scope,taal +Keywords[nn]=hjelp,HTML,søk,indeks,htdig,htmerge,område,språk +Keywords[nso]=Thuso,HTML,Nyako,Palo ya Bangwadi,htdig,htnyako,htmerge,Scope,Leleme +Keywords[pa]=ਸਹਾਇਤਾ,HTML,Index,htdig,htsearch,htmerge,Scope,ਭਾਸ਼ਾ,ਖੋਜ +Keywords[pl]=pomoc,HTML,szukaj,indeks,htdig,htsearch,htmerge,zakres,język +Keywords[pt]=ajuda,html,procura,índice,htdig,htsearch,htmerge,âmbito,língua +Keywords[pt_BR]=Ajuda,HTML,Procurar,Índice,htdig,htsearch,htmerge,escopo,idioma +Keywords[ro]=ajutor,HTML,căutare,index,htdig,htsearch,htmerge,domeniu,limbaj +Keywords[rw]=Ifashayobora,HTML,Ishakisha,htgucukura,htgushakisha,htgukomatanya,Igishushanyombonera,Ururimi +Keywords[se]=veahkki,HTML,ohcan,indeaksa,indeksa,htdig,htmerge,gaska,giella +Keywords[sk]=Pomoc,HTML,Hľadať,Katalóg,Index,htdig,htsearch,htmerge,rozsah,jazyk,Pomocník +Keywords[sl]=Pomoč,HTML,iskanje,indeks,htdig,htsearch,htmerge,doseg,jezik +Keywords[sr]=Help,HTML,Search,Index,htdig,htsearch,htmerge,Scope,Language,помоћ,претрага,индекс,језик,опсег +Keywords[sr@Latn]=Help,HTML,Search,Index,htdig,htsearch,htmerge,Scope,Language,pomoć,pretraga,indeks,jezik,opseg +Keywords[sv]=Hjälp,HTML,Sök,Index,htdig,htsearch,htmerge,Omfång,Språk +Keywords[ta]=உதவி,HTML,தேடு,பொருளடக்கம்,htdig,htதேடு,htகல,வரையெல்லை,மொழி +Keywords[te]=సహాయం,హెచ్ టి ఎంఎల్,అన్వెషణ, సూచిక, హెచ్ టి డిగ్,హెచ్ టి అన్వెషణ,హెచ్ టి కలుపు, లక్ష్యము, భాష. +Keywords[th]=ช่วยเหลือ,HTML,ค้นหา,ดัชนี,htdig,htsearch,htmerge,Scope,ภาษา +Keywords[tr]=Yardım,HTML,Ara,İndeks,htdig,htmerge,Dil +Keywords[uk]=довідка,HTML,пошук,індекс,htdig,контекст,мова,htsearch,htmerge +Keywords[uz]=Yordam,HTML,Qidirish,Indeks,htdig,htsearch,htmerge,Til +Keywords[uz@cyrillic]=Ёрдам,HTML,Қидириш,Индекс,htdig,htsearch,htmerge,Тил +Keywords[ven]=Thuso,HTML,Toda,Mafhelelo,bwa ha ht,toda ha ht,thanganyo ya ht,zwaphanda,luambo +Keywords[vi]=Trợ giúp,HTML,Tìm kiếm,danh sách,htdig,htsearch,htmerge,Phạm vi,Ngôn ngữ +Keywords[wa]=Aide,Aidance,HTML,Trover,Indecse,htdig,htsearch,htmerge,Scope,Lingaedje +Keywords[xh]=Uncedo,HTML,Phendla,Isalathiso,htdig,htsearch,htmerge,Scope,Ulwimi +Keywords[zh_CN]=Help,HTML,Search,Index,htdig,htsearch,htmerge,Scope,Language,帮助,查找,索引,范围,语言 +Keywords[zh_TW]=Help,HTML,Search,Index,htdig,htsearch,htmerge,Scope,Language,求助,搜尋,索引,語言 +Keywords[zu]=Usizo,HTML,Usesho,Uhlelo lokuqukethwe,htdig,htsearch,htmerge, Indawo elinganiselwe,Ulimi +Categories=Qt;TDE;X-TDE-settings-system; diff --git a/khelpcenter/htmlsearch/htmlsearch.h b/khelpcenter/htmlsearch/htmlsearch.h new file mode 100644 index 000000000..37d9bf39f --- /dev/null +++ b/khelpcenter/htmlsearch/htmlsearch.h @@ -0,0 +1,64 @@ +#ifndef __HTMLSEARCH_H__ +#define __HTMLSEARCH_H__ + + +#include <tqstring.h> +#include <tqstringlist.h> + + +class TQWidget; +class TQProgressDialog; + + +class TDEProcess; + + +class ProgressDialog; + + +class HTMLSearch : public QObject +{ + Q_OBJECT + +public: + + HTMLSearch(); + + bool generateIndex(TQString lang, TQWidget *parent=0); + + TQString search(TQString lang, TQString words, TQString method="and", int matches=10, + TQString format="builtin-long", TQString sort="score"); + + +protected slots: + + void htdigStdout(TDEProcess *proc, char *buffer, int buflen); + void htdigExited(TDEProcess *proc); + void htmergeExited(TDEProcess *proc); + void htsearchStdout(TDEProcess *proc, char *buffer, int buflen); + void htsearchExited(TDEProcess *proc); + + +protected: + + TQString dataPath(const TQString& lang); + + bool saveFilesList(const TQString& lang); + void scanDir(const TQString& dir); + + bool createConfig(const TQString& lang); + + +private: + + TQStringList _files; + TDEProcess *_proc; + int _filesToDig, _filesDigged, _filesScanned; + volatile bool _htdigRunning, _htmergeRunning, _htsearchRunning; + TQString _searchResult; + ProgressDialog *progress; + +}; + + +#endif diff --git a/khelpcenter/htmlsearch/index.cpp b/khelpcenter/htmlsearch/index.cpp new file mode 100644 index 000000000..680f9f4ab --- /dev/null +++ b/khelpcenter/htmlsearch/index.cpp @@ -0,0 +1,31 @@ + +#include <tdecmdlineargs.h> +#include <tdeaboutdata.h> +#include <tdeglobal.h> +#include <tdeapplication.h> + +#include "htmlsearch.h" + +static TDECmdLineOptions options[] = +{ + { "lang <lang>", I18N_NOOP("The language to index"), "en" }, + TDECmdLineLastOption // End of options. +}; + + +int main(int argc, char *argv[]) +{ + TDEAboutData aboutData( "tdehtmlindex", I18N_NOOP("KHtmlIndex"), + "", + I18N_NOOP("TDE Index generator for help files.")); + + TDECmdLineArgs::init(argc, argv, &aboutData); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEGlobal::locale()->setMainCatalogue("htmlsearch"); + TDEApplication app; + HTMLSearch search; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + search.generateIndex(args->getOption("lang")); +} diff --git a/khelpcenter/htmlsearch/kcmhtmlsearch.cpp b/khelpcenter/htmlsearch/kcmhtmlsearch.cpp new file mode 100644 index 000000000..3db9c9895 --- /dev/null +++ b/khelpcenter/htmlsearch/kcmhtmlsearch.cpp @@ -0,0 +1,370 @@ +/** + * kcmhtmlsearch.cpp + * + * Copyright (c) 2000 Matthias Hlzer-Klpfel <hoelzer@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <tqlayout.h> +#include <kstandarddirs.h> +#include <tdelocale.h> +#include <kurllabel.h> +#include <tdeapplication.h> +#include <tqcheckbox.h> +#include <tqwhatsthis.h> +#include <tdefiledialog.h> +#include <kprocess.h> +#include "klangcombo.h" +#include <kurlrequester.h> +#include <klineedit.h> + +#include "kcmhtmlsearch.moc" + + +TDEHTMLSearchConfig::TDEHTMLSearchConfig(TQWidget *parent, const char *name) + : TDECModule(parent, name), indexProc(0) +{ + TQVBoxLayout *vbox = new TQVBoxLayout(this, 5); + + + TQGroupBox *gb = new TQGroupBox(i18n("ht://dig"), this); + vbox->addWidget(gb); + + TQGridLayout *grid = new TQGridLayout(gb, 3,2, 6,6); + + grid->addRowSpacing(0, gb->fontMetrics().lineSpacing()); + + TQLabel *l = new TQLabel(i18n("The fulltext search feature makes use of the " + "ht://dig HTML search engine. " + "You can get ht://dig at the"), gb); + l->setAlignment(TQLabel::WordBreak); + l->setMinimumSize(l->sizeHint()); + grid->addMultiCellWidget(l, 1, 1, 0, 1); + TQWhatsThis::add( gb, i18n( "Information about where to get the ht://dig package." ) ); + + KURLLabel *url = new KURLLabel(gb); + url->setURL("http://www.htdig.org"); + url->setText(i18n("ht://dig home page")); + url->setAlignment(TQLabel::AlignHCenter); + grid->addMultiCellWidget(url, 2,2, 0, 1); + connect(url, TQT_SIGNAL(leftClickedURL(const TQString&)), + this, TQT_SLOT(urlClicked(const TQString&))); + + gb = new TQGroupBox(i18n("Program Locations"), this); + + vbox->addWidget(gb); + grid = new TQGridLayout(gb, 4,2, 6,6); + grid->addRowSpacing(0, gb->fontMetrics().lineSpacing()); + + htdigBin = new KURLRequester(gb); + l = new TQLabel(htdigBin, i18n("ht&dig"), gb); + l->setBuddy( htdigBin ); + grid->addWidget(l, 1,0); + grid->addWidget(htdigBin, 1,1); + connect(htdigBin->lineEdit(), TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(configChanged())); + TQString wtstr = i18n( "Enter the path to your htdig program here, e.g. /usr/local/bin/htdig" ); + TQWhatsThis::add( htdigBin, wtstr ); + TQWhatsThis::add( l, wtstr ); + + htsearchBin = new KURLRequester(gb); + l = new TQLabel(htsearchBin, i18n("ht&search"), gb); + l->setBuddy( htsearchBin ); + grid->addWidget(l, 2,0); + grid->addWidget(htsearchBin, 2,1); + connect(htsearchBin->lineEdit(), TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(configChanged())); + wtstr = i18n( "Enter the path to your htsearch program here, e.g. /usr/local/bin/htsearch" ); + TQWhatsThis::add( htsearchBin, wtstr ); + TQWhatsThis::add( l, wtstr ); + + htmergeBin = new KURLRequester(gb); + l = new TQLabel(htmergeBin, i18n("ht&merge"), gb); + l->setBuddy( htmergeBin ); + grid->addWidget(l, 3,0); + grid->addWidget(htmergeBin, 3,1); + connect(htmergeBin->lineEdit(), TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(configChanged())); + wtstr = i18n( "Enter the path to your htmerge program here, e.g. /usr/local/bin/htmerge" ); + TQWhatsThis::add( htmergeBin, wtstr ); + TQWhatsThis::add( l, wtstr ); + + TQHBoxLayout *hbox = new TQHBoxLayout(vbox); + + gb = new TQGroupBox(i18n("Scope"), this); + hbox->addWidget(gb); + TQWhatsThis::add( gb, i18n( "Here you can select which parts of the documentation should be included in the fulltext search index. Available options are the TDE Help pages, the installed man pages, and the installed info pages. You can select any number of these." ) ); + + TQVBoxLayout *vvbox = new TQVBoxLayout(gb, 6,2); + vvbox->addSpacing(gb->fontMetrics().lineSpacing()); + + indexKDE = new TQCheckBox(i18n("&TDE help"), gb); + vvbox->addWidget(indexKDE); + connect(indexKDE, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + + indexMan = new TQCheckBox(i18n("&Man pages"), gb); + vvbox->addWidget(indexMan); + indexMan->setEnabled(false), + connect(indexMan, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + + indexInfo = new TQCheckBox(i18n("&Info pages"), gb); + vvbox->addWidget(indexInfo); + indexInfo->setEnabled(false); + connect(indexInfo, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); + + gb = new TQGroupBox(i18n("Additional Search Paths"), this); + hbox->addWidget(gb); + TQWhatsThis::add( gb, i18n( "Here you can add additional paths to search for documentation. To add a path, click on the <em>Add...</em> button and select the folder from where additional documentation should be searched. You can remove folders by clicking on the <em>Delete</em> button." ) ); + + grid = new TQGridLayout(gb, 4,3, 6,2); + grid->addRowSpacing(0, gb->fontMetrics().lineSpacing()); + + addButton = new TQPushButton(i18n("Add..."), gb); + grid->addWidget(addButton, 1,0); + + delButton = new TQPushButton(i18n("Delete"), gb); + grid->addWidget(delButton, 2,0); + + searchPaths = new TDEListBox(gb); + grid->addMultiCellWidget(searchPaths, 1,3, 1,1); + grid->setRowStretch(2,2); + + gb = new TQGroupBox(i18n("Language Settings"), this); + vbox->addWidget(gb); + TQWhatsThis::add(gb, i18n("Here you can select the language you want to create the index for.")); + language = new KLanguageCombo(gb); + l = new TQLabel(language, i18n("&Language"), gb); + vvbox = new TQVBoxLayout(gb, 6,2); + vvbox->addSpacing(gb->fontMetrics().lineSpacing()); + hbox = new TQHBoxLayout(vvbox, 6); + hbox->addWidget(l); + hbox->addWidget(language,1); + hbox->addStretch(1); + + loadLanguages(); + + vbox->addStretch(1); + + runButton = new TQPushButton(i18n("Generate Index..."), this); + TQWhatsThis::add( runButton, i18n( "Click this button to generate the index for the fulltext search." ) ); + runButton->setFixedSize(runButton->sizeHint()); + vbox->addWidget(runButton, AlignRight); + connect(runButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(generateIndex())); + + connect(addButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(addClicked())); + connect(delButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(delClicked())); + connect(searchPaths, TQT_SIGNAL(highlighted(const TQString &)), + this, TQT_SLOT(pathSelected(const TQString &))); + + checkButtons(); + + load(); +} + + +void TDEHTMLSearchConfig::loadLanguages() +{ + // clear the list + language->clear(); + + // add all languages to the list + TQStringList langs = TDEGlobal::dirs()->findAllResources("locale", + TQString::fromLatin1("*/entry.desktop")); + langs.sort(); + + for (TQStringList::ConstIterator it = langs.begin(); it != langs.end(); ++it) + { + KSimpleConfig entry(*it); + entry.setGroup(TQString::fromLatin1("KCM Locale")); + TQString name = entry.readEntry(TQString::fromLatin1("Name"), TDEGlobal::locale()->translate("without name")); + + TQString path = *it; + int index = path.findRev('/'); + path = path.left(index); + index = path.findRev('/'); + path = path.mid(index+1); + language->insertLanguage(path, name); + } +} + + +TQString TDEHTMLSearchConfig::quickHelp() const +{ + return i18n( "<h1>Help Index</h1> This configuration module lets you configure the ht://dig engine which can be used for fulltext search in the TDE documentation as well as other system documentation like man and info pages." ); +} + + +void TDEHTMLSearchConfig::pathSelected(const TQString &) +{ + checkButtons(); +} + + +void TDEHTMLSearchConfig::checkButtons() +{ + + delButton->setEnabled(searchPaths->currentItem() >= 0); +} + + +void TDEHTMLSearchConfig::addClicked() +{ + TQString dir = KFileDialog::getExistingDirectory(); + + if (!dir.isEmpty()) + { + for (uint i=0; i<searchPaths->count(); ++i) + if (searchPaths->text(i) == dir) + return; + searchPaths->insertItem(dir); + configChanged(); + } +} + + +void TDEHTMLSearchConfig::delClicked() +{ + searchPaths->removeItem(searchPaths->currentItem()); + checkButtons(); + configChanged(); +} + + +TDEHTMLSearchConfig::~TDEHTMLSearchConfig() +{ +} + + +void TDEHTMLSearchConfig::configChanged() +{ + emit changed(true); +} + + +void TDEHTMLSearchConfig::load() +{ + TDEConfig *config = new TDEConfig("khelpcenterrc", true); + + config->setGroup("htdig"); + htdigBin->lineEdit()->setText(config->readPathEntry("htdig", kapp->dirs()->findExe("htdig"))); + htsearchBin->lineEdit()->setText(config->readPathEntry("htsearch", kapp->dirs()->findExe("htsearch"))); + htmergeBin->lineEdit()->setText(config->readPathEntry("htmerge", kapp->dirs()->findExe("htmerge"))); + + config->setGroup("Scope"); + indexKDE->setChecked(config->readBoolEntry("KDE", true)); + indexMan->setChecked(config->readBoolEntry("Man", false)); + indexInfo->setChecked(config->readBoolEntry("Info", false)); + + TQStringList l = config->readPathListEntry("Paths"); + searchPaths->clear(); + TQStringList::Iterator it; + for (it=l.begin(); it != l.end(); ++it) + searchPaths->insertItem(*it); + + config->setGroup("Locale"); + TQString lang = config->readEntry("Search Language", TDEGlobal::locale()->language()); + language->setCurrentItem(lang); + + emit changed(false); +} + + +void TDEHTMLSearchConfig::save() +{ + TDEConfig *config= new TDEConfig("khelpcenterrc", false); + + config->setGroup("htdig"); + config->writePathEntry("htdig", htdigBin->lineEdit()->text()); + config->writePathEntry("htsearch", htsearchBin->lineEdit()->text()); + config->writePathEntry("htmerge", htmergeBin->lineEdit()->text()); + + config->setGroup("Scope"); + config->writeEntry("KDE", indexKDE->isChecked()); + config->writeEntry("Man", indexMan->isChecked()); + config->writeEntry("Info", indexInfo->isChecked()); + + TQStringList l; + for (uint i=0; i<searchPaths->count(); ++i) + l.append(searchPaths->text(i)); + config->writePathEntry("Paths", l); + + config->setGroup("Locale"); + config->writeEntry("Search Language", language->currentTag()); + + config->sync(); + delete config; + + emit changed(false); +} + + +void TDEHTMLSearchConfig::defaults() +{ + htdigBin->lineEdit()->setText(kapp->dirs()->findExe("htdig")); + htsearchBin->lineEdit()->setText(kapp->dirs()->findExe("htsearch")); + htmergeBin->lineEdit()->setText(kapp->dirs()->findExe("htmerge")); + + indexKDE->setChecked(true); + indexMan->setChecked(false); + indexInfo->setChecked(false); + + searchPaths->clear(); + + language->setCurrentItem(TDEGlobal::locale()->language()); + + emit changed(true); +} + + +void TDEHTMLSearchConfig::urlClicked(const TQString &url) +{ + kapp->invokeBrowser(url); +} + + +void TDEHTMLSearchConfig::generateIndex() +{ + save(); + + TQString exe = kapp->dirs()->findExe("tdehtmlindex"); + if (exe.isEmpty()) + return; + + delete indexProc; + + indexProc = new TDEProcess; + *indexProc << exe << "--lang" << language->currentTag(); + + connect(indexProc, TQT_SIGNAL(processExited(TDEProcess *)), + this, TQT_SLOT(indexTerminated(TDEProcess *))); + + runButton->setEnabled(false); + + indexProc->start(); +} + + +void TDEHTMLSearchConfig::indexTerminated(TDEProcess *) +{ + runButton->setEnabled(true); +} + + +extern "C" +{ + KDE_EXPORT TDECModule *create_htmlsearch(TQWidget *parent, const char *name) + { + TDEGlobal::locale()->insertCatalogue("kcmhtmlsearch"); + return new TDEHTMLSearchConfig(parent, name); + }; +} diff --git a/khelpcenter/htmlsearch/kcmhtmlsearch.h b/khelpcenter/htmlsearch/kcmhtmlsearch.h new file mode 100644 index 000000000..28445437a --- /dev/null +++ b/khelpcenter/htmlsearch/kcmhtmlsearch.h @@ -0,0 +1,81 @@ +/** + * kcmhtmlsearch.h + * + * Copyright (c) 2000 Matthias Hlzer-Klpfel <hoelzer@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __kcmhtmlsearch_h__ +#define __kcmhtmlsearch_h__ + + +#include <tdecmodule.h> + + +class TQLineEdit; +class TQCheckBox; +class TQPushButton; +class TDEListBox; +class TDEProcess; +class KLanguageCombo; +class KURLRequester; + +class TDEHTMLSearchConfig : public TDECModule +{ + Q_OBJECT + +public: + + TDEHTMLSearchConfig(TQWidget *parent = 0L, const char *name = 0L); + virtual ~TDEHTMLSearchConfig(); + + void load(); + void save(); + void defaults(); + + TQString quickHelp() const; + + int buttons(); + + +protected slots: + + void configChanged(); + void addClicked(); + void delClicked(); + void pathSelected(const TQString &); + void urlClicked(const TQString&); + void generateIndex(); + + void indexTerminated(TDEProcess *proc); + + +private: + + void checkButtons(); + void loadLanguages(); + + KURLRequester *htdigBin, *htsearchBin, *htmergeBin; + TQCheckBox *indexKDE, *indexMan, *indexInfo; + TQPushButton *addButton, *delButton, *runButton; + TDEListBox *searchPaths; + KLanguageCombo *language; + + TDEProcess *indexProc; + +}; + +#endif diff --git a/khelpcenter/htmlsearch/klangcombo.cpp b/khelpcenter/htmlsearch/klangcombo.cpp new file mode 100644 index 000000000..308109d12 --- /dev/null +++ b/khelpcenter/htmlsearch/klangcombo.cpp @@ -0,0 +1,52 @@ +/* + * klangcombo.cpp - Adds some methods for inserting languages. + * + * Copyright (c) 1999-2000 Hans Petter Bieker <bieker@kde.org> + * + * Requires the Qt widget libraries, available at no cost at + * http://www.troll.no/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <tqiconset.h> + +#include <kstandarddirs.h> + +#include "klangcombo.h" +#include "klangcombo.moc" + +KLanguageCombo::~KLanguageCombo () +{ +} + +KLanguageCombo::KLanguageCombo (TQWidget * parent, const char *name) + : KTagComboBox(parent, name) +{ +} + +void KLanguageCombo::insertLanguage(const TQString& path, const TQString& name, const TQString& sub, const TQString &submenu, int index) +{ + TQString output = name + TQString::fromLatin1(" (") + path + TQString::fromLatin1(")"); + TQPixmap flag(locate("locale", sub + path + TQString::fromLatin1("/flag.png"))); + insertItem(TQIconSet(flag), output, path, submenu, index); +} + +void KLanguageCombo::changeLanguage(const TQString& name, int i) +{ + if (i < 0 || i >= count()) return; + TQString output = name + TQString::fromLatin1(" (") + tag(i) + TQString::fromLatin1(")"); + changeItem(output, i); +} diff --git a/khelpcenter/htmlsearch/klangcombo.h b/khelpcenter/htmlsearch/klangcombo.h new file mode 100644 index 000000000..4ca6e2f3b --- /dev/null +++ b/khelpcenter/htmlsearch/klangcombo.h @@ -0,0 +1,47 @@ +/* + * klangcombo.h - Adds some methods for inserting languages. + * + * Copyright (c) 1999-2000 Hans Petter Bieker <bieker@kde.org> + * + * Requires the Qt widget libraries, available at no cost at + * http://www.troll.no/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +#ifndef __KLANGCOMBO_H__ +#define __KLANGCOMBO_H__ + +#include "ktagcombobox.h" + +/* + * Extends KTagCombo to support adding and changing languages. + * + * It has also support for sub menues. + */ +class KLanguageCombo : public KTagComboBox +{ + Q_OBJECT + +public: + KLanguageCombo(TQWidget *parent=0, const char *name=0); + ~KLanguageCombo(); + + void insertLanguage(const TQString& path, const TQString& name, const TQString& sub = TQString::null, const TQString &submenu = TQString::null, int index = -1); + void changeLanguage(const TQString& name, int i); +}; + +#endif diff --git a/khelpcenter/htmlsearch/ktagcombobox.cpp b/khelpcenter/htmlsearch/ktagcombobox.cpp new file mode 100644 index 000000000..b3c70915c --- /dev/null +++ b/khelpcenter/htmlsearch/ktagcombobox.cpp @@ -0,0 +1,252 @@ +/* + * ktagcombobox.cpp - A combobox with support for submenues, icons and tags + * + * Copyright (c) 1999-2000 Hans Petter Bieker <bieker@kde.org> + * + * Requires the Qt widget libraries, available at no cost at + * http://www.troll.no/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#define INCLUDE_MENUITEM_DEF 1 +#include <tqpainter.h> +#include <tqpopupmenu.h> + +#include <kdebug.h> + +#include "ktagcombobox.h" +#include "ktagcombobox.moc" + +KTagComboBox::~KTagComboBox () +{ + delete popup; + delete tags; +} + +KTagComboBox::KTagComboBox (TQWidget * parent, const char *name) + : TQComboBox(parent, name), + popup(0), + old_popup(0) +{ + tags = new TQStringList; + + clear(); +} + +void KTagComboBox::popupMenu() +{ + popup->popup( mapToGlobal( TQPoint(0,0) ), current ); +} + +void KTagComboBox::keyPressEvent( TQKeyEvent *e ) +{ + int c; + + if ( ( e->key() == Key_F4 && e->state() == 0 ) || + ( e->key() == Key_Down && (e->state() & AltButton) ) || + ( e->key() == Key_Space ) ) { + if ( count() ) { + popup->setActiveItem( current ); + popupMenu(); + } + return; + } else { + e->ignore(); + return; + } + + c = currentItem(); + emit highlighted( c ); + emit activated( c ); +} + +void KTagComboBox::mousePressEvent( TQMouseEvent * ) +{ + popupMenu(); +} + +void KTagComboBox::internalActivate( int index ) +{ + if (current == index) return; + current = index; + emit activated( index ); + repaint(); +} + +void KTagComboBox::internalHighlight( int index ) +{ + emit highlighted( index ); +} + +void KTagComboBox::clear() +{ + tags->clear(); + + delete old_popup; + old_popup = popup; + popup = new TQPopupMenu(this); + connect( popup, TQT_SIGNAL(activated(int)), + TQT_SLOT(internalActivate(int)) ); + connect( popup, TQT_SIGNAL(highlighted(int)), + TQT_SLOT(internalHighlight(int)) ); +} + +int KTagComboBox::count() const +{ + return tags->count(); +} + +static inline void checkInsertPos(TQPopupMenu *popup, const TQString & str, int &index) +{ + if (index == -2) index = popup->count(); + if (index != -1) return; + + int a = 0; + int b = popup->count(); + while (a <= b) { + int w = (a + b) / 2; + + int id = popup->idAt(w); + int j = str.compare(popup->text(id)); + + if (j > 0) + a = w + 1; + else + b = w - 1; + } + + index = a; // it doesn't really matter ... a == b here. +} + +static inline TQPopupMenu *checkInsertIndex(TQPopupMenu *popup, const TQStringList *tags, const TQString &submenu) +{ + int pos = tags->findIndex(submenu); + + TQPopupMenu *pi = 0; + if (pos != -1) + { + TQMenuItem *p = popup->findItem(pos); + pi = p?p->popup():0; + } + if (!pi) pi = popup; + + return pi; +} + +void KTagComboBox::insertItem(const TQIconSet& icon, const TQString &text, const TQString &tag, const TQString &submenu, int index ) +{ + TQPopupMenu *pi = checkInsertIndex(popup, tags, submenu); + checkInsertPos(pi, text, index); + pi->insertItem(icon, text, count(), index); + tags->append(tag); +} + +void KTagComboBox::insertItem(const TQString &text, const TQString &tag, const TQString &submenu, int index ) +{ + TQPopupMenu *pi = checkInsertIndex(popup, tags, submenu); + checkInsertPos(pi, text, index); + pi->insertItem(text, count(), index); + tags->append(tag); +} + +void KTagComboBox::insertSeparator(const TQString &submenu, int index) +{ + TQPopupMenu *pi = checkInsertIndex(popup, tags, submenu); + pi->insertSeparator(index); + tags->append(TQString::null); +} + +void KTagComboBox::insertSubmenu(const TQString &text, const TQString &tag, const TQString &submenu, int index) +{ + TQPopupMenu *pi = checkInsertIndex(popup, tags, submenu); + TQPopupMenu *p = new TQPopupMenu(pi); + checkInsertPos(pi, text, index); + pi->insertItem(text, p, count(), index); + tags->append(tag); + connect( p, TQT_SIGNAL(activated(int)), + TQT_SLOT(internalActivate(int)) ); + connect( p, TQT_SIGNAL(highlighted(int)), + TQT_SLOT(internalHighlight(int)) ); +} + +void KTagComboBox::paintEvent( TQPaintEvent * ev) +{ + TQComboBox::paintEvent(ev); + + TQPainter p (this); + + // Text + TQRect clip(2, 2, width() - 4, height() - 4); +#if 0 + if ( hasFocus() && style().guiStyle() != MotifStyle ) + p.setPen( colorGroup().highlightedText() ); +#endif + p.drawText(clip, AlignCenter | SingleLine, popup->text( current )); + + // Icon + TQIconSet *icon = popup->iconSet( this->current ); + if (icon) { + TQPixmap pm = icon->pixmap(); + p.drawPixmap( 4, (height()-pm.height())/2, pm ); + } +} + +bool KTagComboBox::containsTag( const TQString &str ) const +{ + return tags-.contains(str) > 0; +} + +TQString KTagComboBox::currentTag() const +{ + return *tags->at(currentItem()); +} + +TQString KTagComboBox::tag(int i) const +{ + if (i < 0 || i >= count()) + { + kdDebug() << "KTagComboBox::tag(), unknown tag " << i << endl; + return TQString::null; + } + return *tags->at(i); +} + +int KTagComboBox::currentItem() const +{ + return current; +} + +void KTagComboBox::setCurrentItem(int i) +{ + if (i < 0 || i >= count()) return; + current = i; + repaint(); +} + +void KTagComboBox::setCurrentItem(const TQString &code) +{ + int i = tags->findIndex(code); + if (code.isNull()) + i = 0; + if (i != -1) + setCurrentItem(i); +} + +void KTagComboBox::setFont( const TQFont &font ) +{ + TQComboBox::setFont( font ); + popup->setFont( font ); +} diff --git a/khelpcenter/htmlsearch/ktagcombobox.h b/khelpcenter/htmlsearch/ktagcombobox.h new file mode 100644 index 000000000..df58120ce --- /dev/null +++ b/khelpcenter/htmlsearch/ktagcombobox.h @@ -0,0 +1,92 @@ +/* + * ktagcombobox.h - A combobox with support for submenues, icons and tags + * + * Copyright (c) 1999-2000 Hans Petter Bieker <bieker@kde.org> + * + * Requires the Qt widget libraries, available at no cost at + * http://www.troll.no/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +#ifndef __KTAGCOMBOBOX_H__ +#define __KTAGCOMBOBOX_H__ + +#include <tqcombobox.h> + +class TQPopupMenu; + +/* + * This class should be just like qcombobox, but it should be possible + * to have have a TQIconSet for each entry, and each entry should have a tag. + * + * It has also support for sub menues. + */ +class KTagComboBox : public QComboBox +{ + Q_OBJECT + +public: + KTagComboBox(TQWidget *parent=0, const char *name=0); + ~KTagComboBox(); + + void insertItem(const TQIconSet& icon, const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1 ); + void insertItem(const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1 ); + void insertSeparator(const TQString &submenu = TQString::null, int index=-1 ); + void insertSubmenu(const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1); + + int count() const; + void clear(); + + /* + * Tag of the selected item + */ + TQString currentTag() const; + TQString tag ( int i ) const; + bool containsTag (const TQString &str ) const; + + /* + * Set the current item + */ + int currentItem() const; + void setCurrentItem(int i); + void setCurrentItem(const TQString &code); + + // widget stuff + virtual void setFont( const TQFont & ); + +signals: + void activated( int index ); + void highlighted( int index ); + +private slots: + void internalActivate( int ); + void internalHighlight( int ); + +protected: + void paintEvent( TQPaintEvent * ); + void mousePressEvent( TQMouseEvent * ); + void keyPressEvent( TQKeyEvent *e ); + void popupMenu(); + +private: + // work space for the new class + TQStringList *tags; + TQPopupMenu *popup, *old_popup; + int current; +}; + +#endif diff --git a/khelpcenter/htmlsearch/long.html b/khelpcenter/htmlsearch/long.html new file mode 100644 index 000000000..1d0fa4cec --- /dev/null +++ b/khelpcenter/htmlsearch/long.html @@ -0,0 +1,6 @@ +<dl><dt><strong><a href="$&(URL)">$&(TITLE)</a></strong>$(STARSLEFT) +</dt><dd>$(EXCERPT)<br> +<i><a href="$&(URL)">$&(URL)</a></i> +<font size="-1">$(MODIFIED), $(SIZE) bytes</font> +</dd></dl> + diff --git a/khelpcenter/htmlsearch/meinproc_wrapper b/khelpcenter/htmlsearch/meinproc_wrapper new file mode 100644 index 000000000..239cf7462 --- /dev/null +++ b/khelpcenter/htmlsearch/meinproc_wrapper @@ -0,0 +1,4 @@ +#! /bin/sh + +file=`echo $3 | sed -e "s#http://localhost/#/#; s#file:/*#/#"` +meinproc --htdig $file diff --git a/khelpcenter/htmlsearch/nomatch.html b/khelpcenter/htmlsearch/nomatch.html new file mode 100644 index 000000000..305927030 --- /dev/null +++ b/khelpcenter/htmlsearch/nomatch.html @@ -0,0 +1,21 @@ +<html><head><title>No match for '$&(LOGICAL_WORDS)'</title></head> +<body bgcolor="#ffffff" text="#000000" link="#aa0000"> +<h1><img src="htdig.gif"> +Search results</h1> +<hr noshade size="4"> +<h2>No matches were found for '$&(LOGICAL_WORDS)'</h2> +<p> +Check the spelling of the search word(s) you used. +If the spelling is correct and you only used one word, +try using one or more similar search words with "<b>Any</b>." +</p><p> +If the spelling is correct and you used more than one +word with "<b>Any</b>," try using one or more similar search +words with "<b>Any</b>."</p><p> +If the spelling is correct and you used more than one +word with "<b>All</b>," try using one or more of the same words +with "<b>Any</b>."</p> +<hr noshade size="4"> +<a href="http://www.htdig.org/"> +<img src="htdig.gif" border="0">ht://Dig $(VERSION)</a> +</body></html> diff --git a/khelpcenter/htmlsearch/progressdialog.cpp b/khelpcenter/htmlsearch/progressdialog.cpp new file mode 100644 index 000000000..33a783127 --- /dev/null +++ b/khelpcenter/htmlsearch/progressdialog.cpp @@ -0,0 +1,76 @@ +#include <tqlayout.h> +#include <tqlabel.h> + + +#include <tdelocale.h> +#include <kprogress.h> +#include <kstandarddirs.h> + + +#include "progressdialog.moc" + + +ProgressDialog::ProgressDialog(TQWidget *parent, const char *name) + : KDialogBase(KDialogBase::Plain, i18n("Generating Index"), Cancel, Cancel, + parent, name, false) +{ + TQGridLayout *grid = new TQGridLayout(plainPage(), 5,3, spacingHint()); + + TQLabel *l = new TQLabel(i18n("Scanning for files"), plainPage()); + grid->addMultiCellWidget(l, 0,0, 1,2); + + filesScanned = new TQLabel(plainPage()); + grid->addWidget(filesScanned, 1,2); + setFilesScanned(0); + + check1 = new TQLabel(plainPage()); + grid->addWidget(check1, 0,0); + + l = new TQLabel(i18n("Extracting search terms"), plainPage()); + grid->addMultiCellWidget(l, 2,2, 1,2); + + bar = new KProgress(plainPage()); + grid->addWidget(bar, 3,2); + + check2 = new TQLabel(plainPage()); + grid->addWidget(check2, 2,0); + + l = new TQLabel(i18n("Generating index..."), plainPage()); + grid->addMultiCellWidget(l, 4,4, 1,2); + + check3 = new TQLabel(plainPage()); + grid->addWidget(check3, 4,0); + + setState(0); + + setMinimumWidth(300); +} + + +void ProgressDialog::setFilesScanned(int n) +{ + filesScanned->setText(i18n("Files processed: %1").arg(n)); +} + + +void ProgressDialog::setFilesToDig(int n) +{ + bar->setTotalSteps(n); +} + + +void ProgressDialog::setFilesDigged(int n) +{ + bar->setProgress(n); +} + + +void ProgressDialog::setState(int n) +{ + TQPixmap unchecked = TQPixmap(locate("data", "khelpcenter/pics/unchecked.xpm")); + TQPixmap checked = TQPixmap(locate("data", "khelpcenter/pics/checked.xpm")); + + check1->setPixmap( n > 0 ? checked : unchecked); + check2->setPixmap( n > 1 ? checked : unchecked); + check3->setPixmap( n > 2 ? checked : unchecked); +} diff --git a/khelpcenter/htmlsearch/progressdialog.h b/khelpcenter/htmlsearch/progressdialog.h new file mode 100644 index 000000000..9ab5660d9 --- /dev/null +++ b/khelpcenter/htmlsearch/progressdialog.h @@ -0,0 +1,35 @@ +#ifndef __PROGRESS_DIALOG_H__ +#define __PROGRESS_DIALOG_H__ + + +#include <kdialogbase.h> + + +class TQLabel; +class KProgress; + + +class ProgressDialog : public KDialogBase +{ + + Q_OBJECT + +public: + + ProgressDialog(TQWidget *parent=0, const char *name=0); + + void setFilesScanned(int s); + void setFilesToDig(int d); + void setFilesDigged(int d); + + void setState(int n); + +private: + + TQLabel *filesScanned, *check1, *check2, *check3; + KProgress *bar; + +}; + + +#endif diff --git a/khelpcenter/htmlsearch/short.html b/khelpcenter/htmlsearch/short.html new file mode 100644 index 000000000..e3e5e447f --- /dev/null +++ b/khelpcenter/htmlsearch/short.html @@ -0,0 +1 @@ +$(STARSRIGHT) <strong><a href="$&(URL)">$&(TITLE)</a></strong><br> diff --git a/khelpcenter/htmlsearch/star.png b/khelpcenter/htmlsearch/star.png Binary files differnew file mode 100644 index 000000000..5e7615871 --- /dev/null +++ b/khelpcenter/htmlsearch/star.png diff --git a/khelpcenter/htmlsearch/star_blank.png b/khelpcenter/htmlsearch/star_blank.png Binary files differnew file mode 100644 index 000000000..2689281af --- /dev/null +++ b/khelpcenter/htmlsearch/star_blank.png diff --git a/khelpcenter/htmlsearch/syntax.html b/khelpcenter/htmlsearch/syntax.html new file mode 100644 index 000000000..e724fd90c --- /dev/null +++ b/khelpcenter/htmlsearch/syntax.html @@ -0,0 +1,19 @@ +<html><head><title>Error in Boolean search for '$&(WORDS)'</title></head> +<body bgcolor="#ffffff" text="#000000" link="#aa0000"> +<h1><img src="htdig.gif"> +Error in Boolean search for '$&(LOGICAL_WORDS)'</h1> +<hr noshade size="4"> +Boolean expressions need to be 'correct' in order for the search +system to use them. +The expression you entered has errors in it.<p> +Examples of correct expressions are: <b>cat and dog</b>, <b>cat +not dog</b>, <b>cat or (dog not nose)</b>.<br>Note that +the operator <b>not</b> has the meaning of 'without'. +<blockquote><b> +$(SYNTAXERROR) +</b></blockquote> +<hr noshade size="4"> +<a href="http://www.htdig.org/"> +<img src="htdig.gif" border="0">ht://Dig $(VERSION)</a> +</body></html> + diff --git a/khelpcenter/htmlsearch/unchecked.xpm b/khelpcenter/htmlsearch/unchecked.xpm new file mode 100644 index 000000000..e447281a9 --- /dev/null +++ b/khelpcenter/htmlsearch/unchecked.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char*unchecked[]={ +"16 16 3 1", +"# c #000000", +"+ c #ffffff", +". c None", +"................", +"................", +"..++++++++++++..", +"..+##########+..", +"..+#++++++++#+..", +"..+#+......+#+..", +"..+#+......+#+..", +"..+#+......+#+..", +"..+#+......+#+..", +"..+#+......+#+..", +"..+#+......+#+..", +"..+#++++++++#+..", +"..+##########+..", +"..++++++++++++..", +"................", +"................"}; diff --git a/khelpcenter/htmlsearch/wrapper.html b/khelpcenter/htmlsearch/wrapper.html new file mode 100644 index 000000000..251266ded --- /dev/null +++ b/khelpcenter/htmlsearch/wrapper.html @@ -0,0 +1,16 @@ +<html><head><title>Search results for '$&(WORDS)'</title></head> +<body bgcolor="#ffffff" text="#000000" link="#aa0000"> +<h2><img src="htdig.gif"> +Search results for '$&(LOGICAL_WORDS)'</h2> +<hr noshade size="4"> +<b> +More <img src="reload.png" alt="*">'s indicate a better match. +</b> +<hr noshade size="1"> +$(HTSEARCH_RESULTS) +$(PAGEHEADER) +$(PREVPAGE) $(PAGELIST) $(NEXTPAGE) +<hr noshade size="4"> +<a href="http://www.htdig.org/"> +<img src="htdig.gif" border="0">ht://Dig $(VERSION)</a> +</body></html> |