lyx_mirror/src/frontends/controllers/ControlBibtex.C
Angus Leeming 9705be9f1b Implemented controller-view split for FormError and FormInclude.
Cleaned up code in controllers in the process; I think that the interface
is stabilising now.
Cleaned up code in InsetInclude a little.

Mental note (to me?!): the Bibitem, Bibtex and Include insets create an
inset when the appropriate menu item is selected. This is incorrect;
the inset should only be created when "Ok" is pressed, as with the
majority of insets. CREATE_XXX flags and associated code are needed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1817 a592a061-630c-0410-9148-cb99ea01b6c8
2001-03-23 17:09:34 +00:00

54 lines
1.2 KiB
C

// -*- C++ -*-
/* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 2001 The LyX Team.
*
* ======================================================
*
* \file ControlBibtex.C
* \author John Levon, moz@compsoc.man.ac.uk
* \author Angus Leeming <a.leeming@ic.ac.uk>
*/
#include <algorithm>
#ifdef __GNUG__
#pragma implementation
#endif
#include <config.h>
#include "ControlBibtex.h"
#include "Dialogs.h"
#include "LyXView.h"
#include "buffer.h"
using SigC::slot;
ControlBibtex::ControlBibtex(LyXView & lv, Dialogs & d)
: ControlCommand(lv, d)
{
d_.showBibtex.connect(slot(this, &ControlBibtex::showInset));
}
void ControlBibtex::applyParamsToInset()
{
if (params().getContents() != inset()->params().getContents())
lv_.view()->ChangeCitationsIfUnique(inset()->params().getContents(),
params().getContents());
inset()->setParams(params());
lv_.view()->updateInset(inset(), true);
// We need to do a redraw because the maximum
// InsetBibKey width could have changed
lv_.view()->redraw();
lv_.view()->fitCursor(lv_.view()->getLyXText());
}
void ControlBibtex::applyParamsNoInset()
{}