#include "support/docstream.h"
#include "support/gettext.h"
+#include "support/lstrings.h"
#include "support/Translator.h"
#include "frontends/Application.h"
//
/////////////////////////////////////////////////////////////////////
-InsetPhantom::InsetPhantom(Buffer const & buf, string const & label)
+InsetPhantom::InsetPhantom(Buffer * buf, string const & label)
: InsetCollapsable(buf)
{
setDrawFrame(false);
}
-docstring InsetPhantom::editMessage() const
-{
- return _("Opened Phantom Inset");
-}
-
-
docstring InsetPhantom::name() const
{
return from_ascii("Phantom:" + phantomtranslator().find(params_.type));
case LFUN_INSET_MODIFY:
string2params(to_utf8(cmd.argument()), params_);
- setLayout(buffer().params());
break;
case LFUN_INSET_DIALOG_UPDATE:
switch (cmd.action) {
case LFUN_INSET_MODIFY:
- case LFUN_INSET_SETTINGS:
+ if (cmd.getArg(0) == "phantom") {
+ InsetPhantomParams params;
+ string2params(to_utf8(cmd.argument()), params);
+ flag.setOnOff(params_.type == params.type);
+ }
flag.setEnabled(true);
return true;
OutputParams rp(&buffer().params().encoding());
odocstringstream ods;
InsetCollapsable::plaintext(ods, rp);
- docstring content_tip = ods.str();
- // shorten it if necessary
- if (content_tip.size() > 200)
- content_tip = content_tip.substr(0, 200) + "...";
+ docstring content_tip = support::wrapParas(ods.str());
docstring res = phantomtranslator_loc().find(params_.type);
if (!content_tip.empty())
- res += from_ascii(": ") + content_tip;
+ res += from_ascii(": ") + "\n" + content_tip;
return res;
}
}
+docstring InsetPhantom::xhtml(XHTMLStream &, OutputParams const &) const
+{
+ return docstring();
+}
+
docstring InsetPhantom::contextMenu(BufferView const &, int, int) const
{
return from_ascii("context-phantom");