get rid of next-inset-modify ; inset-modify does the same now

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32965 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2010-01-11 15:50:07 +00:00
parent 0553351d71
commit a00fbcd871
7 changed files with 79 additions and 126 deletions

View File

@ -75,6 +75,8 @@ The following LyX functions have been removed:
- LFUN_NEXT_INSET_TOGGLE ("next-inset-toggle"): use "inset-toggle" instead. - LFUN_NEXT_INSET_TOGGLE ("next-inset-toggle"): use "inset-toggle" instead.
- LFUN_NEXT_INSET_MODIFY ("next-inset-modify"): use "inset-modify" instead.
- LFUN_PARAGRAPH_SPACING ("paragraph-spacing"): use "paragraph-params" instead. - LFUN_PARAGRAPH_SPACING ("paragraph-spacing"): use "paragraph-params" instead.

View File

@ -85,12 +85,12 @@ Menuset
Item "Next Cross-Reference|N" "reference-next" Item "Next Cross-Reference|N" "reference-next"
Item "Go to Label|G" "label-goto" Item "Go to Label|G" "label-goto"
Separator Separator
Item "<Reference>|R" "next-inset-modify changetype ref" Item "<Reference>|R" "inset-modify changetype ref"
Item "(<Reference>)|e" "next-inset-modify changetype eqref" Item "(<Reference>)|e" "inset-modify changetype eqref"
Item "<Page>|P" "next-inset-modify changetype pageref" Item "<Page>|P" "inset-modify changetype pageref"
Item "On Page <Page>|O" "next-inset-modify changetype vpageref" Item "On Page <Page>|O" "inset-modify changetype vpageref"
Item "<Reference> on Page <Page>|f" "next-inset-modify changetype vref" Item "<Reference> on Page <Page>|f" "inset-modify changetype vref"
Item "Formatted Reference|t" "next-inset-modify changetype prettyref" Item "Formatted Reference|t" "inset-modify changetype prettyref"
Separator Separator
Item "Settings...|S" "inset-settings" Item "Settings...|S" "inset-settings"
End End
@ -151,14 +151,14 @@ Menuset
# #
Menu "context-box" Menu "context-box"
Item "Frameless|l" "next-inset-modify changetype Frameless" Item "Frameless|l" "inset-modify changetype Frameless"
Item "Simple Frame|F" "next-inset-modify changetype Boxed" Item "Simple Frame|F" "inset-modify changetype Boxed"
Item "Simple Frame, Page Breaks|P" "next-inset-modify changetype Framed" Item "Simple Frame, Page Breaks|P" "inset-modify changetype Framed"
Item "Oval, Thin|a" "next-inset-modify changetype ovalbox" Item "Oval, Thin|a" "inset-modify changetype ovalbox"
Item "Oval, Thick|v" "next-inset-modify changetype Ovalbox" Item "Oval, Thick|v" "inset-modify changetype Ovalbox"
Item "Drop Shadow|w" "next-inset-modify changetype Shadowbox" Item "Drop Shadow|w" "inset-modify changetype Shadowbox"
Item "Shaded Background|B" "next-inset-modify changetype Shaded" Item "Shaded Background|B" "inset-modify changetype Shaded"
Item "Double Frame|u" "next-inset-modify changetype Doublebox" Item "Double Frame|u" "inset-modify changetype Doublebox"
Separator Separator
OptItem "Open Inset|O" "inset-toggle open" OptItem "Open Inset|O" "inset-toggle open"
OptItem "Close Inset|C" "inset-toggle close" OptItem "Close Inset|C" "inset-toggle close"
@ -172,9 +172,9 @@ Menuset
# #
Menu "context-note" Menu "context-note"
Item "LyX Note|N" "next-inset-modify note Note Note" Item "LyX Note|N" "inset-modify note Note Note"
Item "Comment|m" "next-inset-modify note Note Comment" Item "Comment|m" "inset-modify note Note Comment"
Item "Greyed Out|G" "next-inset-modify note Note Greyedout" Item "Greyed Out|G" "inset-modify note Note Greyedout"
Separator Separator
OptItem "Open Inset|O" "inset-toggle open" OptItem "Open Inset|O" "inset-toggle open"
OptItem "Close Inset|C" "inset-toggle close" OptItem "Close Inset|C" "inset-toggle close"
@ -190,9 +190,9 @@ Menuset
# #
Menu "context-phantom" Menu "context-phantom"
Item "Phantom" "next-inset-modify phantom Phantom Phantom" Item "Phantom" "inset-modify phantom Phantom Phantom"
Item "Horiz. Phantom" "next-inset-modify phantom Phantom HPhantom" Item "Horiz. Phantom" "inset-modify phantom Phantom HPhantom"
Item "Vert. Phantom" "next-inset-modify phantom Phantom VPhantom" Item "Vert. Phantom" "inset-modify phantom Phantom VPhantom"
Separator Separator
Item "Dissolve Inset|D" "inset-dissolve" Item "Dissolve Inset|D" "inset-dissolve"
End End
@ -201,23 +201,23 @@ Menuset
# InsetSpace context menu # InsetSpace context menu
# #
Menu "context-space" Menu "context-space"
Item "Interword Space|w" "next-inset-modify space \space{}" Item "Interword Space|w" "inset-modify space \space{}"
Item "Protected Space|o" "next-inset-modify space ~" Item "Protected Space|o" "inset-modify space ~"
Item "Thin Space|T" "next-inset-modify space \thinspace{}" Item "Thin Space|T" "inset-modify space \thinspace{}"
Item "Negative Thin Space|N" "next-inset-modify space \negthinspace{}" Item "Negative Thin Space|N" "inset-modify space \negthinspace{}"
Item "Half Quad Space (Enskip)|k" "next-inset-modify space \enskip{}" Item "Half Quad Space (Enskip)|k" "inset-modify space \enskip{}"
Item "Protected Half Quad Space (Enspace)|E" "next-inset-modify space \enspace{}" Item "Protected Half Quad Space (Enspace)|E" "inset-modify space \enspace{}"
Item "Quad Space|Q" "next-inset-modify space \quad{}" Item "Quad Space|Q" "inset-modify space \quad{}"
Item "Double Quad Space|u" "next-inset-modify space \qquad{}" Item "Double Quad Space|u" "inset-modify space \qquad{}"
Item "Horizontal Fill|F" "next-inset-modify space \hfill{}" Item "Horizontal Fill|F" "inset-modify space \hfill{}"
Item "Protected Horizontal Fill|i" "next-inset-modify space \hspace*{\fill}" Item "Protected Horizontal Fill|i" "inset-modify space \hspace*{\fill}"
Item "Horizontal Fill (Dots)|D" "next-inset-modify space \dotfill{}" Item "Horizontal Fill (Dots)|D" "inset-modify space \dotfill{}"
Item "Horizontal Fill (Rule)|R" "next-inset-modify space \hrulefill{}" Item "Horizontal Fill (Rule)|R" "inset-modify space \hrulefill{}"
Item "Horizontal Fill (Left Arrow)|L" "next-inset-modify space \leftarrowfill{}" Item "Horizontal Fill (Left Arrow)|L" "inset-modify space \leftarrowfill{}"
Item "Horizontal Fill (Right Arrow)|g" "next-inset-modify space \rightarrowfill{}" Item "Horizontal Fill (Right Arrow)|g" "inset-modify space \rightarrowfill{}"
Item "Horizontal Fill (Up Brace)|p" "next-inset-modify space \upbracefill{}" Item "Horizontal Fill (Up Brace)|p" "inset-modify space \upbracefill{}"
Item "Horizontal Fill (Down Brace)|B" "next-inset-modify space \downbracefill{}" Item "Horizontal Fill (Down Brace)|B" "inset-modify space \downbracefill{}"
Item "Custom Length|C" "command-sequence next-inset-modify space \hspace{} \length 1in; inset-settings" Item "Custom Length|C" "command-sequence inset-modify space \hspace{} \length 1in; inset-settings"
Separator Separator
Item "Settings...|S" "inset-settings" Item "Settings...|S" "inset-settings"
End End
@ -226,16 +226,16 @@ Menuset
# InsetMathSpace context menu # InsetMathSpace context menu
# #
Menu "context-mathspace" Menu "context-mathspace"
Item "Thin Space|T" "next-inset-modify mathspace \thinspace{}" Item "Thin Space|T" "inset-modify mathspace \thinspace{}"
Item "Medium Space|M" "next-inset-modify mathspace \medspace{}" Item "Medium Space|M" "inset-modify mathspace \medspace{}"
Item "Thick Space|h" "next-inset-modify mathspace \thickspace{}" Item "Thick Space|h" "inset-modify mathspace \thickspace{}"
Item "Negative Thin Space|N" "next-inset-modify mathspace \negthinspace{}" Item "Negative Thin Space|N" "inset-modify mathspace \negthinspace{}"
Item "Negative Medium Space|u" "next-inset-modify mathspace \negmedspace{}" Item "Negative Medium Space|u" "inset-modify mathspace \negmedspace{}"
Item "Negative Thick Space|i" "next-inset-modify mathspace \negthickspace{}" Item "Negative Thick Space|i" "inset-modify mathspace \negthickspace{}"
Item "Half Quad Space (Enskip)|k" "next-inset-modify mathspace \enskip{}" Item "Half Quad Space (Enskip)|k" "inset-modify mathspace \enskip{}"
Item "Quad Space|Q" "next-inset-modify mathspace \quad{}" Item "Quad Space|Q" "inset-modify mathspace \quad{}"
Item "Double Quad Space|u" "next-inset-modify mathspace \qquad{}" Item "Double Quad Space|u" "inset-modify mathspace \qquad{}"
Item "Custom Length|C" "command-sequence next-inset-modify mathspace \hspace{} \length 1in; inset-settings" Item "Custom Length|C" "command-sequence inset-modify mathspace \hspace{} \length 1in; inset-settings"
Separator Separator
Item "Settings...|S" "inset-settings" Item "Settings...|S" "inset-settings"
End End
@ -244,12 +244,12 @@ Menuset
# InsetVSpace context menu # InsetVSpace context menu
# #
Menu "context-vspace" Menu "context-vspace"
Item "DefSkip|D" "next-inset-modify vspace defskip" Item "DefSkip|D" "inset-modify vspace defskip"
Item "SmallSkip|S" "next-inset-modify vspace smallskip" Item "SmallSkip|S" "inset-modify vspace smallskip"
Item "MedSkip|M" "next-inset-modify vspace medskip" Item "MedSkip|M" "inset-modify vspace medskip"
Item "BigSkip|B" "next-inset-modify vspace bigskip" Item "BigSkip|B" "inset-modify vspace bigskip"
Item "VFill|F" "next-inset-modify vspace vfill" Item "VFill|F" "inset-modify vspace vfill"
Item "Custom|C" "command-sequence next-inset-modify vspace 1in; inset-settings" Item "Custom|C" "command-sequence inset-modify vspace 1in; inset-settings"
Separator Separator
Item "Settings...|e" "inset-settings" Item "Settings...|e" "inset-settings"
End End
@ -258,11 +258,11 @@ Menuset
# InsetInclude context menu # InsetInclude context menu
# #
Menu "context-include" Menu "context-include"
Item "Include|c" "next-inset-modify changetype include" Item "Include|c" "inset-modify changetype include"
Item "Input|p" "next-inset-modify changetype input" Item "Input|p" "inset-modify changetype input"
Item "Verbatim|V" "next-inset-modify changetype verbatiminput" Item "Verbatim|V" "inset-modify changetype verbatiminput"
Item "Verbatim (marked blanks)|b" "next-inset-modify changetype verbatiminput*" Item "Verbatim (marked blanks)|b" "inset-modify changetype verbatiminput*"
Item "Listing|L" "next-inset-modify changetype lstinputlisting" Item "Listing|L" "inset-modify changetype lstinputlisting"
Separator Separator
Item "Settings...|S" "inset-settings" Item "Settings...|S" "inset-settings"
Separator Separator
@ -273,18 +273,18 @@ Menuset
# InsetNewpage context menu # InsetNewpage context menu
# #
Menu "context-newpage" Menu "context-newpage"
Item "New Page|N" "next-inset-modify newpage newpage" Item "New Page|N" "inset-modify newpage newpage"
Item "Page Break|a" "next-inset-modify newpage pagebreak" Item "Page Break|a" "inset-modify newpage pagebreak"
Item "Clear Page|C" "next-inset-modify newpage clearpage" Item "Clear Page|C" "inset-modify newpage clearpage"
Item "Clear Double Page|D" "next-inset-modify newpage cleardoublepage" Item "Clear Double Page|D" "inset-modify newpage cleardoublepage"
End End
# #
# InsetNewline context menu # InsetNewline context menu
# #
Menu "context-newline" Menu "context-newline"
Item "Ragged Line Break|R" "next-inset-modify newline newline" Item "Ragged Line Break|R" "inset-modify newline newline"
Item "Justified Line Break|J" "next-inset-modify newline linebreak" Item "Justified Line Break|J" "inset-modify newline linebreak"
End End
# #
@ -541,10 +541,10 @@ Menuset
# #
Menu "context-indexprint" Menu "context-indexprint"
Item "All Indexes|A" "next-inset-modify check-printindex*" Item "All Indexes|A" "inset-modify check-printindex*"
IndicesListsContext IndicesListsContext
Separator Separator
Item "Subindex|b" "next-inset-modify toggle-subindex" Item "Subindex|b" "inset-modify toggle-subindex"
Separator Separator
OptItem "Settings...|S" "inset-settings" OptItem "Settings...|S" "inset-settings"
End End

