break;
}
+ case LFUN_DIALOG_UPDATE: {
+ string const name = cmd.getArg(0);
+ if (!buf)
+ enable = name == "prefs";
+ break;
+ }
+
case LFUN_MENUNEW:
case LFUN_MENUNEWTMPLT:
case LFUN_WORDFINDFORWARD:
case LFUN_GOTO_PARAGRAPH:
case LFUN_DIALOG_SHOW_NEW_INSET:
case LFUN_DIALOG_SHOW_NEXT_INSET:
- case LFUN_DIALOG_UPDATE:
case LFUN_DIALOG_HIDE:
case LFUN_DIALOG_DISCONNECT_INSET:
case LFUN_CHILDOPEN:
case LFUN_SET_COLOR:
case LFUN_MESSAGE:
case LFUN_EXTERNAL_EDIT:
+ case LFUN_GRAPHICS_EDIT:
case LFUN_ALL_INSETS_TOGGLE:
case LFUN_LANGUAGE_BUFFER:
case LFUN_TEXTCLASS_APPLY:
break;
default:
-
+
cur.getStatus(cmd, flag);
if (!flag.enabled())
flag = view()->getStatus(cmd);
flag.enabled(false);
}
+ //lyxerr << "LyXFunc::getStatus: got: " << flag.enabled() << endl;
return flag;
}
Alert::error(_("Could not change class"), s);
}
}
-
+
} //namespace anon
dispatch_buffer.erase();
selection_possible = false;
+ bool update = true;
+
// We cannot use this function here
if (!getStatus(cmd).enabled()) {
lyxerr[Debug::ACTION] << "LyXFunc::dispatch: "
break;
case LFUN_EXEC_COMMAND:
+ owner->getToolbar().display("minibuffer", true);
owner->focus_command_buffer();
break;
inset->dispatch(view()->cursor(), fr);
} else if (name == "paragraph") {
dispatch(FuncRequest(LFUN_PARAGRAPH_UPDATE));
+ } else if (name == "prefs") {
+ owner->getDialogs().update(name, string());
}
break;
}
case LFUN_SAVEPREFERENCES: {
Path p(user_lyxdir());
- lyxrc.write("preferences");
+ lyxrc.write("preferences", false);
break;
}
break;
}
- case LFUN_BREAKLINE: {
-#warning swallow 'Return' if the minibuffer is focused. But how?
+ case LFUN_GRAPHICS_EDIT: {
+ FuncRequest fr(action, argument);
+ InsetGraphics().dispatch(view()->cursor(), fr);
break;
}
case LFUN_LYXRC_APPLY: {
istringstream ss(argument);
bool const success = lyxrc.read(ss) == 0;
-
+
if (!success) {
lyxerr << "Warning in LFUN_LYXRC_APPLY!\n"
<< "Unable to read lyxrc data"
<< endl;
}
break;
- }
+ }
default: {
+ update = false;
DispatchResult res = view()->cursor().dispatch(cmd);
- if (!res.dispatched());
- view()->dispatch(cmd);
+ if (res.dispatched())
+ update |= res.update();
+ else
+ update |= view()->dispatch(cmd);
+
break;
}
}
if (view()->available()) {
- view()->fitCursor();
- view()->update();
+ if (view()->fitCursor() || update)
+ view()->update();
// if we executed a mutating lfun, mark the buffer as dirty
if (getStatus(cmd).enabled()
&& !lyxaction.funcHasFlag(cmd.action, LyXAction::NoBuffer)