X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2FControlBibtex.C;h=22927cae4e3a5e251df3c38be6b82dd1ba6d8d3a;hb=1e394731004491d04abe436112b5a89521bbd19a;hp=8614b105bbb9f4e76fd8b154dacfedbef83a0fdd;hpb=14c60d0aaeff364a78f77e163e6eae5fc3dab8c0;p=lyx.git diff --git a/src/frontends/controllers/ControlBibtex.C b/src/frontends/controllers/ControlBibtex.C index 8614b105bb..22927cae4e 100644 --- a/src/frontends/controllers/ControlBibtex.C +++ b/src/frontends/controllers/ControlBibtex.C @@ -1,53 +1,74 @@ -// -*- C++ -*- /* This file is part of - * ====================================================== + * ====================================================== * * LyX, The Document Processor * - * Copyright 2000 The LyX Team. + * Copyright 2001 The LyX Team. * * ====================================================== * * \file ControlBibtex.C + * \author John Levon, moz@compsoc.man.ac.uk * \author Angus Leeming + * \author Herbert Voss */ -#include +#include #ifdef __GNUG__ #pragma implementation #endif -#include +#include "ViewBase.h" +#include "ButtonControllerBase.h" #include "ControlBibtex.h" #include "Dialogs.h" -#include "LyXView.h" +#include "buffer.h" #include "BufferView.h" +#include "lyxrc.h" +#include "helper_funcs.h" +#include "gettext.h" + +#include "frontends/LyXView.h" + +#include + +#include -using SigC::slot; +using std::pair; +using std::make_pair; ControlBibtex::ControlBibtex(LyXView & lv, Dialogs & d) : ControlCommand(lv, d) { - d_.showBibtex.connect(slot(this, &ControlBibtex::showInset)); + d_.showBibtex = boost::bind(&ControlBibtex::showInset, this, _1); } -void ControlBibtex::apply() +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(); +} + + +void ControlBibtex::applyParamsNoInset() +{} + + +string const ControlBibtex::Browse(string const & in_name, + string const & title, + string const & pattern) { - view().apply(); - - if (inset_ && params() != inset_->params()) { - 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()); - } + pair dir1(_("Documents|#o#O"), string(lyxrc.document_path)); + return browseRelFile(&lv_, in_name, lv_.buffer()->filePath(), + title, pattern, dir1); }