1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 * ======================================================
10 * \file ControlTexinfo.C
11 * \author Herbert Voss <voss@lyx.org>
17 #pragma implementation
21 #include "ButtonControllerBase.h"
22 #include "ControlTexinfo.h"
26 #include "BufferView.h"
28 #include "support/filetools.h" // FileSearch
30 #include "support/syscall.h"
31 #include "support/path.h"
32 #include "lyx_gui_misc.h"
34 extern string system_lyxdir;
35 extern string user_lyxdir;
36 extern string help_lyxdir;
40 ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d)
41 : ControlDialog<ControlConnectBI>(lv, d)
43 d_.showTexinfo.connect(SigC::slot(this, &ControlTexinfo::show));
46 // build filelists of all availabe bst/cls/sty-files. done through
47 // kpsewhich and an external script, saved in *Files.lst
48 void ControlTexinfo::rescanStyles()
50 // Run rescan in user lyx directory
52 Systemcalls one(Systemcalls::System,
53 AddName(system_lyxdir,"TeXFiles.sh"));
57 void ControlTexinfo::runTexhash()
59 // Run texhash in user lyx directory
62 //path to texhash through system
63 Systemcalls one(Systemcalls::System,"texhash");
65 // WriteAlert(_("texhash run!"),
66 // _("rebuilding of the TeX-tree could only be successfull"),
67 // _("if you have had user-write-permissions to the tex-dir."));
71 void ControlTexinfo::viewFile(string const filename)
73 lv_.getDialogs()->showFile(filename);
76 void ControlTexinfo::help()
78 lv_.getDialogs()->showFile(help_lyxdir+"Texinfo.hlp");