View File

@ -1039,18 +1039,6 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
break; break;
} }
case LFUN_NEXT_INSET_MODIFY: {
// this is the real function we want to invoke
FuncRequest tmpcmd = cmd;
tmpcmd.action = LFUN_INSET_MODIFY;
// if there is an inset at cursor, see whether it
// handles the lfun, other start from scratch
Inset * inset = cur.nextInset();
if (!inset || !inset->getStatus(cur, tmpcmd, flag))
flag = lyx::getStatus(tmpcmd);
break;
}
case LFUN_LABEL_GOTO: { case LFUN_LABEL_GOTO: {
flag.setEnabled(!cmd.argument().empty() flag.setEnabled(!cmd.argument().empty()
|| getInsetByCode<InsetRef>(cur, REF_CODE)); || getInsetByCode<InsetRef>(cur, REF_CODE));
@ -1630,31 +1618,6 @@ bool BufferView::dispatch(FuncRequest const & cmd)
break; break;
} }
case LFUN_NEXT_INSET_MODIFY: {
// create the the real function we want to invoke
FuncRequest tmpcmd = cmd;
tmpcmd.action = LFUN_INSET_MODIFY;
// if there is an inset at cursor, see whether it
// can be modified.
Inset * inset = cur.nextInset();
if (inset) {
cur.recordUndo();
inset->dispatch(cur, tmpcmd);
}
// if it did not work, try the underlying inset.
if (!inset || !cur.result().dispatched()) {
cur.recordUndo();
cur.dispatch(tmpcmd);
}
if (!cur.result().dispatched())
// It did not work too; no action needed.
break;
cur.clearSelection();
processUpdateFlags(Update::Force | Update::FitCursor);
break;
}
case LFUN_SCREEN_UP: case LFUN_SCREEN_UP:
case LFUN_SCREEN_DOWN: { case LFUN_SCREEN_DOWN: {
Point p = getPos(cur, cur.boundary()); Point p = getPos(cur, cur.boundary());

View File

@ -205,7 +205,7 @@ enum FuncCode
LFUN_PARAGRAPH_DOWN, // Asger 1996-10-01 LFUN_PARAGRAPH_DOWN, // Asger 1996-10-01
// 145 // 145
LFUN_PARAGRAPH_DOWN_SELECT, // Asger 1996-10-01 LFUN_PARAGRAPH_DOWN_SELECT, // Asger 1996-10-01
LFUN_NEXT_INSET_MODIFY, // JSpitzm 20080323 LFUN_INSET_FORALL, // lasgouttes, 20091127
LFUN_BUFFER_NEW_TEMPLATE, // Asger 1997-02-02 LFUN_BUFFER_NEW_TEMPLATE, // Asger 1997-02-02
LFUN_BUFFER_RELOAD, // Asger 1997-02-02 LFUN_BUFFER_RELOAD, // Asger 1997-02-02
LFUN_RECONFIGURE, LFUN_RECONFIGURE,
@ -445,7 +445,6 @@ enum FuncCode
LFUN_CURSOR_FOLLOWS_SCROLLBAR_TOGGLE, // ARRae 971202 LFUN_CURSOR_FOLLOWS_SCROLLBAR_TOGGLE, // ARRae 971202
// 345 // 345
LFUN_DEBUG_LEVEL_SET, LFUN_DEBUG_LEVEL_SET,
LFUN_INSET_FORALL, // lasgouttes, 20091127
LFUN_LASTACTION // end of the table LFUN_LASTACTION // end of the table
}; };

