mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
* merge LFUN_EDIT_EXTERNAL and LFUN_EDIT_GRAPHICS to one LFUN_EDIT_INSET (bug 3975)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24526 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
878b3ce315
commit
fa2f8d159b
@ -851,8 +851,7 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd)
|
|||||||
case LFUN_FONT_STATE:
|
case LFUN_FONT_STATE:
|
||||||
case LFUN_LABEL_INSERT:
|
case LFUN_LABEL_INSERT:
|
||||||
case LFUN_INFO_INSERT:
|
case LFUN_INFO_INSERT:
|
||||||
case LFUN_EXTERNAL_EDIT:
|
case LFUN_INSET_EDIT:
|
||||||
case LFUN_GRAPHICS_EDIT:
|
|
||||||
case LFUN_PARAGRAPH_GOTO:
|
case LFUN_PARAGRAPH_GOTO:
|
||||||
case LFUN_NOTE_NEXT:
|
case LFUN_NOTE_NEXT:
|
||||||
case LFUN_REFERENCE_NEXT:
|
case LFUN_REFERENCE_NEXT:
|
||||||
@ -1063,22 +1062,19 @@ bool BufferView::dispatch(FuncRequest const & cmd)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case LFUN_EXTERNAL_EDIT: {
|
case LFUN_INSET_EDIT: {
|
||||||
FuncRequest fr(cmd);
|
FuncRequest fr(cmd);
|
||||||
InsetExternal * inset = getInsetByCode<InsetExternal>(d->cursor_,
|
// if there is an inset at cursor, see whether it
|
||||||
EXTERNAL_CODE);
|
// can be modified.
|
||||||
|
Inset * inset = cur.nextInset();
|
||||||
if (inset)
|
if (inset)
|
||||||
inset->dispatch(d->cursor_, fr);
|
inset->dispatch(cur, fr);
|
||||||
break;
|
// if it did not work, try the underlying inset.
|
||||||
}
|
if (!inset || !cur.result().dispatched())
|
||||||
|
cur.dispatch(cmd);
|
||||||
|
|
||||||
|
if (!cur.result().dispatched())
|
||||||
case LFUN_GRAPHICS_EDIT: {
|
// It did not work too; no action needed.
|
||||||
FuncRequest fr(cmd);
|
|
||||||
InsetGraphics * inset = getInsetByCode<InsetGraphics>(d->cursor_,
|
|
||||||
GRAPHICS_CODE);
|
|
||||||
if (inset)
|
|
||||||
inset->dispatch(d->cursor_, fr);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ enum FuncCode
|
|||||||
LFUN_PARAGRAPH_PARAMS_APPLY,
|
LFUN_PARAGRAPH_PARAMS_APPLY,
|
||||||
LFUN_PARAGRAPH_UPDATE,
|
LFUN_PARAGRAPH_UPDATE,
|
||||||
// 230
|
// 230
|
||||||
LFUN_EXTERNAL_EDIT,
|
LFUN_INSET_EDIT, // JSpitzm 20080427
|
||||||
LFUN_BRANCH_INSERT,
|
LFUN_BRANCH_INSERT,
|
||||||
LFUN_BOX_INSERT,
|
LFUN_BOX_INSERT,
|
||||||
LFUN_LINE_INSERT,
|
LFUN_LINE_INSERT,
|
||||||
@ -331,87 +331,85 @@ enum FuncCode
|
|||||||
LFUN_BUFFER_PARAMS_APPLY,
|
LFUN_BUFFER_PARAMS_APPLY,
|
||||||
// 250
|
// 250
|
||||||
LFUN_LYXRC_APPLY,
|
LFUN_LYXRC_APPLY,
|
||||||
LFUN_GRAPHICS_EDIT,
|
|
||||||
LFUN_BUFFER_NEXT,
|
LFUN_BUFFER_NEXT,
|
||||||
LFUN_BUFFER_PREVIOUS,
|
LFUN_BUFFER_PREVIOUS,
|
||||||
LFUN_STATISTICS,
|
LFUN_STATISTICS,
|
||||||
// 255
|
|
||||||
LFUN_CHANGES_OUTPUT, // jspitzm 20050121
|
LFUN_CHANGES_OUTPUT, // jspitzm 20050121
|
||||||
|
// 255
|
||||||
LFUN_BIBTEX_DATABASE_ADD,
|
LFUN_BIBTEX_DATABASE_ADD,
|
||||||
LFUN_BIBTEX_DATABASE_DEL,
|
LFUN_BIBTEX_DATABASE_DEL,
|
||||||
LFUN_CITATION_INSERT,
|
LFUN_CITATION_INSERT,
|
||||||
LFUN_OUTLINE_UP,
|
LFUN_OUTLINE_UP,
|
||||||
// 260
|
|
||||||
LFUN_OUTLINE_DOWN,
|
LFUN_OUTLINE_DOWN,
|
||||||
|
// 260
|
||||||
LFUN_OUTLINE_IN,
|
LFUN_OUTLINE_IN,
|
||||||
LFUN_OUTLINE_OUT,
|
LFUN_OUTLINE_OUT,
|
||||||
LFUN_PARAGRAPH_MOVE_DOWN,
|
LFUN_PARAGRAPH_MOVE_DOWN,
|
||||||
LFUN_PARAGRAPH_MOVE_UP,
|
LFUN_PARAGRAPH_MOVE_UP,
|
||||||
// 265
|
|
||||||
LFUN_BUFFER_TOGGLE_COMPRESSION, // bpeng 20060427
|
LFUN_BUFFER_TOGGLE_COMPRESSION, // bpeng 20060427
|
||||||
|
// 265
|
||||||
LFUN_MATH_BIGDELIM,
|
LFUN_MATH_BIGDELIM,
|
||||||
LFUN_CLIPBOARD_PASTE,
|
LFUN_CLIPBOARD_PASTE,
|
||||||
LFUN_INSET_DISSOLVE, // jspitzm 20060807
|
LFUN_INSET_DISSOLVE, // jspitzm 20060807
|
||||||
LFUN_CHANGE_NEXT,
|
LFUN_CHANGE_NEXT,
|
||||||
// 270
|
|
||||||
LFUN_WINDOW_NEW, // Abdel 20061021
|
LFUN_WINDOW_NEW, // Abdel 20061021
|
||||||
|
// 270
|
||||||
LFUN_WINDOW_CLOSE, // Abdel 20061023
|
LFUN_WINDOW_CLOSE, // Abdel 20061023
|
||||||
LFUN_UNICODE_INSERT, // Lgb 20061022
|
LFUN_UNICODE_INSERT, // Lgb 20061022
|
||||||
LFUN_BOOKMARK_CLEAR, // bpeng 20061031
|
LFUN_BOOKMARK_CLEAR, // bpeng 20061031
|
||||||
LFUN_NOMENCL_INSERT, // Ugras
|
LFUN_NOMENCL_INSERT, // Ugras
|
||||||
// 275
|
|
||||||
LFUN_NOMENCL_PRINT, // Ugras
|
LFUN_NOMENCL_PRINT, // Ugras
|
||||||
|
// 275
|
||||||
LFUN_LISTING_INSERT, // Herbert 20011110, bpeng 20070502
|
LFUN_LISTING_INSERT, // Herbert 20011110, bpeng 20070502
|
||||||
LFUN_TOOLBAR_TOGGLE, // Edwin 20070521
|
LFUN_TOOLBAR_TOGGLE, // Edwin 20070521
|
||||||
LFUN_BUFFER_WRITE_ALL, // rgh, gpothier 200707XX
|
LFUN_BUFFER_WRITE_ALL, // rgh, gpothier 200707XX
|
||||||
LFUN_PARAGRAPH_PARAMS,
|
LFUN_PARAGRAPH_PARAMS,
|
||||||
// 280
|
|
||||||
LFUN_LAYOUT_MODULES_CLEAR,
|
LFUN_LAYOUT_MODULES_CLEAR,
|
||||||
|
// 280
|
||||||
LFUN_LAYOUT_MODULE_ADD,
|
LFUN_LAYOUT_MODULE_ADD,
|
||||||
LFUN_LAYOUT_RELOAD,
|
LFUN_LAYOUT_RELOAD,
|
||||||
LFUN_MASTER_BUFFER_VIEW, // Tommaso, 20070920
|
LFUN_MASTER_BUFFER_VIEW, // Tommaso, 20070920
|
||||||
LFUN_MASTER_BUFFER_UPDATE, // Tommaso, 20070920
|
LFUN_MASTER_BUFFER_UPDATE, // Tommaso, 20070920
|
||||||
// 285
|
|
||||||
LFUN_INFO_INSERT, // bpeng, 20071007
|
LFUN_INFO_INSERT, // bpeng, 20071007
|
||||||
|
// 285
|
||||||
LFUN_CALL, // broider, 20071002
|
LFUN_CALL, // broider, 20071002
|
||||||
LFUN_CHAR_LEFT, // dov, 20071022
|
LFUN_CHAR_LEFT, // dov, 20071022
|
||||||
LFUN_CHAR_LEFT_SELECT, // dov, 20071022
|
LFUN_CHAR_LEFT_SELECT, // dov, 20071022
|
||||||
LFUN_CHAR_RIGHT, // dov, 20071022
|
LFUN_CHAR_RIGHT, // dov, 20071022
|
||||||
// 290
|
|
||||||
LFUN_CHAR_RIGHT_SELECT, // dov, 20071022
|
LFUN_CHAR_RIGHT_SELECT, // dov, 20071022
|
||||||
|
// 290
|
||||||
LFUN_FINISHED_BACKWARD, // dov, 20071022
|
LFUN_FINISHED_BACKWARD, // dov, 20071022
|
||||||
LFUN_FINISHED_FORWARD, // dov, 20071022
|
LFUN_FINISHED_FORWARD, // dov, 20071022
|
||||||
LFUN_WORD_LEFT, // dov, 20071028
|
LFUN_WORD_LEFT, // dov, 20071028
|
||||||
LFUN_WORD_LEFT_SELECT, // dov, 20071028
|
LFUN_WORD_LEFT_SELECT, // dov, 20071028
|
||||||
// 295
|
|
||||||
LFUN_WORD_RIGHT, // dov, 20071028
|
LFUN_WORD_RIGHT, // dov, 20071028
|
||||||
|
// 295
|
||||||
LFUN_WORD_RIGHT_SELECT, // dov, 20071028
|
LFUN_WORD_RIGHT_SELECT, // dov, 20071028
|
||||||
LFUN_MATH_MACRO_FOLD,
|
LFUN_MATH_MACRO_FOLD,
|
||||||
LFUN_MATH_MACRO_UNFOLD,
|
LFUN_MATH_MACRO_UNFOLD,
|
||||||
LFUN_MATH_MACRO_ADD_PARAM,
|
LFUN_MATH_MACRO_ADD_PARAM,
|
||||||
// 300
|
|
||||||
LFUN_MATH_MACRO_REMOVE_PARAM,
|
LFUN_MATH_MACRO_REMOVE_PARAM,
|
||||||
|
// 300
|
||||||
LFUN_MATH_MACRO_APPEND_GREEDY_PARAM,
|
LFUN_MATH_MACRO_APPEND_GREEDY_PARAM,
|
||||||
LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM,
|
LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM,
|
||||||
LFUN_MATH_MACRO_MAKE_OPTIONAL,
|
LFUN_MATH_MACRO_MAKE_OPTIONAL,
|
||||||
LFUN_MATH_MACRO_MAKE_NONOPTIONAL,
|
LFUN_MATH_MACRO_MAKE_NONOPTIONAL,
|
||||||
// 305
|
|
||||||
LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM,
|
LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM,
|
||||||
|
// 305
|
||||||
LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM,
|
LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM,
|
||||||
LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
|
LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
|
||||||
LFUN_IN_MATHMACROTEMPLATE,
|
LFUN_IN_MATHMACROTEMPLATE,
|
||||||
LFUN_SCROLL,
|
LFUN_SCROLL,
|
||||||
// 310
|
|
||||||
LFUN_UI_TOGGLE,
|
LFUN_UI_TOGGLE,
|
||||||
|
// 310
|
||||||
LFUN_SPLIT_VIEW,
|
LFUN_SPLIT_VIEW,
|
||||||
LFUN_CLOSE_TAB_GROUP,
|
LFUN_CLOSE_TAB_GROUP,
|
||||||
LFUN_COMPLETION_POPUP,
|
LFUN_COMPLETION_POPUP,
|
||||||
LFUN_COMPLETION_INLINE,
|
LFUN_COMPLETION_INLINE,
|
||||||
// 315
|
|
||||||
LFUN_COMPLETION_COMPLETE,
|
LFUN_COMPLETION_COMPLETE,
|
||||||
|
// 315
|
||||||
LFUN_NEXT_INSET_MODIFY, // JSpitzm 20080323
|
LFUN_NEXT_INSET_MODIFY, // JSpitzm 20080323
|
||||||
LFUN_LASTACTION // end of the table
|
LFUN_LASTACTION // end of the table
|
||||||
// 319
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1092,9 +1092,15 @@ void LyXAction::init()
|
|||||||
* \endvar
|
* \endvar
|
||||||
*/
|
*/
|
||||||
{ LFUN_OUTLINE_OUT, "outline-out", Noop, Edit },
|
{ LFUN_OUTLINE_OUT, "outline-out", Noop, Edit },
|
||||||
|
/*!
|
||||||
{ LFUN_EXTERNAL_EDIT, "external-edit", Noop, Edit },
|
* \var lyx::FuncCode lyx::LFUN_INSET_EDIT
|
||||||
{ LFUN_GRAPHICS_EDIT, "graphics-edit", Noop, Edit },
|
* \li Action: Edit the inset at cursor with an external application,
|
||||||
|
* if one is attributed.
|
||||||
|
* \li Syntax: inset-edit
|
||||||
|
* \li Origin: JSpitzm, 27 Apr 2006
|
||||||
|
* \endvar
|
||||||
|
*/
|
||||||
|
{ LFUN_INSET_EDIT, "inset-edit", Noop, Edit },
|
||||||
|
|
||||||
{ LFUN_CELL_BACKWARD, "cell-backward", Noop, Edit },
|
{ LFUN_CELL_BACKWARD, "cell-backward", Noop, Edit },
|
||||||
{ LFUN_CELL_FORWARD, "cell-forward", Noop, Edit },
|
{ LFUN_CELL_FORWARD, "cell-forward", Noop, Edit },
|
||||||
|
@ -622,8 +622,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
|
|||||||
case LFUN_SCREEN_FONT_UPDATE:
|
case LFUN_SCREEN_FONT_UPDATE:
|
||||||
case LFUN_SET_COLOR:
|
case LFUN_SET_COLOR:
|
||||||
case LFUN_MESSAGE:
|
case LFUN_MESSAGE:
|
||||||
case LFUN_EXTERNAL_EDIT:
|
case LFUN_INSET_EDIT:
|
||||||
case LFUN_GRAPHICS_EDIT:
|
|
||||||
case LFUN_ALL_INSETS_TOGGLE:
|
case LFUN_ALL_INSETS_TOGGLE:
|
||||||
case LFUN_BUFFER_LANGUAGE:
|
case LFUN_BUFFER_LANGUAGE:
|
||||||
case LFUN_TEXTCLASS_APPLY:
|
case LFUN_TEXTCLASS_APPLY:
|
||||||
|
@ -702,7 +702,7 @@ void GuiExternal::editExternal()
|
|||||||
{
|
{
|
||||||
applyView();
|
applyView();
|
||||||
string const lfun = InsetExternal::params2string(params_, buffer());
|
string const lfun = InsetExternal::params2string(params_, buffer());
|
||||||
dispatch(FuncRequest(LFUN_EXTERNAL_EDIT, lfun));
|
dispatch(FuncRequest(LFUN_INSET_EDIT, lfun));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
{
|
{
|
||||||
switch (cmd.action) {
|
switch (cmd.action) {
|
||||||
|
|
||||||
case LFUN_EXTERNAL_EDIT: {
|
case LFUN_INSET_EDIT: {
|
||||||
InsetExternalParams p = params();
|
InsetExternalParams p = params();
|
||||||
if (!cmd.argument().empty())
|
if (!cmd.argument().empty())
|
||||||
string2params(to_utf8(cmd.argument()), buffer(), p);
|
string2params(to_utf8(cmd.argument()), buffer(), p);
|
||||||
@ -465,7 +465,7 @@ bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
{
|
{
|
||||||
switch (cmd.action) {
|
switch (cmd.action) {
|
||||||
|
|
||||||
case LFUN_EXTERNAL_EDIT:
|
case LFUN_INSET_EDIT:
|
||||||
case LFUN_INSET_MODIFY:
|
case LFUN_INSET_MODIFY:
|
||||||
case LFUN_INSET_DIALOG_UPDATE:
|
case LFUN_INSET_DIALOG_UPDATE:
|
||||||
flag.enabled(true);
|
flag.enabled(true);
|
||||||
|
@ -184,7 +184,7 @@ InsetGraphics::~InsetGraphics()
|
|||||||
void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
|
void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||||
{
|
{
|
||||||
switch (cmd.action) {
|
switch (cmd.action) {
|
||||||
case LFUN_GRAPHICS_EDIT: {
|
case LFUN_INSET_EDIT: {
|
||||||
InsetGraphicsParams p = params();
|
InsetGraphicsParams p = params();
|
||||||
if (!cmd.argument().empty())
|
if (!cmd.argument().empty())
|
||||||
string2params(to_utf8(cmd.argument()), buffer(), p);
|
string2params(to_utf8(cmd.argument()), buffer(), p);
|
||||||
@ -224,7 +224,7 @@ bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
FuncStatus & flag) const
|
FuncStatus & flag) const
|
||||||
{
|
{
|
||||||
switch (cmd.action) {
|
switch (cmd.action) {
|
||||||
case LFUN_GRAPHICS_EDIT:
|
case LFUN_INSET_EDIT:
|
||||||
case LFUN_INSET_MODIFY:
|
case LFUN_INSET_MODIFY:
|
||||||
case LFUN_INSET_DIALOG_UPDATE:
|
case LFUN_INSET_DIALOG_UPDATE:
|
||||||
flag.enabled(true);
|
flag.enabled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user