*
* 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 "frontends/LyXView.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);
+ }
}
temp = _("HtmlUrl: ");
string url;
-
+
if (!getOptions().empty())
url += getOptions();
else
int InsetUrl::ascii(Buffer const *, ostream & os, int) const
{
if (getOptions().empty())
- os << "[" << getContents() << "]";
+ os << '[' << getContents() << ']';
else
- os << "[" << getContents() << "||" << getOptions() << "]";
+ os << '[' << getContents() << "||" << getOptions() << ']';
return 0;
}
int InsetUrl::linuxdoc(Buffer const *, ostream & os) const
{
- os << "<" << getCmdName()
+ os << '<' << getCmdName()
<< " url=\"" << getContents() << "\""
<< " name=\"" << getOptions() << "\">";