2001-03-19 16:37:01 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2001-03-20 10:14:03 +00:00
|
|
|
* Copyright 2001 The LyX Team.
|
2001-03-19 16:37:01 +00:00
|
|
|
*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* \file ControlBibtex.C
|
2001-03-20 10:14:03 +00:00
|
|
|
* \author John Levon, moz@compsoc.man.ac.uk
|
2001-03-19 16:37:01 +00:00
|
|
|
* \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"
|
2001-03-23 17:09:34 +00:00
|
|
|
#include "buffer.h"
|
2001-03-19 16:37:01 +00:00
|
|
|
|
|
|
|
using SigC::slot;
|
|
|
|
|
|
|
|
ControlBibtex::ControlBibtex(LyXView & lv, Dialogs & d)
|
|
|
|
: ControlCommand(lv, d)
|
|
|
|
{
|
|
|
|
d_.showBibtex.connect(slot(this, &ControlBibtex::showInset));
|
|
|
|
}
|
|
|
|
|
2001-03-23 17:09:34 +00:00
|
|
|
void ControlBibtex::applyParamsToInset()
|
2001-03-19 16:37:01 +00:00
|
|
|
{
|
2001-03-23 17:09:34 +00:00
|
|
|
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());
|
2001-03-19 16:37:01 +00:00
|
|
|
}
|
2001-03-23 17:09:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
void ControlBibtex::applyParamsNoInset()
|
|
|
|
{}
|