* Inset
Handle LFUN_INSET_SETTINGS.
* LyXAction
Use the AtPoint command flag.
* BufferView
* Text3
Remove code that handled LFUN_INSET_SETTINGS. The inset/next-inset part is handled by the AtPoint lfun flag. showInsetDialog is called by Inset::doDispatch and getStatus will be handled by all insets themselves.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29171
a592a061-630c-0410-9148-
cb99ea01b6c8
flag.setEnabled(cur.inset().allowParagraphCustomization(cur.idx()));
break;
- case LFUN_INSET_SETTINGS: {
- InsetCode code = cur.inset().lyxCode();
- if (cmd.getArg(0) == insetName(code)) {
- flag.setEnabled(true);
- break;
- }
- bool enable = false;
- InsetCode next_code = cur.nextInset()
- ? cur.nextInset()->lyxCode() : NO_CODE;
- //FIXME: remove these special cases:
- switch (next_code) {
- case TABULAR_CODE:
- case ERT_CODE:
- case FLOAT_CODE:
- case WRAP_CODE:
- case NOTE_CODE:
- case BRANCH_CODE:
- case PHANTOM_CODE:
- case BOX_CODE:
- case LISTINGS_CODE:
- enable = (cmd.argument().empty() ||
- cmd.getArg(0) == insetName(next_code));
- break;
- default:
- break;
- }
- flag.setEnabled(enable);
- break;
- }
-
case LFUN_DIALOG_SHOW_NEW_INSET:
if (cur.inset().lyxCode() == CAPTION_CODE)
return cur.inset().getStatus(cur, cmd, flag);
* \li Params: <INSET>: <box|branch|ert|float|listings|note|phantom|tabular|wrap>
* \endvar
*/
- { LFUN_INSET_SETTINGS, "inset-settings", ReadOnly, Edit },
+ { LFUN_INSET_SETTINGS, "inset-settings", ReadOnly | AtPoint, Edit },
/*!
* \var lyx::FuncCode lyx::LFUN_INSET_TOGGLE
* \li Action: Toggles the collapsable inset we are currently in.
break;
}
- case LFUN_INSET_SETTINGS: {
- Inset & inset = cur.inset();
- if (cmd.getArg(0) == insetName(inset.lyxCode())) {
- // This inset dialog has been explicitely requested.
- inset.showInsetDialog(bv);
- break;
- }
- // else, if there is an inset at the cursor, access this
- Inset * next_inset = cur.nextInset();
- if (next_inset) {
- next_inset->showInsetDialog(bv);
- break;
- }
- // if not then access the underlying inset.
- inset.showInsetDialog(bv);
- break;
- }
-
case LFUN_SET_GRAPHICS_GROUP: {
InsetGraphics * ins = graphics::getCurrentGraphicsInset(cur);
if (!ins)
edit(cur, true);
cur.dispatched();
break;
+ case LFUN_INSET_SETTINGS:
+ showInsetDialog(&cur.bv());
+ break;
default:
cur.noUpdate();
cur.undispatched();
flag.setEnabled(editable() == IS_EDITABLE);
return true;
+ case LFUN_INSET_SETTINGS:
+ flag.setEnabled(false);
+ return true;
+
default:
break;
}