]> git.lyx.org Git - features.git/blob - src/frontends/controllers/ControlBibtex.C
*duck*
[features.git] / src / frontends / controllers / ControlBibtex.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 ControlBibtex.C
11  * \author John Levon, moz@compsoc.man.ac.uk
12  * \author Angus Leeming <a.leeming@ic.ac.uk>
13  * \author Herbert Voss <voss@lyx.org>
14  */
15
16 #include <config.h>
17
18 #ifdef __GNUG__
19 #pragma implementation
20 #endif
21
22 #include "ControlBibtex.h"
23 #include "BufferView.h"
24 #include "lyxrc.h"
25 #include "helper_funcs.h"
26 #include "gettext.h"
27
28 #include "frontends/LyXView.h"
29
30 using std::pair;
31
32
33 ControlBibtex::ControlBibtex(LyXView & lv, Dialogs & d)
34         : ControlCommand(lv, d)
35 {}
36
37
38 void ControlBibtex::applyParamsToInset()
39 {
40         if (params().getContents() != inset()->params().getContents())
41                 lv_.view()->ChangeCitationsIfUnique(inset()->params().getContents(),
42                                                     params().getContents());
43
44         inset()->setParams(params());
45         lv_.view()->updateInset(inset(), true);
46
47         // We need to do a redraw because the maximum
48         // InsetBibKey width could have changed
49         lv_.view()->redraw();
50         lv_.view()->fitCursor();
51 }
52
53
54 void ControlBibtex::applyParamsNoInset()
55 {}
56
57
58 string const ControlBibtex::Browse(string const & in_name,
59                                    string const & title,
60                                    string const & pattern)
61 {
62         pair<string, string> dir1(_("Documents|#o#O"), string(lyxrc.document_path));
63         return browseRelFile(&lv_, in_name, lv_.buffer()->filePath(),
64                              title, pattern, dir1);
65 }