2 * \file ControlBibtex.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS
16 #pragma implementation
19 #include "ControlBibtex.h"
21 #include "BufferView.h"
23 #include "helper_funcs.h"
24 #include "tex_helpers.h"
26 #include "support/lstrings.h"
32 ControlBibtex::ControlBibtex(LyXView & lv, Dialogs & d)
33 : ControlCommand(lv, d)
38 void ControlBibtex::applyParamsToInset()
40 if (params().getContents() != inset()->params().getContents())
41 bufferview()->ChangeCitationsIfUnique(inset()->params().getContents(),
42 params().getContents());
44 inset()->setParams(params());
45 bufferview()->updateInset(inset(), true);
47 // We need to do a redraw because the maximum
48 // InsetBibKey width could have changed
49 #warning are you sure you need this repaint() ?
50 bufferview()->repaint();
51 bufferview()->fitCursor();
55 void ControlBibtex::applyParamsNoInset()
59 string const ControlBibtex::Browse(string const & in_name,
61 string const & pattern)
63 pair<string, string> dir1(_("Documents|#o#O"), string(lyxrc.document_path));
64 return browseRelFile(&lv_, in_name, buffer()->filePath(),
65 title, pattern, dir1);
69 string const ControlBibtex::getBibStyles() const
71 string list = getTexFileList("bstFiles.lst", false);
72 // test, if we have a valid list, otherwise run rescan
75 list = getTexFileList("bstFiles.lst", false);
81 void ControlBibtex::rescanBibStyles() const