]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetindex.C
fix #832
[lyx.git] / src / insets / insetindex.C
index 7c220fb782ae7d23c407295f7247187ebf396bd4..cbd6dd8495bb21d48cd7bbfdf29d664921a5588a 100644 (file)
@@ -1,12 +1,19 @@
+/**
+ * \file insetindex.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS
+ */
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "insetindex.h"
 #include "BufferView.h"
-#include "LyXView.h"
+#include "funcrequest.h"
+#include "frontends/LyXView.h"
 #include "frontends/Dialogs.h"
 #include "LaTeXFeatures.h"
 #include "gettext.h"
@@ -19,28 +26,37 @@ InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
 {}
 
 
-string const InsetIndex::getScreenLabel(Buffer const *) const
+InsetIndex::~InsetIndex()
 {
-       return _("Idx");
+       InsetCommandMailer mailer("index", *this);
+       mailer.hideDialog();
 }
 
 
-void InsetIndex::edit(BufferView * bv, int, int, unsigned int)
+string const InsetIndex::getScreenLabel(Buffer const *) const
 {
-       bv->owner()->getDialogs()->showIndex(this);
+       return _("Idx");
 }
 
 
-void InsetIndex::edit(BufferView * bv, bool)
+dispatch_result InsetIndex::localDispatch(FuncRequest const & cmd)
 {
-       edit(bv, 0, 0, 0);
+       switch (cmd.action) {
+               case LFUN_INSET_EDIT:
+                       InsetCommandMailer("index", *this).showDialog(cmd.view());
+                       return DISPATCHED;
+               
+               default:
+                       return UNDISPATCHED;
+       }
 }
 
 
-int InsetIndex::docbook(Buffer const *, ostream & os) const
+int InsetIndex::docbook(Buffer const *, ostream & os, bool) const
 {
-  os << "<indexterm><primary>" << getContents() << "</primary></indexterm>";
-  return 0;
+       os << "<indexterm><primary>" << getContents()
+          << "</primary></indexterm>";
+       return 0;
 }
 
 
@@ -50,10 +66,16 @@ Inset::Code InsetIndex::lyxCode() const
 }
 
 
+
 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
        : InsetCommand(p)
 {}
 
+
+InsetPrintIndex::~InsetPrintIndex()
+{}
+
+
 string const InsetPrintIndex::getScreenLabel(Buffer const *) const
 {
        return _("Index");