]> git.lyx.org Git - features.git/commitdiff
* Move handling of LFUN_INSET_SETTINGS to Inset,
authorVincent van Ravesteijn <vfr@lyx.org>
Wed, 22 Apr 2009 20:55:13 +0000 (20:55 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Wed, 22 Apr 2009 20:55:13 +0000 (20:55 +0000)
* Remove the EDITABLE enum,
* add functions hasSettings() for all insets.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29375 a592a061-630c-0410-9148-cb99ea01b6c8

49 files changed:
src/BufferView.cpp
src/DocIterator.cpp
src/Text2.cpp
src/insets/Inset.cpp
src/insets/Inset.h
src/insets/InsetBibitem.h
src/insets/InsetBibtex.h
src/insets/InsetBox.cpp
src/insets/InsetBranch.cpp
src/insets/InsetCitation.h
src/insets/InsetCollapsable.cpp
src/insets/InsetCollapsable.h
src/insets/InsetCommand.cpp
src/insets/InsetERT.cpp
src/insets/InsetExternal.cpp
src/insets/InsetExternal.h
src/insets/InsetFlex.h
src/insets/InsetFloat.cpp
src/insets/InsetFloatList.h
src/insets/InsetFootlike.h
src/insets/InsetGraphics.cpp
src/insets/InsetGraphics.h
src/insets/InsetHyperlink.h
src/insets/InsetInclude.cpp
src/insets/InsetInclude.h
src/insets/InsetIndex.cpp
src/insets/InsetIndex.h
src/insets/InsetInfo.h
src/insets/InsetLabel.h
src/insets/InsetListings.cpp
src/insets/InsetNomencl.h
src/insets/InsetNote.cpp
src/insets/InsetOptArg.h
src/insets/InsetPhantom.cpp
src/insets/InsetRef.h
src/insets/InsetSpace.cpp
src/insets/InsetSpace.h
src/insets/InsetTOC.h
src/insets/InsetTabular.cpp
src/insets/InsetTabular.h
src/insets/InsetText.h
src/insets/InsetVSpace.cpp
src/insets/InsetVSpace.h
src/insets/InsetWrap.cpp
src/mathed/InsetFormulaMacro.h
src/mathed/InsetMathHull.h
src/mathed/InsetMathSpace.h
src/mathed/MathMacroTemplate.h
src/rowpainter.cpp

index 3c2fd470f4bbb4a93d125b26bfda6c01b30264a5..6089756f9bbae041d28cc8322a1b4ff34712a579 100644 (file)
@@ -729,7 +729,7 @@ bool BufferView::moveToPosition(pit_type bottom_pit, pos_type bottom_pos,
                        // insets.
                        size_t const n = dit.depth();
                        for (size_t i = 0; i < n; ++i)
-                               if (dit[i].inset().editable() != Inset::HIGHLY_EDITABLE) {
+                               if (!dit[i].inset().editable()) {
                                        dit.resize(i);
                                        break;
                                }
index 51433d47814b617463aa30273e78d02b75c2a7f6..49705bc96b0fce1d29113a092c610ea2f9ea3f21 100644 (file)
@@ -315,7 +315,7 @@ void DocIterator::forwardPosIgnoreCollapsed()
        // FIXME: the check for asInsetMath() shouldn't be necessary
        // but math insets do not return a sensible editable() state yet.
        if (nextinset && !nextinset->asInsetMath()
-           && nextinset->editable() != Inset::HIGHLY_EDITABLE) {
+           && !nextinset->editable()) {
                ++top().pos();
                return;
        }
index d592e6637b7e887631a48947afd5df7089e593e8..b32f3a05261809cd9f922c4c99e10fe67e5d7703 100644 (file)
@@ -573,7 +573,7 @@ bool Text::checkAndActivateInset(Cursor & cur, bool front)
        if (!front && cur.pos() == 0)
                return false;
        Inset * inset = front ? cur.nextInset() : cur.prevInset();
-       if (!inset || inset->editable() != Inset::HIGHLY_EDITABLE)
+       if (!inset || !inset->editable())
                return false;
        /*
         * Apparently, when entering an inset we are expected to be positioned
@@ -599,7 +599,7 @@ bool Text::checkAndActivateInsetVisual(Cursor & cur, bool movingForward, bool mo
                return false;
        Paragraph & par = cur.paragraph();
        Inset * inset = par.isInset(cur.pos()) ? par.getInset(cur.pos()) : 0;
-       if (!inset || inset->editable() != Inset::HIGHLY_EDITABLE)
+       if (!inset || !inset->editable())
                return false;
        inset->edit(cur, movingForward, 
                movingLeft ? Inset::ENTRY_DIRECTION_RIGHT : Inset::ENTRY_DIRECTION_LEFT);
index 29984f0679253b0e0568d59d5770c989b56e9f2a..aa71a47a6de686de7268e45aa9def4b47ad44f39 100644 (file)
@@ -223,15 +223,19 @@ void Inset::doDispatch(Cursor & cur, FuncRequest &cmd)
        case LFUN_MOUSE_RELEASE:
                // if the derived inset did not explicitly handle mouse_release,
                // we assume we request the settings dialog
-               if (!cur.selection() && cmd.button() == mouse_button::button1) {
+               if (!cur.selection() && cmd.button() == mouse_button::button1
+                         && hasSettings()) {
                        FuncRequest tmpcmd(LFUN_INSET_SETTINGS);
                        dispatch(cur, tmpcmd);
                }
                break;
 
        case LFUN_INSET_SETTINGS:
-               showInsetDialog(&cur.bv());
-               cur.dispatched();
+               if (cmd.argument().empty() || cmd.getArg(0) == insetName(lyxCode())) {
+                       showInsetDialog(&cur.bv());
+                       cur.dispatched();
+               } else
+                       cur.undispatched();
                break;
 
        default:
@@ -269,8 +273,14 @@ bool Inset::getStatus(Cursor &, FuncRequest const & cmd,
                return true;
 
        case LFUN_INSET_SETTINGS:
-               flag.setEnabled(false);
-               return true;
+               if (cmd.argument().empty() || cmd.getArg(0) == insetName(lyxCode())) {
+                       bool const enable = hasSettings();
+                       flag.setEnabled(enable);
+                       return true;
+               } else {
+                       flag.setEnabled(false);
+                       return false;
+               }
 
        default:
                break;
@@ -326,12 +336,19 @@ bool Inset::directWrite() const
 }
 
 
-Inset::EDITABLE Inset::editable() const
+bool Inset::editable() const
+{
+       return false;
+}
+
+
+bool Inset::hasSettings() const
 {
-       return NOT_EDITABLE;
+       return false;
 }
 
 
+
 bool Inset::autoDelete() const
 {
        return false;
index ac7bb21387c70c56c27a770e7b9a5bf2b11fb2c1..25af09fc28e4fa870c93dcf509c2d5d9a8bdbd9b 100644 (file)
@@ -213,9 +213,6 @@ public:
        /// Force inset into LTR environment if surroundings are RTL?
        virtual bool forceLTR() const { return false; }
 
-       /// is this an inset that can be moved into?
-       /// FIXME: merge with editable()
-       virtual bool isActive() const { return nargs() > 0; }
        /// Where should we go when we press the up or down cursor key?
        virtual bool idxUpDown(Cursor & cur, bool up) const;
        /// Move one cell backwards
@@ -301,27 +298,21 @@ public:
        /// the string that is passed to the TOC
        virtual void tocString(odocstream &) const {}
 
-       /** This enum indicates by which means the inset can be modified:
-       - NOT_EDITABLE: the inset's content cannot be modified at all
-         (e.g. printindex, insetspecialchar)
-       - IS_EDITABLE: content can be edited via dialog (e.g. bibtex, index, href)
-       - HIGHLY_EDITABLE: content can be edited on screen (normally means that
-         insettext is contained, e.g. collapsables, tabular) */
-       // FIXME: This has not yet been fully implemented to math insets
-       enum EDITABLE {
-               ///
-               NOT_EDITABLE = 0,
-               ///
-               IS_EDITABLE,
-               ///
-               HIGHLY_EDITABLE
-       };
        /// what appears in the minibuffer when opening
        virtual docstring editMessage() const;
-       ///
-       virtual EDITABLE editable() const;
+       /// can the contents of the inset be edited on screen ?
+       // true for InsetCollapsables (not ButtonOnly) (not InsetInfo), InsetText
+       virtual bool editable() const;
+       /// has the Inset settings that can be modified in a dialog ?
+       virtual bool hasSettings() const;
        /// can we go further down on mouse click?
+       // true for InsetCaption, InsetCollapsables (not ButtonOnly), InsetTabular
        virtual bool descendable() const { return false; }
+       /// is this an inset that can be moved into?
+       /// FIXME: merge with editable()
+       // true for InsetTabular & InsetText
+       virtual bool isActive() const { return nargs() > 0; }
+
        /// does this contain text that can be change track marked in DVI?
        virtual bool canTrackChanges() const { return false; }
        /// return true if the inset should be removed automatically
index 435dd7197282a4491a50f9d8e31548a2b5284464..ca5559ce42e938b6c693c8479dae4711a35ad305 100644 (file)
@@ -53,7 +53,7 @@ private:
        ///
        docstring screenLabel() const;
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        InsetCode lyxCode() const { return BIBITEM_CODE; }
        ///
index ad6e064e712ef58d418a065b415f1f4ddffd287e..e48e39ee9c3c950ffc7c7bf7a8707f4e4477c71f 100644 (file)
@@ -34,7 +34,7 @@ public:
        ///
        docstring toolTip(BufferView const & bv, int x, int y) const;
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        InsetCode lyxCode() const { return BIBTEX_CODE; }
        ///
index 4882f78e4b72c38e9598e5c9fc23f25bcd3ef2d5..43d29d8dcd66f73398588a95fdb7ff0c3c3fb26c 100644 (file)
@@ -239,7 +239,6 @@ bool InsetBox::getStatus(Cursor & cur, FuncRequest const & cmd,
                return true;
 
        case LFUN_INSET_DIALOG_UPDATE:
-       case LFUN_INSET_SETTINGS:
                flag.setEnabled(true);
                return true;
 
index 1f7f38a97054a70c53f95aa802d7ffcefb347303..b8a272da58730be4f262bdc1b122b37a19789eaa 100644 (file)
@@ -176,7 +176,6 @@ bool InsetBranch::getStatus(Cursor & cur, FuncRequest const & cmd,
        switch (cmd.action) {
        case LFUN_INSET_MODIFY:
        case LFUN_INSET_DIALOG_UPDATE:
-       case LFUN_INSET_SETTINGS:
                flag.setEnabled(true);
                break;
 
index d2e88b4d60f6045461907d7ba9fd65a9a7fd8379..4567077a423d5e5693d1a2c4f1eb10aa7c277534 100644 (file)
@@ -38,7 +38,7 @@ public:
        ///
        docstring screenLabel() const;
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        docstring toolTip(BufferView const & bv, int x, int y) const;
        ///
index e2fbb3600c66adaaa727b7657a27fc84400f94ac..8606de4e3188ec0407a8e9dab994fb9235feb114 100644 (file)
@@ -437,9 +437,9 @@ void InsetCollapsable::cursorPos(BufferView const & bv,
 }
 
 
-Inset::EDITABLE InsetCollapsable::editable() const
+bool InsetCollapsable::editable() const
 {
-       return geometry() != ButtonOnly ? HIGHLY_EDITABLE : IS_EDITABLE;
+       return geometry() != ButtonOnly;
 }
 
 
index 9b4e9b02bfe800c189c2a3ca46ab73ec583d619a..73fde24e8c2de0342ac0139f6ed34c989758b8a2 100644 (file)
@@ -74,7 +74,9 @@ public:
        ///
        docstring const getNewLabel(docstring const & l) const;
        ///
-       EDITABLE editable() const;
+       bool editable() const;
+       ///
+       bool hasSettings() const { return true; }
        /// can we go further down on mouse click?
        bool descendable() const;
        ///
index 0e6b0df0807adfc6f4c788488fe4f8fb0ebf1bb9..378866c2a0f41e42bbbeb82507f5fedc256222e3 100644 (file)
@@ -52,7 +52,7 @@ InsetCommand::~InsetCommand()
 
 void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       button_.update(screenLabel(), editable() != NOT_EDITABLE);
+       button_.update(screenLabel(), editable() || hasSettings());
        button_.metrics(mi, dim);
 }
 
@@ -163,7 +163,6 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
                status.setEnabled(true);
                return true;
        
-       case LFUN_INSET_SETTINGS:
        case LFUN_INSET_DIALOG_UPDATE:
                status.setEnabled(true);
                return true;
index f6e99d849878dadaa34a8856f5ac183137e6c290..bd59d14072c7fea2e37af3b9ac9b5bac35797f04 100644 (file)
@@ -137,7 +137,6 @@ bool InsetERT::getStatus(Cursor & cur, FuncRequest const & cmd,
                case LFUN_PASTE:
                case LFUN_PRIMARY_SELECTION_PASTE:
                case LFUN_QUOTE_INSERT:
-               case LFUN_INSET_SETTINGS:
                        status.setEnabled(true);
                        return true;
 
index e53ee5598782b77b9201f2b2d298799d864f9d40..b773a2020426154f99c6532c76ac437c49f9eca7 100644 (file)
@@ -428,7 +428,6 @@ bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_INSET_EDIT:
        case LFUN_INSET_MODIFY:
        case LFUN_INSET_DIALOG_UPDATE:
-       case LFUN_INSET_SETTINGS:
                flag.setEnabled(true);
                return true;
 
index 490c6ed3c4edb4111fbf3416410d9f92bb287877..c41adea0afba4ef86f857b847f1fc0ad61453473 100644 (file)
@@ -120,7 +120,7 @@ private:
        ///
        InsetCode lyxCode() const { return EXTERNAL_CODE; }
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        void metrics(MetricsInfo &, Dimension &) const;
        ///
index 58ce0521946c9350a2f83d2d7e8ad04fad9ffe14..239ced831fe62fd0148b4f8cd0d42730d50a91ca 100644 (file)
@@ -34,6 +34,8 @@ public:
        void write(std::ostream &) const;
        /// should paragraph indendation be ommitted in any case?
        bool neverIndent() const { return true; }
+       ///
+       bool hasSettings() const { return false; }
 
 protected:
        InsetFlex(InsetFlex const &);
index 07b5ece5b19041cbe3cefe1a52438852bd9eb545..37a247af44341588628045ca3064656786b5583b 100644 (file)
@@ -183,7 +183,6 @@ bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
 
        case LFUN_INSET_MODIFY:
        case LFUN_INSET_DIALOG_UPDATE:
-       case LFUN_INSET_SETTINGS:
                flag.setEnabled(true);
                return true;
 
index 9afa316891c9becac684a0132d1bc102510548c5..c15f0eb61f9e80528eb9e56f57eca532b8638e81 100644 (file)
@@ -29,8 +29,6 @@ public:
        ///
        docstring screenLabel() const;
        ///
-       EDITABLE editable() const { return NOT_EDITABLE; }
-       ///
        InsetCode lyxCode() const { return FLOAT_LIST_CODE; }
        ///
        DisplayType display() const { return AlignCenter; }
index 7a48f7d3f5cbff92cb16938792db350bebc7609a..75d9acf213c2892b71bdde45da70b88f5ea0ff27 100644 (file)
@@ -24,6 +24,8 @@ class InsetFootlike : public InsetCollapsable {
 public:
        ///
        InsetFootlike(Buffer const &);
+       ///
+       bool hasSettings() const { return false; }
 private:
        ///
        void metrics(MetricsInfo &, Dimension &) const;
index 33fc1e5c8665ce24221257f65396e576bbe980cd..9decdaaa80cc0b0ee08a5ee6bb54bb22d922b202 100644 (file)
@@ -230,7 +230,6 @@ bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_INSET_EDIT:
        case LFUN_INSET_MODIFY:
        case LFUN_INSET_DIALOG_UPDATE:
-       case LFUN_INSET_SETTINGS:
                flag.setEnabled(true);
                return true;
 
@@ -261,12 +260,6 @@ void InsetGraphics::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-Inset::EDITABLE InsetGraphics::editable() const
-{
-       return IS_EDITABLE;
-}
-
-
 void InsetGraphics::write(ostream & os) const
 {
        os << "Graphics\n";
index 7aaff0cf835f75e216d960077eeb474bca902ca1..ec68897b8822d3a241272c3cda442a4b4e413c3c 100644 (file)
@@ -60,7 +60,7 @@ private:
        bool isLabeled() const { return true; }
        void metrics(MetricsInfo &, Dimension &) const;
        ///
-       EDITABLE editable() const;
+       bool hasSettings() const { return true; }
        ///
        void write(std::ostream &) const;
        ///
index 58943bfa9bb36e17368ce8d605b84b3d3d19475b..d764d2c8c895252b385b47b4a4f881fb1a326020 100644 (file)
@@ -31,7 +31,7 @@ public:
        ///
        docstring screenLabel() const;
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        DisplayType display() const { return Inline; }
        ///
index ce4a12c2ba9bfba5867bf198e9b3850ce69cd9db..b2e715d24085d4ec72cc4b0894fbf971e2bb1cb4 100644 (file)
@@ -299,6 +299,7 @@ void InsetInclude::editIncluded(string const & file)
 bool InsetInclude::getStatus(Cursor & cur, FuncRequest const & cmd,
                FuncStatus & flag) const
 {
+       LYXERR0(cmd.action);
        switch (cmd.action) {
 
        case LFUN_INSET_EDIT:
index 91ecc57955b337099a1b2e22afe470d55899c5ee..0e14405a8a6305abb774125c33f1cb757fe65c8e 100644 (file)
@@ -72,7 +72,7 @@ public:
        support::FileNameList const &
                getBibfilesCache() const;
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        int latex(odocstream &, OutputParams const &) const;
        ///
index b583fac50beedb94b6a057c20b05c869b58ec318..45eb2a38c59bb84051ee1a04b9239fc7f3e761d3 100644 (file)
@@ -181,6 +181,8 @@ bool InsetIndex::showInsetDialog(BufferView * bv) const
 
 void InsetIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
+       LYXERR0( cmd.action);
+       LYXERR0( cmd.getArg(0));
        switch (cmd.action) {
 
        case LFUN_INSET_MODIFY: {
@@ -210,6 +212,8 @@ void InsetIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
 bool InsetIndex::getStatus(Cursor & cur, FuncRequest const & cmd,
                FuncStatus & flag) const
 {
+               LYXERR0( cmd.action);
+       LYXERR0( cmd.getArg(0));
        switch (cmd.action) {
 
        case LFUN_INSET_MODIFY:
@@ -226,8 +230,7 @@ bool InsetIndex::getStatus(Cursor & cur, FuncRequest const & cmd,
                flag.setEnabled(true);
                return true;
 
-       case LFUN_INSET_DIALOG_UPDATE:
-       case LFUN_INSET_SETTINGS: {
+       case LFUN_INSET_DIALOG_UPDATE: {
                Buffer const & realbuffer = *buffer().masterBuffer();
                flag.setEnabled(realbuffer.params().use_indices);
                return true;
@@ -340,6 +343,21 @@ docstring InsetIndex::contextMenu(BufferView const &, int, int) const
 }
 
 
+bool InsetIndex::hasSettings() const
+{
+       return buffer().masterBuffer()->params().use_indices;
+}
+
+
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// InsetIndexParams
+//
+///////////////////////////////////////////////////////////////////////
+
+
 void InsetIndexParams::write(ostream & os) const
 {
        os << ' ';
@@ -446,8 +464,7 @@ bool InsetPrintIndex::getStatus(Cursor & cur, FuncRequest const & cmd,
                        return InsetCommand::getStatus(cur, cmd, status);
        }
        
-       case LFUN_INSET_DIALOG_UPDATE:
-       case LFUN_INSET_SETTINGS: {
+       case LFUN_INSET_DIALOG_UPDATE: {
                Buffer const & realbuffer = *buffer().masterBuffer();
                status.setEnabled(realbuffer.params().use_indices);
                return true;
@@ -486,10 +503,9 @@ docstring InsetPrintIndex::contextMenu(BufferView const &, int, int) const
 }
 
 
-Inset::EDITABLE InsetPrintIndex::editable() const
+bool InsetPrintIndex::hasSettings() const
 {
-       return buffer().masterBuffer()->params().use_indices ?
-               IS_EDITABLE : NOT_EDITABLE;
+       return buffer().masterBuffer()->params().use_indices;
 }
 
 
index 99d8b8923dabef1769bc66f1560b7a6fccd75218..69d1a3d23e98f08642257e13c445268266becdb6 100644 (file)
@@ -45,7 +45,7 @@ public:
        static void string2params(std::string const &, InsetIndexParams &);
 private:
        ///
-       EDITABLE editable() const { return HIGHLY_EDITABLE; }
+       bool hasSettings() const;
        ///
        InsetCode lyxCode() const { return INDEX_CODE; }
        ///
@@ -112,7 +112,8 @@ private:
        /// Updates needed features for this inset.
        void validate(LaTeXFeatures & features) const;
        ///
-       EDITABLE editable() const;
+       bool hasSettings() const;
+
        ///
        DisplayType display() const { return AlignCenter; }
        ///
index 6dfb496f4d2e281b1b067eae02caab2a70baf04a..bac475866f8a38cc8ecce4d70e3f6b20d2707c39 100644 (file)
@@ -100,7 +100,9 @@ public:
        ///
        Inset * editXY(Cursor & cur, int x, int y);
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool editable() const { return false; }
+       ///
+       bool hasSettings() const { return true; }
        ///
        void read(Lexer & lex);
        ///
index 92f05605790c2065cbcfa0a9739bd2daf80c38b5..e649643f15098d6ff904d27c35dc609e026175bd 100644 (file)
@@ -34,7 +34,7 @@ public:
        ///
        docstring screenLabel() const;
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        InsetCode lyxCode() const { return LABEL_CODE; }
        ///
index f0820a60e227cf6cc180d2971a1be8c0c4280963..43f5eeed535e272c0033dc5d7084156dabcdad22 100644 (file)
@@ -18,7 +18,6 @@
 #include "BufferParams.h"
 #include "Counters.h"
 #include "Cursor.h"
-#include "CutAndPaste.h"
 #include "DispatchResult.h"
 #include "Encoding.h"
 #include "FuncRequest.h"
@@ -387,7 +386,6 @@ bool InsetListings::getStatus(Cursor & cur, FuncRequest const & cmd,
        switch (cmd.action) {
                case LFUN_INSET_MODIFY:
                case LFUN_INSET_DIALOG_UPDATE:
-               case LFUN_INSET_SETTINGS:
                        status.setEnabled(true);
                        return true;
                case LFUN_CAPTION_INSERT:
index 39e1d9ce3bbe1c929128c64c8adf9c9bb81de4a9..d63e99c2496060955409d07762f67ecd7b67c8f4 100644 (file)
@@ -32,7 +32,7 @@ public:
        ///
        docstring toolTip(BufferView const & bv, int x, int y) const;
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        /// Updates needed features for this inset.
        void validate(LaTeXFeatures & features) const;
        ///
@@ -66,8 +66,6 @@ public:
        // Currently the width can be read from file and written, but not
        // changed.
        ///
-       EDITABLE editable() const { return NOT_EDITABLE; }
-       ///
        int docbook(odocstream &, OutputParams const &) const;
        ///
        InsetCode lyxCode() const;
index e0804ed8d55ff74e77f5ad63d5bc0797b36ff491..c773bf80e1df42d0b283da6a86bc5ec1cce06e00 100644 (file)
@@ -211,7 +211,6 @@ bool InsetNote::getStatus(Cursor & cur, FuncRequest const & cmd,
                }
                return true;
 
-       case LFUN_INSET_SETTINGS:
        case LFUN_INSET_DIALOG_UPDATE:
                flag.setEnabled(true);
                return true;
index 6e8d2d3d6534f069222719fd566dfdb0bdceef7b..740564c31ce16e3484881a2f1776139a5957ea87 100644 (file)
@@ -31,6 +31,8 @@ public:
 
        /// Outputting the optional parameter of a LaTeX command
        int latexOptional(odocstream &, OutputParams const &) const;
+       ///
+       bool hasSettings() const { return false; }
 
 private:
        /// code of the inset
index 2be07faf9ce43d7bcde13887e8875e1ec741b3a3..234f5028329dc50e291f1838abbf2e94feba4cd4 100644 (file)
@@ -293,7 +293,6 @@ bool InsetPhantom::getStatus(Cursor & cur, FuncRequest const & cmd,
                flag.setEnabled(true);
                return true;
 
-       case LFUN_INSET_SETTINGS:
        case LFUN_INSET_DIALOG_UPDATE:
                flag.setEnabled(true);
                return true;
index 1adcc4fef9f6b5c293f51c52a44cced3bb3a82b7..e6f37462cd53ca1e3167598cfbc5ebfe7f423809 100644 (file)
@@ -43,7 +43,7 @@ public:
        ///
        docstring screenLabel() const;
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        InsetCode lyxCode() const { return REF_CODE; }
        ///
index a12d28e1d0ce472a122835dab43d73448912facf..a9ffe812ac04d42d6a4b090dace107474193dc4a 100644 (file)
@@ -172,7 +172,6 @@ bool InsetSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
                        status.setOnOff(params_.kind == params.kind);
                }
                // fall through
-       case LFUN_INSET_SETTINGS:
        case LFUN_INSET_DIALOG_UPDATE:
                status.setEnabled(true);
                return true;
index 5e1638e2129a3805e5c1e603776bfa14c19f0cef..716925334e2b5875cc3d4143c5520a18a2aa0cbe 100644 (file)
@@ -133,7 +133,7 @@ public:
        /// the string that is passed to the TOC
        void tocString(odocstream &) const;
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        InsetCode lyxCode() const { return SPACE_CODE; }
        /// is this an expandible space (rubber length)?
index 037d461f45c96e7c54e68c7d8f376f768e87dc69..b95c9c4ebbc377005a663ff3a2351399bf8db0e1 100644 (file)
@@ -26,8 +26,6 @@ public:
        ///
        docstring screenLabel() const;
        ///
-       EDITABLE editable() const { return NOT_EDITABLE; }
-       ///
        InsetCode lyxCode() const { return TOC_CODE; }
        ///
        DisplayType display() const { return AlignCenter; }
index ed030341466b4a9e0391526ac4d4d483196db932..1ad481ec41e2bf5fb6d898003dde4429b9eb66c0 100644 (file)
@@ -4075,6 +4075,9 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
                return cell(cur.idx())->getStatus(cur, cmd, status);
 
        case LFUN_INSET_SETTINGS:
+               // relay this lfun to Inset, not to the cell.
+               return Inset::getStatus(cur, cmd, status);
+
        case LFUN_INSET_MODIFY:
                if (insetCode(cmd.getArg(0)) == TABULAR_CODE) {
                        status.setEnabled(true);
index 1f71350aeb264d36c45206b69bdd4aa70b7410a6..e81cbc0e57e4db43c157026ebd25d5af0f823083 100644 (file)
@@ -736,7 +736,9 @@ public:
        ///
        docstring editMessage() const;
        ///
-       EDITABLE editable() const { return HIGHLY_EDITABLE; }
+       bool editable() const { return true; }
+       ///
+       bool hasSettings() const { return true; }
        ///
        bool insetAllowed(InsetCode code) const;
        ///
index 90d246719ccc7410788d21e8fe365a44915e4d37..1fcbead651af90fe6fad5297728d88f4070f4967 100644 (file)
@@ -64,7 +64,7 @@ public:
        ///
        docstring editMessage() const;
        ///
-       EDITABLE editable() const { return HIGHLY_EDITABLE; }
+       bool editable() const { return true; }
        ///
        bool canTrackChanges() const { return true; }
        ///
index a0249720fa661b7338e27abc1e8a7eb4b66b4dfa..3b912ad41d43203548db06b0871e56d95ab3acf4 100644 (file)
@@ -87,10 +87,6 @@ bool InsetVSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
                status.setEnabled(true);
                return true;
        
-       case LFUN_INSET_SETTINGS:
-               status.setEnabled(true);
-               return true;
-
        default:
                return Inset::getStatus(cur, cmd, status);
        }
index 873e3c36236c8d3601b2d20e3a4fffa4b71912df..42c1fc7748422c994555e0ed3efda6c58acb903b 100644 (file)
@@ -32,7 +32,7 @@ public:
        ///
        InsetCode lyxCode() const { return VSPACE_CODE; }
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        docstring contextMenu(BufferView const & bv, int x, int y) const;
        ///
index 718ce4eefef880176d16ea54176bf22d0352e4c7..c21d2225079eb191c05195c69e1600098e69443c 100644 (file)
@@ -107,7 +107,6 @@ bool InsetWrap::getStatus(Cursor & cur, FuncRequest const & cmd,
        switch (cmd.action) {
        case LFUN_INSET_MODIFY:
        case LFUN_INSET_DIALOG_UPDATE:
-       case LFUN_INSET_SETTINGS:
                flag.setEnabled(true);
                return true;
 
index 5929c1b33017cda4f714360431434797ae91e8e6..47dc2664d82c19b669a165acbd92a38f82075315 100644 (file)
@@ -55,7 +55,7 @@ public:
        ///
        docstring const & getInsetName() const { return name_; }
        ///
-       EDITABLE editable() const { return HIGHLY_EDITABLE; }
+       bool editable() const { return true; }
 private:
        ///
        MathAtom & tmpl() const;
index 9f850b240e71891bf37971e863f03ae31bf3a670..bfb6e34f4d98006134e9b8b35fd04bfe1de5dc62 100644 (file)
@@ -212,7 +212,7 @@ public:
        ///
        virtual void revealCodes(Cursor & cur) const;
        ///
-       EDITABLE editable() const { return HIGHLY_EDITABLE; }
+       bool editable() const { return true; }
        ///
        void edit(Cursor & cur, bool front, 
                EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
index 15b79d2b58d2086bb47d17937a5d02b14103f501..f45dee5d96727f25c60556f02842b156ad2c37db 100644 (file)
@@ -56,7 +56,7 @@ public:
        /// generate something that will be understood by the Dialogs.
        std::string const createDialogStr() const;
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        docstring contextMenu(BufferView const &, int, int) const;
        ///
index 6f469c673ee7d71aec1214c51a41a480938890e4..dea1acf28ed406992056c2ed3e2cbc236ebda39b 100644 (file)
@@ -36,7 +36,7 @@ public:
        ///
        explicit MathMacroTemplate(const docstring & str);
        ///
-       EDITABLE editable() const { return HIGHLY_EDITABLE; }
+       bool editable() const { return true; }
        ///
        void edit(Cursor & cur, bool front, EntryDirection entry_from);
        ///
index 16c3ad7250f7c20bf89693468a68ccfd162a0e98..5c8f694b505117316ad526b4838715663641ab5f 100644 (file)
@@ -772,7 +772,7 @@ void RowPainter::paintText()
 
                Inset const * inset = par_.getInset(pos);
                bool const highly_editable_inset = inset
-                       && inset->editable() == Inset::HIGHLY_EDITABLE;
+                       && inset->editable();
 
                // If we reach the end of a change or if the author changes, paint it.
                // We also don't paint across things like tables