]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTexinfo.C
959b874c362f6708c96a316e1da34add8ffd1483
[lyx.git] / src / frontends / controllers / ControlTexinfo.C
1 /* This file is part of
2  * ====================================================== 
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \file ControlTexinfo.C
11  * \author Herbert Voss <voss@lyx.org>
12  */
13
14 #include <config.h>
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include "ViewBase.h"
21 #include "ButtonControllerBase.h"
22 #include "ControlTexinfo.h"
23 #include "Dialogs.h"
24 #include "LyXView.h"
25 #include "Lsstream.h"
26 #include "BufferView.h"
27 #include "gettext.h"
28 #include "support/filetools.h" // FileSearch
29 #include "version.h"
30 #include "support/syscall.h"
31 #include "support/path.h"
32 #include "lyx_gui_misc.h"
33
34 extern string system_lyxdir;
35 extern string user_lyxdir;
36 extern string help_lyxdir;
37
38 using SigC::slot;
39
40 ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d)
41                         : ControlDialog<ControlConnectBI>(lv, d)
42 {
43         d_.showTexinfo.connect(SigC::slot(this, &ControlTexinfo::show));
44 }
45
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()
49 {
50         // Run rescan in user lyx directory
51         Path p(user_lyxdir);
52         Systemcalls one(Systemcalls::System,
53                         AddName(system_lyxdir,"TeXFiles.sh"));
54         p.pop();
55 }
56
57 void ControlTexinfo::runTexhash()
58 {
59         // Run texhash in user lyx directory
60         Path p(user_lyxdir);
61
62         //path to texhash through system
63         Systemcalls one(Systemcalls::System,"texhash"); 
64         p.pop();
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."));
68 }
69
70
71 void ControlTexinfo::viewFile(string const filename)
72 {
73         lv_.getDialogs()->showFile(filename);
74 }
75
76 void ControlTexinfo::help()
77 {
78         lv_.getDialogs()->showFile(help_lyxdir+"Texinfo.hlp");
79 }