]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inseturl.C
Clean up InsetGraphics::Cache and rename as GraphicsInset.
[lyx.git] / src / insets / inseturl.C
index 0c1c1f17aac7bc9d86c6b4ea156d1c219054ad3b..16eaf04797d984fbd105cf369083590f0ec0a681 100644 (file)
@@ -7,12 +7,14 @@
  *
  * Full author contact details are available in file CREDITS
  */
-#include <config.h>
 
+#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"
 using std::ostream;
 
 
-InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
+InsetUrl::InsetUrl(InsetCommandParams const & p)
                : InsetCommand(p)
 {}
 
 
-InsetUrl::~InsetUrl()
-{
-       InsetCommandMailer mailer("url", *this);
-       mailer.hideDialog();
-}
+// InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
+//             : InsetCommand(p, false)
+// {}
 
 
-void InsetUrl::edit(BufferView * bv, int, int, mouse_button::state)
+InsetUrl::~InsetUrl()
 {
-       InsetCommandMailer mailer("url", *this);
-       mailer.showDialog(bv);
+       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);
+       }
 }
 
 
@@ -72,11 +77,11 @@ string const InsetUrl::getScreenLabel(Buffer const *) const
 
 
 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;