]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetexternal.C
fix compilation pb ; update eu.po
[lyx.git] / src / insets / insetexternal.C
index 6639eacbbe4bb006dfc2809bad2b66ef1e409288..bdf11c0945a90163ee52cf607d9917da2a0688a2 100644 (file)
 #include "support/lstrings.h"
 #include "support/path.h"
 #include "support/syscall.h"
-
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::slot;
-#endif
+#include "gettext.h"
 
 using std::endl;
 
 InsetExternal::InsetExternal() 
-       : view(0)
+       : view_(0)
 {
-       tempname = lyx::tempName(string(), "lyxext");
+       tempname_ = lyx::tempName(string(), "lyxext");
        //ExternalTemplateManager::Templates::const_iterator i1;
        params_.templ = ExternalTemplateManager::get().getTemplates().begin()->second;
 }
@@ -47,18 +44,18 @@ InsetExternal::InsetExternal()
 
 InsetExternal::~InsetExternal()
 {
-       lyx::unlink(tempname);
+       lyx::unlink(tempname_);
        hideDialog();
 }
 
 
-InsetExternal::InsetExternalParams InsetExternal::params() const
+InsetExternal::Params InsetExternal::params() const
 {
        return params_;
 }
  
  
-void InsetExternal::setFromParams(InsetExternalParams const & p)
+void InsetExternal::setFromParams(Params const & p)
 {
        params_.filename = p.filename;
        params_.parameters = p.parameters;
@@ -75,8 +72,8 @@ string const InsetExternal::EditMessage() const
 void InsetExternal::Edit(BufferView * bv,
                         int /*x*/, int /*y*/, unsigned int /*button*/)
 {
-       view = bv;
-       view->owner()->getDialogs()->showExternal(this);
+       view_ = bv;
+       view_->owner()->getDialogs()->showExternal(this);
 }
 
 
@@ -192,6 +189,7 @@ Inset * InsetExternal::Clone(Buffer const &) const
 {
        InsetExternal * inset = new InsetExternal();
        inset->params_ = params_;
+       inset->view_ = view_;
        return inset;
 }
 
@@ -230,7 +228,7 @@ string const InsetExternal::doSubstitution(Buffer const * buffer,
        result = subst(result, "$$Basename", basename);
        result = subst(result, "$$Parameters", params_.parameters);
        result = ReplaceEnvironmentPath(result);
-       result = subst(result, "$$Tempname", tempname);
+       result = subst(result, "$$Tempname", tempname_);
        result = subst(result, "$$Sysdir", system_lyxdir);
        
        // Handle the $$Contents(filename) syntax
@@ -266,9 +264,9 @@ void InsetExternal::updateExternal() const
        if (cit == et.formats.end())
                return;
        
-       executeCommand(doSubstitution(view->buffer(),
-                       (*cit).second.updateCommand),
-                       view->buffer());
+       executeCommand(doSubstitution(view_->buffer(),
+                                     (*cit).second.updateCommand),
+                      view_->buffer());
 }
 
 
@@ -278,9 +276,9 @@ void InsetExternal::viewExternal() const
        if (et.automaticProduction)
                updateExternal();
 
-       executeCommand(doSubstitution(view->buffer(),
-                       et.viewCommand),
-                       view->buffer());
+       executeCommand(doSubstitution(view_->buffer(),
+                                     et.viewCommand),
+                      view_->buffer());
 }
 
 
@@ -290,7 +288,24 @@ void InsetExternal::editExternal() const
        if (et.automaticProduction)
                updateExternal();
 
-       executeCommand(doSubstitution(view->buffer(),
-                       et.editCommand),
-                       view->buffer());
+       executeCommand(doSubstitution(view_->buffer(),
+                                     et.editCommand),
+                      view_->buffer());
+}
+
+
+bool operator==(InsetExternal::Params const & left,
+               InsetExternal::Params const & right)
+{
+       return ((left.filename   == right.filename) &&
+               (left.parameters == right.parameters) &&
+               (left.templ.lyxName == right.templ.lyxName));
 }
+
+
+bool operator!=(InsetExternal::Params const & left,
+               InsetExternal::Params const & right)
+{
+       return  !(left == right);
+}
+