*
* \file ControlExternal.C
* \author Asger Alstrup
- * \author John Levon
+ * \author John Levon, moz@compsoc.man.ac.uk
* \author Angus Leeming, a.leeming@ic.ac.uk
*/
#pragma implementation
#endif
+#include "ViewBase.h"
+#include "ButtonControllerBase.h"
#include "ControlExternal.h"
#include "buffer.h"
#include "Dialogs.h"
#include "Liason.h"
#include "LyXView.h"
#include "support/filetools.h"
+#include "support/lstrings.h"
#include "frontends/FileDialog.h"
#include "lyx_gui_misc.h" // WriteAlert
+#include "gettext.h"
+#include "BufferView.h"
using std::make_pair;
using std::vector;
void ControlExternal::editExternal()
{
// fill the local, controller's copy of the Params struct with
- // the contents of the popup's fields.
+ // the contents of the dialog's fields.
view().apply();
// Create a local copy of the inset and initialise it with this
// params struct.
- InsetExternal ie;
- ie.setFromParams(params());
+ boost::scoped_ptr<InsetExternal> ie;
+ ie.reset(static_cast<InsetExternal *>(inset()->clone(*lv_.buffer())));
+ ie->setFromParams(params());
- ie.editExternal();
+ ie->editExternal();
}
void ControlExternal::viewExternal()
{
view().apply();
- InsetExternal ie;
- ie.setFromParams(params());
+ boost::scoped_ptr<InsetExternal> ie;
+ ie.reset(static_cast<InsetExternal *>(inset()->clone(*lv_.buffer())));
+ ie->setFromParams(params());
- ie.viewExternal();
+ ie->viewExternal();
}
void ControlExternal::updateExternal()
{
view().apply();
- InsetExternal ie;
- ie.setFromParams(params());
+ boost::scoped_ptr<InsetExternal> ie;
+ ie.reset(static_cast<InsetExternal *>(inset()->clone(*lv_.buffer())));
+ ie->setFromParams(params());
- ie.updateExternal();
+ ie->updateExternal();
}
vector<string> const ControlExternal::getTemplates() const
for (int n = 1; n < i; ++n)
++i1;
- return (*i1).second;
+ return i1->second;
}
// FIXME: a temporary hack until the FileDialog interface is updated
regexp += "|";
- static int once = 0;
+ static int once;
string current_path;
while (1) {