string const filepath = cmd.view()->buffer()->filePath();
setParams(p, filepath);
- cmd.view()->updateInset(this, true);
+ cmd.view()->updateInset(this);
result = DISPATCHED;
}
break;
case LFUN_INSET_DIALOG_UPDATE: {
InsetGraphicsMailer mailer(*this);
- mailer.updateDialog();
+ mailer.updateDialog(cmd.view());
}
break;
+ case LFUN_MOUSE_RELEASE:
+ edit(cmd.view(), cmd.x, cmd.y, cmd.button());
+ break;
+
default:
result = DISPATCHED;
break;
void InsetGraphics::draw(BufferView * bv, LyXFont const & font,
- int baseline, float & x, bool) const
+ int baseline, float & x) const
{
// MakeAbsPath returns params().filename unchanged if it absolute
// already.
paint.text(old_x + TEXT_TO_INSET_OFFSET + 6, baseline - 4, msg, msgFont);
}
}
-
- // the status message may mean we changed size, so indicate
- // we need a row redraw
-#if 0
- if (old_status_ != grfx::ErrorUnknown && old_status_ != cached_status_) {
- bv->getLyXText()->status(bv, LyXText::CHANGED_IN_DRAW);
- }
-#endif
-
- // Reset the cache, ready for the next draw request
-#if 0
- cached_status_ = grfx::ErrorUnknown;
- cached_image_.reset();
- cache_filled_ = false;
-#endif
}
-void InsetGraphics::edit(BufferView *, int, int, mouse_button::state)
+void InsetGraphics::edit(BufferView * bv, int, int, mouse_button::state)
{
InsetGraphicsMailer mailer(*this);
- mailer.showDialog();
+ mailer.showDialog(bv);
}
void InsetGraphics::statusChanged()
{
if (!cache_->view.expired())
- cache_->view.lock()->updateInset(this, false);
+ cache_->view.lock()->updateInset(this);
}
return;
}
- InsetGraphics inset;
- inset.readInsetGraphics(lex);
- params = inset.params();
+ if (lex.isOK()) {
+ InsetGraphics inset;
+ inset.readInsetGraphics(lex);
+ params = inset.params();
+ }
}