From bb514884352902846365b02696ed5d56b5c5c34c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Mon, 24 Mar 2008 14:12:19 +0000 Subject: [PATCH] * src/BufferView.cpp: * src/Text3.cpp: - fix LFUN_INSET_SETTINGS so that it also works at cursor position. * LyXAction.cpp: - doxy. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23923 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.cpp | 2 ++ src/LyXAction.cpp | 20 +++++++++++++++++++- src/Text3.cpp | 10 +++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 0a0a642003..a338a68b10 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -948,6 +948,8 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd) case LFUN_INSET_SETTINGS: { InsetCode code = cur.inset().lyxCode(); + if (cur.nextInset()) + code = cur.nextInset()->lyxCode(); bool enable = false; switch (code) { case TABULAR_CODE: diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 034c75fbb7..ec6531e525 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -1088,7 +1088,25 @@ void LyXAction::init() */ { LFUN_NEXT_INSET_MODIFY, "next-inset-modify", ReadOnly, Edit }, { LFUN_INSET_DIALOG_UPDATE, "", Noop, Hidden }, +/*! + * \var lyx::FuncCode lyx::LFUN_INSET_SETTINGS + * \li Action: Open the inset's properties dialog. + * \li Notion: Used for box, branch, ert, float, listings, note, tabular, wrap insets. + * \li Syntax: inset-settings + * \endvar + */ { LFUN_INSET_SETTINGS, "inset-settings", ReadOnly, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_NEXT_INSET_TOGGLE + * \li Action: Toggles the inset at cursor position. For collapsables, this means it will + be (un-)collapsed, in case of other insets, the editing widget (dialog) will + be entered. Also cf. #LFUN_INSET_SETTINGS. + * \li Notion: Used for label, floats, listings, box, branch, external, wrap + bibtex, ert, command, graphics, note, space, vspace, tabular, + bibitem, inlude, ref insets. + * \li Syntax: next-inset-toggle + * \endvar + */ { LFUN_NEXT_INSET_TOGGLE, "next-inset-toggle", ReadOnly, Edit }, { LFUN_INSET_TOGGLE, "inset-toggle", ReadOnly, Hidden }, { LFUN_ALL_INSETS_TOGGLE, "all-insets-toggle", ReadOnly, Edit }, @@ -1299,7 +1317,7 @@ void LyXAction::init() * \li Action: Saves the current buffer to a temporary file. * \li Notion: Saves the current buffer to a file named "#filename#". This LFUN is called automatically by LyX, to "autosave" the current buffer. - * \li Syntax: buffer-auto-save + * \li Syntax: buffer-auto-save * \endvar */ { LFUN_BUFFER_AUTO_SAVE, "buffer-auto-save", Noop, Buffer }, diff --git a/src/Text3.cpp b/src/Text3.cpp index 86a7e8b99b..2ede8d0d5f 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -847,9 +847,17 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) needsUpdate |= dissolveInset(cur); break; - case LFUN_INSET_SETTINGS: + case LFUN_INSET_SETTINGS: { + // if there is an inset at cursor, access this + Inset * inset = cur.nextInset(); + if (inset) { + inset->showInsetDialog(bv); + break; + } + // if not work, access the underlying inset. cur.inset().showInsetDialog(bv); break; + } case LFUN_SPACE_INSERT: if (cur.paragraph().layout().free_spacing) -- 2.39.2