From cb93f034d44a418bf638632f0997198126e5b271 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sun, 24 Mar 2013 19:20:19 +0100 Subject: [PATCH] Add an LFUN for continuous spell checking This fixes the first part of #8589. --- src/FuncCode.h | 1 + src/LyXAction.cpp | 10 ++++++++++ src/frontends/qt4/GuiView.cpp | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/src/FuncCode.h b/src/FuncCode.h index d8f48eb1ad..33ebf41d2e 100644 --- a/src/FuncCode.h +++ b/src/FuncCode.h @@ -456,6 +456,7 @@ enum FuncCode LFUN_VC_RENAME, // gb 20130205 LFUN_VC_COPY, // gb 20130205 // 355 + LFUN_SPELLING_CONTINUOUSLY, // vfr, 20130324 LFUN_LASTACTION // end of the table }; diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index b2f5c8fc31..01c5556fcb 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -1045,6 +1045,16 @@ void LyXAction::init() * \endvar */ { LFUN_SPELLING_REMOVE, "spelling-remove", ReadOnly, Edit }, + +/*! + * \var lyx::FuncCode lyx::LFUN_SPELLING_CONTINUOUSLY + * \li Action: Toggle continuous spell checking. + * \li Syntax: spelling-continuously + * \li Origin: vfr, 24 March 2013 + * \endvar + */ + { LFUN_SPELLING_CONTINUOUSLY, "spelling-continuously", ReadOnly, Edit }, + /*! * \var lyx::FuncCode lyx::LFUN_THESAURUS_ENTRY * \li Action: Look up thesaurus entries with respect to the word under the cursor. diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 1f54bbc109..e46ec16471 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1855,6 +1855,10 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag) enable = documentBufferView() && documentBufferView()->cursor().inTexted(); break; + case LFUN_SPELLING_CONTINUOUSLY: + flag.setOnOff(lyxrc.spellcheck_continuously); + break; + default: return false; } @@ -3758,6 +3762,12 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr) one.startscript(Systemcall::DontWait, command); break; } + + case LFUN_SPELLING_CONTINUOUSLY: + lyxrc.spellcheck_continuously = !lyxrc.spellcheck_continuously; + dr.screenUpdate(Update::Force | Update::FitCursor); + break; + default: // The LFUN must be for one of BufferView, Buffer or Cursor; // let's try that: -- 2.39.5