]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommand.cpp
Remove all BufferParam arguments in InsetXXX methods (since insets know about their...
[lyx.git] / src / insets / InsetCommand.cpp
index 7447f41918e2f0b7d899b28ecb00316047ef3461..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);
 }
 
@@ -136,12 +136,6 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
        }
 
-       case LFUN_MOUSE_RELEASE: {
-               if (!cur.selection() && cmd.button() != mouse_button::button3)
-                       edit(cur, true);
-               break;
-       }
-
        default:
                Inset::doDispatch(cur, cmd);
                break;
@@ -158,6 +152,7 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_ERT_INSERT:
                status.setEnabled(false);
                return true;
+       
        // we handle these
        case LFUN_INSET_MODIFY:
                if (cmd.getArg(0) == "changetype") {
@@ -167,9 +162,11 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
                } 
                status.setEnabled(true);
                return true;
+       
        case LFUN_INSET_DIALOG_UPDATE:
                status.setEnabled(true);
                return true;
+       
        default:
                return Inset::getStatus(cur, cmd, status);
        }
@@ -182,10 +179,12 @@ docstring InsetCommand::contextMenu(BufferView const &, int, int) const
 }
 
 
-void InsetCommand::edit(Cursor & cur, bool, EntryDirection)
+bool InsetCommand::showInsetDialog(BufferView * bv) const
 {
        if (!mailer_name_.empty())
-               cur.bv().showDialog(mailer_name_, params2string(mailer_name_, p_), this);
+               bv->showDialog(mailer_name_, params2string(mailer_name_, p_),
+                       const_cast<InsetCommand *>(this));
+       return true;
 }