}
-InsetNote::InsetNote(BufferParams const & bp, string const & label)
- : InsetCollapsable(bp)
+/////////////////////////////////////////////////////////////////////
+//
+// InsetNode
+//
+/////////////////////////////////////////////////////////////////////
+
+InsetNote::InsetNote(Buffer const & buf, string const & label)
+ : InsetCollapsable(buf)
{
params_.type = notetranslator().find(label);
}
-InsetNote::InsetNote(InsetNote const & in)
- : InsetCollapsable(in), params_(in.params_)
-{}
-
-
InsetNote::~InsetNote()
{
InsetNoteMailer(*this).hideDialog();
}
-Inset * InsetNote::clone() const
-{
- return new InsetNote(*this);
-}
-
-
docstring InsetNote::editMessage() const
{
return _("Opened Note Inset");
switch (cmd.action) {
case LFUN_INSET_MODIFY:
+ // disallow comment and greyed out in commands
+ flag.enabled(!cur.paragraph().layout().isCommand() ||
+ cmd.getArg(2) == "Note");
+ if (cmd.getArg(0) == "note") {
+ InsetNoteParams params;
+ InsetNoteMailer::string2params(to_utf8(cmd.argument()), params);
+ flag.setOnOff(params_.type == params.type);
+ }
+ return true;
+
case LFUN_INSET_DIALOG_UPDATE:
flag.enabled(true);
return true;
}
}
+
void InsetNote::updateLabels(ParIterator const & it)
{
- TextClass const & tclass = buffer().params().textClass();
+ DocumentClass const & tclass = buffer().params().documentClass();
Counters savecnt = tclass.counters();
InsetCollapsable::updateLabels(it);
tclass.counters() = savecnt;
}
+docstring InsetNote::contextMenu(BufferView const &, int, int) const
+{
+ return from_ascii("context-note");
+}
+
string const InsetNoteMailer::name_("note");
string id;
lex >> id;
if (!lex || id != "Note")
- return print_mailer_error("InsetBoxMailer", in, 2, "Note");
+ return print_mailer_error("InsetNoteMailer", in, 2, "Note");
params.read(lex);
}