* 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:
Jürgen Spitzmüller 2008-04-27 16:20:12 +00:00
parent 878b3ce315
commit fa2f8d159b
7 changed files with 41 additions and 42 deletions

View File

@ -851,8 +851,7 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd)
case LFUN_FONT_STATE:
case LFUN_LABEL_INSERT:
case LFUN_INFO_INSERT:
case LFUN_EXTERNAL_EDIT:
case LFUN_GRAPHICS_EDIT:
case LFUN_INSET_EDIT:
case LFUN_PARAGRAPH_GOTO:
case LFUN_NOTE_NEXT:
case LFUN_REFERENCE_NEXT:
@ -1063,23 +1062,20 @@ bool BufferView::dispatch(FuncRequest const & cmd)
break;
}
case LFUN_EXTERNAL_EDIT: {
case LFUN_INSET_EDIT: {
FuncRequest fr(cmd);
InsetExternal * inset = getInsetByCode<InsetExternal>(d->cursor_,
EXTERNAL_CODE);
// if there is an inset at cursor, see whether it
// can be modified.
Inset * inset = cur.nextInset();
if (inset)
inset->dispatch(d->cursor_, fr);
break;
}
inset->dispatch(cur, fr);
// if it did not work, try the underlying inset.
if (!inset || !cur.result().dispatched())
cur.dispatch(cmd);
case LFUN_GRAPHICS_EDIT: {
FuncRequest fr(cmd);
InsetGraphics * inset = getInsetByCode<InsetGraphics>(d->cursor_,
GRAPHICS_CODE);
if (inset)
inset->dispatch(d->cursor_, fr);
break;
if (!cur.result().dispatched())
// It did not work too; no action needed.
break;
}
case LFUN_PARAGRAPH_GOTO: {

View File

@ -306,7 +306,7 @@ enum FuncCode
LFUN_PARAGRAPH_PARAMS_APPLY,
LFUN_PARAGRAPH_UPDATE,
// 230
LFUN_EXTERNAL_EDIT,
LFUN_INSET_EDIT, // JSpitzm 20080427
LFUN_BRANCH_INSERT,
LFUN_BOX_INSERT,
LFUN_LINE_INSERT,
@ -331,87 +331,85 @@ enum FuncCode
LFUN_BUFFER_PARAMS_APPLY,
// 250
LFUN_LYXRC_APPLY,
LFUN_GRAPHICS_EDIT,
LFUN_BUFFER_NEXT,
LFUN_BUFFER_PREVIOUS,
LFUN_STATISTICS,
// 255
LFUN_CHANGES_OUTPUT, // jspitzm 20050121
// 255
LFUN_BIBTEX_DATABASE_ADD,
LFUN_BIBTEX_DATABASE_DEL,
LFUN_CITATION_INSERT,
LFUN_OUTLINE_UP,
// 260
LFUN_OUTLINE_DOWN,
// 260
LFUN_OUTLINE_IN,
LFUN_OUTLINE_OUT,
LFUN_PARAGRAPH_MOVE_DOWN,
LFUN_PARAGRAPH_MOVE_UP,
// 265
LFUN_BUFFER_TOGGLE_COMPRESSION, // bpeng 20060427
// 265
LFUN_MATH_BIGDELIM,
LFUN_CLIPBOARD_PASTE,
LFUN_INSET_DISSOLVE, // jspitzm 20060807
LFUN_CHANGE_NEXT,
// 270
LFUN_WINDOW_NEW, // Abdel 20061021
// 270
LFUN_WINDOW_CLOSE, // Abdel 20061023
LFUN_UNICODE_INSERT, // Lgb 20061022
LFUN_BOOKMARK_CLEAR, // bpeng 20061031
LFUN_NOMENCL_INSERT, // Ugras
// 275
LFUN_NOMENCL_PRINT, // Ugras
// 275
LFUN_LISTING_INSERT, // Herbert 20011110, bpeng 20070502
LFUN_TOOLBAR_TOGGLE, // Edwin 20070521
LFUN_BUFFER_WRITE_ALL, // rgh, gpothier 200707XX
LFUN_PARAGRAPH_PARAMS,
// 280
LFUN_LAYOUT_MODULES_CLEAR,
// 280
LFUN_LAYOUT_MODULE_ADD,
LFUN_LAYOUT_RELOAD,
LFUN_MASTER_BUFFER_VIEW, // Tommaso, 20070920
LFUN_MASTER_BUFFER_UPDATE, // Tommaso, 20070920
// 285
LFUN_INFO_INSERT, // bpeng, 20071007
// 285
LFUN_CALL, // broider, 20071002
LFUN_CHAR_LEFT, // dov, 20071022
LFUN_CHAR_LEFT_SELECT, // dov, 20071022
LFUN_CHAR_RIGHT, // dov, 20071022
// 290
LFUN_CHAR_RIGHT_SELECT, // dov, 20071022
// 290
LFUN_FINISHED_BACKWARD, // dov, 20071022
LFUN_FINISHED_FORWARD, // dov, 20071022
LFUN_WORD_LEFT, // dov, 20071028
LFUN_WORD_LEFT_SELECT, // dov, 20071028
// 295
LFUN_WORD_RIGHT, // dov, 20071028
// 295
LFUN_WORD_RIGHT_SELECT, // dov, 20071028
LFUN_MATH_MACRO_FOLD,
LFUN_MATH_MACRO_UNFOLD,
LFUN_MATH_MACRO_ADD_PARAM,
// 300
LFUN_MATH_MACRO_REMOVE_PARAM,
// 300
LFUN_MATH_MACRO_APPEND_GREEDY_PARAM,
LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM,
LFUN_MATH_MACRO_MAKE_OPTIONAL,
LFUN_MATH_MACRO_MAKE_NONOPTIONAL,
// 305
LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM,
// 305
LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM,
LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
LFUN_IN_MATHMACROTEMPLATE,
LFUN_SCROLL,
// 310
LFUN_UI_TOGGLE,
// 310
LFUN_SPLIT_VIEW,
LFUN_CLOSE_TAB_GROUP,
LFUN_COMPLETION_POPUP,
LFUN_COMPLETION_INLINE,
// 315
LFUN_COMPLETION_COMPLETE,
// 315
LFUN_NEXT_INSET_MODIFY, // JSpitzm 20080323
LFUN_LASTACTION // end of the table
// 319
};

View File

@ -1092,9 +1092,15 @@ void LyXAction::init()
* \endvar
*/
{ LFUN_OUTLINE_OUT, "outline-out", Noop, Edit },
{ LFUN_EXTERNAL_EDIT, "external-edit", Noop, Edit },
{ LFUN_GRAPHICS_EDIT, "graphics-edit", Noop, Edit },
/*!
* \var lyx::FuncCode lyx::LFUN_INSET_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_FORWARD, "cell-forward", Noop, Edit },

View File

@ -622,8 +622,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
case LFUN_SCREEN_FONT_UPDATE:
case LFUN_SET_COLOR:
case LFUN_MESSAGE:
case LFUN_EXTERNAL_EDIT:
case LFUN_GRAPHICS_EDIT:
case LFUN_INSET_EDIT:
case LFUN_ALL_INSETS_TOGGLE:
case LFUN_BUFFER_LANGUAGE:
case LFUN_TEXTCLASS_APPLY:

View File

@ -702,7 +702,7 @@ void GuiExternal::editExternal()
{
applyView();
string const lfun = InsetExternal::params2string(params_, buffer());
dispatch(FuncRequest(LFUN_EXTERNAL_EDIT, lfun));
dispatch(FuncRequest(LFUN_INSET_EDIT, lfun));
}

View File

@ -427,7 +427,7 @@ void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd)
{
switch (cmd.action) {
case LFUN_EXTERNAL_EDIT: {
case LFUN_INSET_EDIT: {
InsetExternalParams p = params();
if (!cmd.argument().empty())
string2params(to_utf8(cmd.argument()), buffer(), p);
@ -465,7 +465,7 @@ bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd,
{
switch (cmd.action) {
case LFUN_EXTERNAL_EDIT:
case LFUN_INSET_EDIT:
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
flag.enabled(true);

View File

@ -184,7 +184,7 @@ InsetGraphics::~InsetGraphics()
void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
{
switch (cmd.action) {
case LFUN_GRAPHICS_EDIT: {
case LFUN_INSET_EDIT: {
InsetGraphicsParams p = params();
if (!cmd.argument().empty())
string2params(to_utf8(cmd.argument()), buffer(), p);
@ -224,7 +224,7 @@ bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
switch (cmd.action) {
case LFUN_GRAPHICS_EDIT:
case LFUN_INSET_EDIT:
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
flag.enabled(true);