Menu "context-graphics"
Item "Settings...|S" "inset-settings"
+ Item "Reload...|U" "graphics-reload"
Separator
Item "Edit Externally...|x" "inset-edit"
Separator
// 340
LFUN_BRANCHES_RENAME, // spitz 20090709
LFUN_BUFFER_CLOSE_ALL, // vfr 20090806
+ LFUN_GRAPHICS_RELOAD, // vfr 20090810
LFUN_LASTACTION // end of the table
};
*/
{ LFUN_SECTION_SELECT, "section-select", ReadOnly, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_GRAPHICS_RELOAD
+ * \li Action: Reloads the image if necessary.
+ * \li Syntax: graphics-reload
+ * \li Origin: vfr, 10 Aug 2009
+ * \endvar
+ */
+ { LFUN_GRAPHICS_RELOAD, "graphics-reload", ReadOnly | AtPoint, Edit },
+
+
{ LFUN_NOACTION, "", Noop, Hidden }
#ifndef DOXYGEN_SHOULD_SKIP_THIS
};
bool CacheItem::Impl::tryDisplayFormat(FileName & filename, string & from)
{
// First, check that the file exists!
+ // force a refresh.
+ filename_.lastModified();
if (!filename_.isReadableFile()) {
if (status_ != ErrorNoFile) {
status_ = ErrorNoFile;
}
+void Loader::reload() const
+{
+ pimpl_->cached_item_->startLoading();
+}
+
+
void Loader::startMonitoring() const
{
if (!pimpl_->cached_item_.get())
*/
void startLoading() const;
+ /** Tries to reload the image.
+ */
+ void reload() const;
+
/** Monitor any changes to the file.
* There is no point monitoring the file before startLoading() is
* invoked.
cur.bv().updateDialog("graphics", params2string(params(), buffer()));
break;
+ case LFUN_GRAPHICS_RELOAD:
+ graphic_->reload();
+ break;
+
default:
Inset::doDispatch(cur, cmd);
break;
case LFUN_INSET_EDIT:
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
+ case LFUN_GRAPHICS_RELOAD:
flag.setEnabled(true);
return true;
return new RenderGraphic(*this, inset);
}
+void RenderGraphic::reload() const
+{
+ loader_.reload();
+}
void RenderGraphic::update(graphics::Params const & params)
{
/// Refresh the info about which file to display and how to display it.
void update(graphics::Params const & params);
+ /// Reloads the image if necessary
+ void reload() const;
/// equivalent to dynamic_cast
virtual RenderGraphic * asGraphic() { return this; }