View File

@ -2316,28 +2316,17 @@ void LyXAction::init()
{ LFUN_INSET_INSERT, "inset-insert", Noop, Edit }, { LFUN_INSET_INSERT, "inset-insert", Noop, Edit },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_INSET_MODIFY * \var lyx::FuncCode lyx::LFUN_INSET_MODIFY
* \li Action: Modify existing inset. * \li Action: Modify some properties of an inset.
* \li Notion: Used for bibitem, bibtex, box, branch, command, ert, external, * \li Notion: Used for bibitem, bibtex, box, branch, command, ert, external,
floats, graphics, include, label, listings, note, floats, graphics, include, index, info, label,
phantom, ref, space, tabular, vspace, wrap insets. listings, newline, newpage, nomencl, note, phantom,
ref, space, tabular, vspace, wrap insets.
* \li Syntax: inset-modify <INSET> <ARGS> * \li Syntax: inset-modify <INSET> <ARGS>
* \li Syntax: inset-modify changetype <TYPE>
* \li Params: See #LFUN_INSET_INSERT for further details. * \li Params: See #LFUN_INSET_INSERT for further details.
* \endvar * \endvar
*/ */
{ LFUN_INSET_MODIFY, "", Noop, Hidden }, { LFUN_INSET_MODIFY, "inset-modify", AtPoint, Edit },
/*!
* \var lyx::FuncCode lyx::LFUN_NEXT_INSET_MODIFY
* \li Action: Modify the inset at cursor position, if there is one.
* \li Notion: Used for bibitem, bibtex, box, branch, command, ert, external,
floats, graphics, include, label, listings, note,
phantom, ref, space, tabular, vspace, wrap insets.
* \li Syntax: next-inset-modify <INSET> <ARGS>
* \li Syntax: next-inset-modify changetype <TYPE>
* \li Params: See #LFUN_INSET_INSERT for further details.
* \li Origin: JSpitzm, 23 Mar 2008
* \endvar
*/
{ LFUN_NEXT_INSET_MODIFY, "next-inset-modify", Noop, Edit },
/*! /*!
* \var lyx::FuncCode lyx::LFUN_INSET_DIALOG_UPDATE * \var lyx::FuncCode lyx::LFUN_INSET_DIALOG_UPDATE
* \li Action: Updates the values inside the dialog from the inset. * \li Action: Updates the values inside the dialog from the inset.

View File

@ -96,7 +96,7 @@ void GuiInfo::applyView()
if (!ii->validate(argument)) if (!ii->validate(argument))
return; return;
dispatch(FuncRequest(LFUN_NEXT_INSET_MODIFY, argument)); dispatch(FuncRequest(LFUN_INSET_MODIFY, argument));
// FIXME: update the inset contents // FIXME: update the inset contents
bufferview()->buffer().updateLabels(); bufferview()->buffer().updateLabels();
BufferView * bv = const_cast<BufferView *>(bufferview()); BufferView * bv = const_cast<BufferView *>(bufferview());

View File

@ -1271,12 +1271,12 @@ void MenuDefinition::expandIndicesContext(Buffer const * buf, bool listof)
p["type"] = cit->shortcut(); p["type"] = cit->shortcut();
string const data = InsetCommand::params2string("index_print", p); string const data = InsetCommand::params2string("index_print", p);
addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(cit->index()), addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(cit->index()),
FuncRequest(LFUN_NEXT_INSET_MODIFY, data))); FuncRequest(LFUN_INSET_MODIFY, data)));
} else { } else {
docstring label = _("Index Entry"); docstring label = _("Index Entry");
label += " (" + cit->index() + ")"; label += " (" + cit->index() + ")";
addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(label), addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(label),
FuncRequest(LFUN_NEXT_INSET_MODIFY, FuncRequest(LFUN_INSET_MODIFY,
from_ascii("changetype ") + cit->shortcut()))); from_ascii("changetype ") + cit->shortcut())));
} }
} }
@ -1317,7 +1317,7 @@ void MenuDefinition::expandCiteStyles(BufferView const * bv)
CiteStyle cst = citeStyleList[ii - 1]; CiteStyle cst = citeStyleList[ii - 1];
cs.style = cst; cs.style = cst;
addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(label), addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(label),
FuncRequest(LFUN_NEXT_INSET_MODIFY, FuncRequest(LFUN_INSET_MODIFY,
"changetype " + from_utf8(citationStyleToString(cs))))); "changetype " + from_utf8(citationStyleToString(cs)))));
} }
} }