1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 * ======================================================
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>
19 #pragma implementation
23 #include "ButtonControllerBase.h"
24 #include "ControlBibtex.h"
27 #include "BufferView.h"
29 #include "helper_funcs.h"
32 #include "frontends/LyXView.h"
34 #include <boost/bind.hpp>
41 ControlBibtex::ControlBibtex(LyXView & lv, Dialogs & d)
42 : ControlCommand(lv, d)
44 d_.showBibtex = boost::bind(&ControlBibtex::showInset, this, _1);
47 void ControlBibtex::applyParamsToInset()
49 if (params().getContents() != inset()->params().getContents())
50 lv_.view()->ChangeCitationsIfUnique(inset()->params().getContents(),
51 params().getContents());
53 inset()->setParams(params());
54 lv_.view()->updateInset(inset(), true);
56 // We need to do a redraw because the maximum
57 // InsetBibKey width could have changed
59 lv_.view()->fitCursor();
63 void ControlBibtex::applyParamsNoInset()
67 string const ControlBibtex::Browse(string const & in_name,
69 string const & pattern)
71 pair<string, string> dir1(_("Documents|#o#O"), string(lyxrc.document_path));
72 return browseRelFile(&lv_, in_name, lv_.buffer()->filePath(),
73 title, pattern, dir1);