*/
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
#include "gettext.h"
#include "insettoc.h"
+#include "funcrequest.h"
#include "BufferView.h"
#include "frontends/LyXView.h"
#include "frontends/Dialogs.h"
using std::ostream;
+InsetTOC::InsetTOC(InsetCommandParams const & p)
+ : InsetCommand(p)
+{}
+
+
+InsetTOC::~InsetTOC()
+{
+ InsetCommandMailer mailer("toc", *this);
+ mailer.hideDialog();
+}
+
+
string const InsetTOC::getScreenLabel(Buffer const *) const
{
string const cmdname(getCmdName());
}
-void InsetTOC::edit(BufferView * bv, int, int, mouse_button::state)
-{
- bv->owner()->getDialogs().showTOC(this);
-}
-
-
-void InsetTOC::edit(BufferView * bv, bool)
+dispatch_result InsetTOC::localDispatch(FuncRequest const & cmd)
{
- edit(bv, 0, 0, mouse_button::none);
+ switch (cmd.action) {
+ case LFUN_INSET_EDIT:
+ InsetCommandMailer("toc", *this).showDialog(cmd.view());
+ return DISPATCHED;
+ default:
+ return InsetCommand::localDispatch(cmd);
+ }
}