void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new);
+/// send a post-dispatch status message
+docstring sendDispatchMessage(docstring const & msg, FuncRequest const & cmd)
+{
+ const bool verbose = (cmd.origin == FuncRequest::MENU
+ || cmd.origin == FuncRequest::TOOLBAR
+ || cmd.origin == FuncRequest::COMMANDBUFFER);
+
+ if (cmd.action == LFUN_SELF_INSERT || !verbose) {
+ LYXERR(Debug::ACTION, "dispatch msg is " << msg);
+ return msg;
+ }
+
+ docstring dispatch_msg = msg;
+ if (!dispatch_msg.empty())
+ dispatch_msg += ' ';
+
+ docstring comname = from_utf8(lyxaction.getActionName(cmd.action));
+
+ bool argsadded = false;
+
+ if (!cmd.argument().empty()) {
+ if (cmd.action != LFUN_UNKNOWN_ACTION) {
+ comname += ' ' + cmd.argument();
+ argsadded = true;
+ }
+ }
+ docstring const shortcuts = theTopLevelKeymap().
+ printBindings(cmd, KeySequence::ForGui);
+
+ if (!shortcuts.empty())
+ comname += ": " + shortcuts;
+ else if (!argsadded && !cmd.argument().empty())
+ comname += ' ' + cmd.argument();
+
+ if (!comname.empty()) {
+ comname = rtrim(comname);
+ dispatch_msg += '(' + rtrim(comname) + ')';
+ }
+ LYXERR(Debug::ACTION, "verbose dispatch msg " << to_utf8(dispatch_msg));
+ return dispatch_msg;
+}
+
+
} //namespace anon
if (lv == 0)
break;
- Buffer * doc_buffer = (lv && lv->documentBufferView())
- ? &(lv->documentBufferView()->buffer()) : 0;
- if (doc_buffer && !theBufferList().isLoaded(doc_buffer))
- doc_buffer = 0;
-
// Let the current LyXView dispatch its own actions.
if (lv->dispatch(cmd)) {
BufferView * bv = lv->currentBufferView();
}
if (lv) {
// Some messages may already be translated, so we cannot use _()
- sendDispatchMessage(translateIfPossible(getMessage()), cmd);
+ lv->message(sendDispatchMessage(
+ translateIfPossible(getMessage()), cmd));
}
}
-void LyXFunc::sendDispatchMessage(docstring const & msg, FuncRequest const & cmd)
-{
- const bool verbose = (cmd.origin == FuncRequest::MENU
- || cmd.origin == FuncRequest::TOOLBAR
- || cmd.origin == FuncRequest::COMMANDBUFFER);
-
- LyXView * lv = theApp()->currentWindow();
- if (cmd.action == LFUN_SELF_INSERT || !verbose) {
- LYXERR(Debug::ACTION, "dispatch msg is " << to_utf8(msg));
- if (!msg.empty())
- lv->message(msg);
- return;
- }
-
- docstring dispatch_msg = msg;
- if (!dispatch_msg.empty())
- dispatch_msg += ' ';
-
- docstring comname = from_utf8(lyxaction.getActionName(cmd.action));
-
- bool argsadded = false;
-
- if (!cmd.argument().empty()) {
- if (cmd.action != LFUN_UNKNOWN_ACTION) {
- comname += ' ' + cmd.argument();
- argsadded = true;
- }
- }
-
- docstring const shortcuts = theTopLevelKeymap().printBindings(cmd, KeySequence::ForGui);
-
- if (!shortcuts.empty())
- comname += ": " + shortcuts;
- else if (!argsadded && !cmd.argument().empty())
- comname += ' ' + cmd.argument();
-
- if (!comname.empty()) {
- comname = rtrim(comname);
- dispatch_msg += '(' + rtrim(comname) + ')';
- }
-
- LYXERR(Debug::ACTION, "verbose dispatch msg " << to_utf8(dispatch_msg));
- if (!dispatch_msg.empty())
- lv->message(dispatch_msg);
-}
-
-
// Each LyXView should have it's own message method. lyxview and
// the minibuffer would use the minibuffer, but lyxserver would
// send an ERROR signal to its client. Alejandro 970603