]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetindex.C
fix #832
[lyx.git] / src / insets / insetindex.C
index 2cc96574fd379744bdc0ce9712c514f5dcd7963f..cbd6dd8495bb21d48cd7bbfdf29d664921a5588a 100644 (file)
@@ -9,12 +9,10 @@
  */
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "insetindex.h"
 #include "BufferView.h"
+#include "funcrequest.h"
 #include "frontends/LyXView.h"
 #include "frontends/Dialogs.h"
 #include "LaTeXFeatures.h"
@@ -28,21 +26,29 @@ 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, mouse_button::state)
+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, mouse_button::none);
+       switch (cmd.action) {
+               case LFUN_INSET_EDIT:
+                       InsetCommandMailer("index", *this).showDialog(cmd.view());
+                       return DISPATCHED;
+               
+               default:
+                       return UNDISPATCHED;
+       }
 }
 
 
@@ -60,11 +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");