*
* Full author contact details are available in file CREDITS
*/
-#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include <config.h>
#include "inseturl.h"
+#include "funcrequest.h"
#include "BufferView.h"
#include "LaTeXFeatures.h"
+#include "latexrunparams.h"
#include "frontends/LyXView.h"
#include "debug.h"
#include "frontends/Dialogs.h"
{}
-void InsetUrl::edit(BufferView * bv, int, int, mouse_button::state)
+InsetUrl::~InsetUrl()
{
- bv->owner()->getDialogs().showUrl(this);
+ InsetCommandMailer("url", *this).hideDialog();
}
-void InsetUrl::edit(BufferView * bv, bool)
+dispatch_result InsetUrl::localDispatch(FuncRequest const & cmd)
{
- edit(bv, 0, 0, mouse_button::none);
+ switch (cmd.action) {
+ case LFUN_INSET_EDIT:
+ InsetCommandMailer("url", *this).showDialog(cmd.view());
+ return DISPATCHED;
+ default:
+ return InsetCommand::localDispatch(cmd);
+ }
}
int InsetUrl::latex(Buffer const *, ostream & os,
- bool fragile, bool /*free_spc*/) const
+ LatexRunParams const & runparams) const
{
if (!getOptions().empty())
os << getOptions() + ' ';
- if (fragile)
+ if (runparams.moving_arg)
os << "\\protect";
os << "\\url{" << getContents() << '}';
return 0;