#include "Row.h"
#include "Server.h"
#include "Session.h"
+#include "SpellChecker.h"
#include "insets/InsetBox.h"
#include "insets/InsetBranch.h"
//lyxerr << "LyXFunc::getStatus: cmd: " << cmd << endl;
FuncStatus flag;
- Buffer * buf = lyx_view_ ? lyx_view_->buffer() : 0;
+ /* In LyX/Mac, when a dialog is open, the menus of the
+ application can still be accessed without giving focus to
+ the main window. In this case, we want to disable the menu
+ entries that are buffer or view-related.
+
+ If this code is moved somewhere else (like in
+ GuiView::getStatus), then several functions will not be
+ handled correctly.
+ */
+ frontend::LyXView * lv = 0;
+ Buffer * buf = 0;
+ if (lyx_view_
+ && (cmd.origin != FuncRequest::MENU || lyx_view_->hasFocus())) {
+ lv = lyx_view_;
+ buf = lyx_view_->buffer();
+ }
if (cmd.action == LFUN_NOACTION) {
flag.message(from_utf8(N_("Nothing to do")));
break;
case LFUN_VC_LOCKING_TOGGLE:
enable = !buf->isReadonly() && buf->lyxvc().lockingToggleEnabled();
- flag.setEnabled(enable);
- if (enable)
- flag.setOnOff(!buf->lyxvc().locker().empty());
+ flag.setOnOff(enable && !buf->lyxvc().locker().empty());
break;
case LFUN_VC_REVERT:
enable = buf->lyxvc().inUse();
break;
// Does the view know something?
- if (!lyx_view_) {
+ if (!lv) {
enable = false;
break;
}
- if (lyx_view_->getStatus(cmd, flag))
+ if (lv->getStatus(cmd, flag))
break;
// If we do not have a BufferView, then other functions are disabled
updateFlags = Update::None;
break;
+ case LFUN_BUFFER_CLOSE_ALL:
+ lyx_view_->closeBufferAll();
+ buffer = 0;
+ updateFlags = Update::None;
+ break;
+
case LFUN_BUFFER_RELOAD: {
LASSERT(lyx_view_ && buffer, /**/);
docstring const file = makeDisplayPath(buffer->absFileName(), 20);
break;
case LFUN_LYXRC_APPLY: {
+ // reset active key sequences, since the bindings
+ // are updated (bug 6064)
+ keyseq.reset();
LyXRC const lyxrc_orig = lyxrc;
istringstream ss(argument);
actOnUpdatedPrefs(lyxrc_orig, lyxrc);
+ setSpellChecker();
+
theApp()->resetGui();
/// We force the redraw in any case because there might be
// processKeySym to avoid another redraw just for a
// changed inline completion
if (cmd.origin == FuncRequest::KEYBOARD) {
- if (cmd.action == LFUN_SELF_INSERT)
+ if (cmd.action == LFUN_SELF_INSERT
+ || (cmd.action == LFUN_ERT_INSERT && view()->cursor().inMathed()))
lyx_view_->updateCompletion(view()->cursor(), true, true);
else if (cmd.action == LFUN_CHAR_DELETE_BACKWARD)
lyx_view_->updateCompletion(view()->cursor(), false, true);
case LyXRC::RC_FONT_ENCODING:
case LyXRC::RC_FORMAT:
case LyXRC::RC_GROUP_LAYOUTS:
+ case LyXRC::RC_HUNSPELLDIR_PATH:
case LyXRC::RC_INDEX_ALTERNATIVES:
case LyXRC::RC_INDEX_COMMAND:
case LyXRC::RC_JBIBTEX_COMMAND:
case LyXRC::RC_SHOW_BANNER:
case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
case LyXRC::RC_SPELL_COMMAND:
+ case LyXRC::RC_SPELLCHECKER:
case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
case LyXRC::RC_SPLITINDEX_COMMAND:
case LyXRC::RC_TEMPDIRPATH: