Make the insets accept LFUN_INSET_SETTINGS. For these insets, LFUN_INSET_SETTINGS was already used to show the settings dialog (in contrast to the insets in the next commit).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29175 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-04-10 00:17:34 +00:00
parent 07c4880fea
commit 9b111ea5a6
10 changed files with 19 additions and 0 deletions

View File

@ -239,6 +239,7 @@ bool InsetBox::getStatus(Cursor & cur, FuncRequest const & cmd,
return true; return true;
case LFUN_INSET_DIALOG_UPDATE: case LFUN_INSET_DIALOG_UPDATE:
case LFUN_INSET_SETTINGS:
flag.setEnabled(true); flag.setEnabled(true);
return true; return true;

View File

@ -171,6 +171,7 @@ bool InsetBranch::getStatus(Cursor & cur, FuncRequest const & cmd,
switch (cmd.action) { switch (cmd.action) {
case LFUN_INSET_MODIFY: case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE: case LFUN_INSET_DIALOG_UPDATE:
case LFUN_INSET_SETTINGS:
flag.setEnabled(true); flag.setEnabled(true);
break; break;

View File

@ -158,6 +158,7 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_ERT_INSERT: case LFUN_ERT_INSERT:
status.setEnabled(false); status.setEnabled(false);
return true; return true;
// we handle these // we handle these
case LFUN_INSET_MODIFY: case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype") { if (cmd.getArg(0) == "changetype") {
@ -167,9 +168,12 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
} }
status.setEnabled(true); status.setEnabled(true);
return true; return true;
case LFUN_INSET_SETTINGS:
case LFUN_INSET_DIALOG_UPDATE: case LFUN_INSET_DIALOG_UPDATE:
status.setEnabled(true); status.setEnabled(true);
return true; return true;
default: default:
return Inset::getStatus(cur, cmd, status); return Inset::getStatus(cur, cmd, status);
} }

View File

@ -137,6 +137,7 @@ bool InsetERT::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_PASTE: case LFUN_PASTE:
case LFUN_PRIMARY_SELECTION_PASTE: case LFUN_PRIMARY_SELECTION_PASTE:
case LFUN_QUOTE_INSERT: case LFUN_QUOTE_INSERT:
case LFUN_INSET_SETTINGS:
status.setEnabled(true); status.setEnabled(true);
return true; return true;

View File

@ -183,6 +183,7 @@ bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_INSET_MODIFY: case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE: case LFUN_INSET_DIALOG_UPDATE:
case LFUN_INSET_SETTINGS:
flag.setEnabled(true); flag.setEnabled(true);
return true; return true;

View File

@ -381,6 +381,7 @@ bool InsetListings::getStatus(Cursor & cur, FuncRequest const & cmd,
switch (cmd.action) { switch (cmd.action) {
case LFUN_INSET_MODIFY: case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE: case LFUN_INSET_DIALOG_UPDATE:
case LFUN_INSET_SETTINGS:
status.setEnabled(true); status.setEnabled(true);
return true; return true;
case LFUN_CAPTION_INSERT: case LFUN_CAPTION_INSERT:

View File

@ -211,6 +211,7 @@ bool InsetNote::getStatus(Cursor & cur, FuncRequest const & cmd,
} }
return true; return true;
case LFUN_INSET_SETTINGS:
case LFUN_INSET_DIALOG_UPDATE: case LFUN_INSET_DIALOG_UPDATE:
flag.setEnabled(true); flag.setEnabled(true);
return true; return true;

View File

@ -285,6 +285,7 @@ bool InsetPhantom::getStatus(Cursor & cur, FuncRequest const & cmd,
switch (cmd.action) { switch (cmd.action) {
case LFUN_INSET_MODIFY: case LFUN_INSET_MODIFY:
case LFUN_INSET_SETTINGS:
flag.setEnabled(true); flag.setEnabled(true);
return true; return true;

View File

@ -3742,6 +3742,12 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
cell(cur.idx())->dispatch(cur, cmd); cell(cur.idx())->dispatch(cur, cmd);
break; break;
} }
case LFUN_INSET_SETTINGS:
// relay this lfun to Inset, not to the cell.
Inset::doDispatch(cur, cmd);
break;
default: default:
// we try to handle this event in the insets dispatch function. // we try to handle this event in the insets dispatch function.
cell(cur.idx())->dispatch(cur, cmd); cell(cur.idx())->dispatch(cur, cmd);
@ -4068,6 +4074,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
} }
return cell(cur.idx())->getStatus(cur, cmd, status); return cell(cur.idx())->getStatus(cur, cmd, status);
case LFUN_INSET_SETTINGS:
case LFUN_INSET_MODIFY: case LFUN_INSET_MODIFY:
if (insetCode(cmd.getArg(0)) == TABULAR_CODE) { if (insetCode(cmd.getArg(0)) == TABULAR_CODE) {
status.setEnabled(true); status.setEnabled(true);

View File

@ -107,6 +107,7 @@ bool InsetWrap::getStatus(Cursor & cur, FuncRequest const & cmd,
switch (cmd.action) { switch (cmd.action) {
case LFUN_INSET_MODIFY: case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE: case LFUN_INSET_DIALOG_UPDATE:
case LFUN_INSET_SETTINGS:
flag.setEnabled(true); flag.setEnabled(true);
return true; return true;