return true;
case LFUN_INSET_EDIT:
- flag.setEnabled(getLayout().editExternally() && tempfile_ == 0);
+ flag.setEnabled(getLayout().editExternally() && tempfile_ == nullptr);
return true;
case LFUN_INSET_END_EDIT:
- flag.setEnabled(getLayout().editExternally() && tempfile_ != 0);
+ flag.setEnabled(getLayout().editExternally() && tempfile_ != nullptr);
return true;
default:
// ✎ U+270E LOWER RIGHT PENCIL
docstring const indicator = (isChanged() && geometry(bv) == ButtonOnly)
? docstring(1, 0x270E) : docstring();
+ // U+1F512 LOCK
+ docstring const locked = tempfile_ ? docstring(1, 0x1F512) : docstring();
InsetLayout const & il = getLayout();
docstring const label = getLabel();
if (!il.contentaslabel() || geometry(bv) != ButtonOnly)
return indicator + label;
- return indicator + getNewLabel(label);
+ return locked + indicator + getNewLabel(label);
}
docstring const InsetERT::buttonLabel(BufferView const & bv) const
{
+ docstring const locked = tempfile_ ? docstring(1, 0x1F512) : docstring();
if (decoration() == InsetLayout::CLASSIC)
- return isOpen(bv) ? _("ERT") : getNewLabel(_("ERT"));
- else
- return getNewLabel(_("ERT"));
+ return locked + (isOpen(bv) ? _("ERT") : getNewLabel(_("ERT")));
+ return locked + getNewLabel(_("ERT"));
}
docstring const InsetListings::buttonLabel(BufferView const & bv) const
{
// FIXME UNICODE
+ docstring const locked = tempfile_ ? docstring(1, 0x1F512) : docstring();
if (decoration() == InsetLayout::CLASSIC)
- return isOpen(bv) ? _("Listing") : getNewLabel(_("Listing"));
- else
- return getNewLabel(_("Listing"));
+ return locked + (isOpen(bv) ? _("Listing") : getNewLabel(_("Listing")));
+ return locked + getNewLabel(_("Listing"));
}