/** * \file ControlBibtex.C * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * * \author John Levon * \author Angus Leeming * \author Herbert Voss * * Full author contact details are available in file CREDITS */ #include #include "ControlBibtex.h" #include "buffer.h" #include "BufferView.h" #include "lyxrc.h" #include "helper_funcs.h" #include "tex_helpers.h" #include "gettext.h" #include "support/lstrings.h" using std::pair; ControlBibtex::ControlBibtex(LyXView & lv, Dialogs & d) : ControlCommand(lv, d) {} void ControlBibtex::applyParamsToInset() { if (params().getContents() != inset()->params().getContents()) bufferview()->ChangeCitationsIfUnique(inset()->params().getContents(), params().getContents()); inset()->setParams(params()); bufferview()->updateInset(inset(), true); // We need to do a redraw because the maximum // InsetBibKey width could have changed #warning are you sure you need this repaint() ? bufferview()->repaint(); bufferview()->fitCursor(); } void ControlBibtex::applyParamsNoInset() {} string const ControlBibtex::Browse(string const & in_name, string const & title, string const & pattern) { pair dir1(_("Documents|#o#O"), string(lyxrc.document_path)); return browseRelFile(in_name, buffer()->filePath(), title, pattern, false, dir1); } string const ControlBibtex::getBibStyles() const { string list = getTexFileList("bstFiles.lst", false); // test, if we have a valid list, otherwise run rescan if (list.empty()) { rescanBibStyles(); list = getTexFileList("bstFiles.lst", false); } return list; } string const ControlBibtex::getBibFiles() const { string list = getTexFileList("bibFiles.lst", false); // test, if we have a valid list, otherwise run rescan if (list.empty()) { rescanBibStyles(); list = getTexFileList("bibFiles.lst", false); } return list; } void ControlBibtex::rescanBibStyles() const { rescanTexStyles(); }