]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlBibitem.C
Controller-view split of Graphics and Index popups.
[lyx.git] / src / frontends / controllers / ControlBibitem.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 ControlBibitem.C
11  * \author John Levon, moz@compsoc.man.ac.uk
12  * \author Angus Leeming <a.leeming@ic.ac.uk>
13  */
14
15 #include <algorithm>
16
17 #ifdef __GNUG__
18 #pragma implementation
19 #endif
20
21 #include <config.h>
22 #include "ControlBibitem.h"
23 #include "Dialogs.h"
24 #include "LyXView.h"
25 #include "buffer.h"
26
27 using SigC::slot;
28
29 ControlBibitem::ControlBibitem(LyXView & lv, Dialogs & d)
30         : ControlCommand(lv, d)
31 {
32         d_.showBibitem.connect(slot(this, &ControlBibitem::showInset));
33 }
34
35 void ControlBibitem::applyParamsToInset()
36 {
37         // FIXME:
38         // confirm, is this only necessary for FormBibTeX ???
39         if (params().getContents() != inset()->params().getContents())
40                 lv_.view()->ChangeCitationsIfUnique(inset()->params().getContents(),
41                                                     params().getContents());
42
43         inset()->setParams(params());
44         lv_.view()->updateInset(inset(), true);
45
46         // We need to do a redraw because the maximum
47         // InsetBibKey width could have changed
48         lv_.view()->redraw();
49         lv_.view()->fitCursor(lv_.view()->getLyXText());
50 }