Item "Remove Last Parameter Spitting Out To The Right" "math-macro-remove-greedy-param"
End
+ Menu "context-listings"
+ Item "Cut" "cut"
+ Item "Copy" "copy"
+ Item "Paste" "paste"
+ Submenu "Paste Recent|e" "edit_pasterecent"
+ Separator
+ Item "Settings...|S" "inset-settings listings"
+ End
+
+ Menu "context-graphics"
+ Item "Edit...|E" "graphics-edit"
+ Separator
+ Item "Settings...|S" "next-inset-toggle"
+ End
+
End
#include "insets/InsetBibtex.h"
#include "insets/InsetCommand.h" // ChangeRefs
+#include "insets/InsetExternal.h"
+#include "insets/InsetGraphics.h"
#include "insets/InsetRef.h"
#include "insets/InsetText.h"
case LFUN_FONT_STATE:
case LFUN_LABEL_INSERT:
case LFUN_INFO_INSERT:
+ case LFUN_EXTERNAL_EDIT:
+ case LFUN_GRAPHICS_EDIT:
case LFUN_PARAGRAPH_GOTO:
case LFUN_NOTE_NEXT:
case LFUN_REFERENCE_NEXT:
gotoLabel(label);
break;
}
+
+ case LFUN_EXTERNAL_EDIT: {
+ FuncRequest fr(cmd);
+ InsetExternal * inset = getInsetByCode<InsetExternal>(d->cursor_,
+ EXTERNAL_CODE);
+ if (inset)
+ inset->dispatch(d->cursor_, fr);
+ break;
+ }
+
+
+ case LFUN_GRAPHICS_EDIT: {
+ FuncRequest fr(cmd);
+ InsetGraphics * inset = getInsetByCode<InsetGraphics>(d->cursor_,
+ GRAPHICS_CODE);
+ if (inset)
+ inset->dispatch(d->cursor_, fr);
+ break;
+ }
case LFUN_PARAGRAPH_GOTO: {
int const id = convert<int>(to_utf8(cmd.argument()));
lyx_view_->message(from_utf8(argument));
break;
- case LFUN_EXTERNAL_EDIT: {
- BOOST_ASSERT(lyx_view_);
- FuncRequest fr(action, argument);
- InsetExternal ie;
- ie.setBuffer(*lyx_view_->buffer());
- ie.dispatch(view()->cursor(), fr);
- break;
- }
-
- case LFUN_GRAPHICS_EDIT: {
- BOOST_ASSERT(lyx_view_);
- FuncRequest fr(action, argument);
- InsetGraphics ig;
- ig.setBuffer(*lyx_view_->buffer());
- ig.dispatch(view()->cursor(), fr);
- break;
- }
case LFUN_ALL_INSETS_TOGGLE: {
BOOST_ASSERT(lyx_view_);
switch (cmd.action) {
case LFUN_EXTERNAL_EDIT: {
- InsetExternalParams p;
- InsetExternalMailer::string2params(to_utf8(cmd.argument()), buffer(), p);
+ InsetExternalParams p = params();
+ if (!cmd.argument().empty())
+ InsetExternalMailer::string2params(to_utf8(cmd.argument()), buffer(), p);
external::editExternal(p, buffer());
break;
}
{
switch (cmd.action) {
case LFUN_GRAPHICS_EDIT: {
- InsetGraphicsParams p;
- InsetGraphicsMailer::string2params(to_utf8(cmd.argument()), buffer(), p);
+ InsetGraphicsParams p = params();
+ if (!cmd.argument().empty())
+ InsetGraphicsMailer::string2params(to_utf8(cmd.argument()), buffer(), p);
editGraphics(p, buffer());
break;
}
}
+docstring InsetGraphics::contextMenu(BufferView const &, int, int) const
+{
+ return from_ascii("context-graphics");
+}
+
+
string const InsetGraphicsMailer::name_("graphics");
InsetGraphicsMailer::InsetGraphicsMailer(InsetGraphics & inset)
void updateEmbeddedFile(EmbeddedFile const &);
///
void addToToc(ParConstIterator const &) const;
+ ///
+ docstring contextMenu(BufferView const & bv, int x, int y) const;
/// Force inset into LTR environment if surroundings are RTL?
virtual bool forceLTR() const { return true; }
}
+docstring InsetListings::contextMenu(BufferView const &, int, int) const
+{
+ return from_ascii("context-listings");
+}
+
+
void InsetListings::doDispatch(Cursor & cur, FuncRequest & cmd)
{
switch (cmd.action) {
InsetListingsParams const & params() const { return params_; }
///
InsetListingsParams & params() { return params_; }
+ ///
+ docstring contextMenu(BufferView const & bv, int x, int y) const;
+
private:
///
void doDispatch(Cursor & cur, FuncRequest & cmd);