]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlBibtex.C
port the graphics dialog to the new scheme and get rid of the ControlInset
[lyx.git] / src / frontends / controllers / ControlBibtex.C
1 /**
2  * \file ControlBibtex.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  * \author Angus Leeming
8  * \author Herbert Voss
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #include <config.h>
14
15 #include "ControlBibtex.h"
16 #include "Kernel.h"
17
18 #include "buffer.h"
19 #include "lyxrc.h"
20 #include "helper_funcs.h"
21 #include "tex_helpers.h"
22 #include "gettext.h"
23
24 using std::pair;
25
26
27 ControlBibtex::ControlBibtex(Dialog & d)
28         : ControlCommand(d, "bibtex")
29 {}
30
31
32 string const ControlBibtex::Browse(string const & in_name,
33                                    string const & title,
34                                    string const & pattern)
35 {
36         pair<string, string> dir1(_("Documents|#o#O"),
37                                   string(lyxrc.document_path));
38         return browseRelFile(in_name, kernel().buffer()->filePath(),
39                              title, pattern, false, dir1);
40 }
41
42
43 string const ControlBibtex::getBibStyles() const
44 {
45         string list = getTexFileList("bstFiles.lst", false);
46         // test, if we have a valid list, otherwise run rescan
47         if (list.empty()) {
48                 rescanBibStyles();
49                 list = getTexFileList("bstFiles.lst", false);
50         }
51         return list;
52 }
53
54
55 string const ControlBibtex::getBibFiles() const
56 {
57         string list = getTexFileList("bibFiles.lst", false);
58         // test, if we have a valid list, otherwise run rescan
59         if (list.empty()) {
60                 rescanBibStyles();
61                 list = getTexFileList("bibFiles.lst", false);
62         }
63         return list;
64 }
65
66
67 void ControlBibtex::rescanBibStyles() const
68 {
69         rescanTexStyles();
70 }