[LyX/master] Sync doc CT settings with dialog-external change of status (#12703)
Juergen Spitzmueller
spitz at lyx.org
Tue Mar 21 08:21:41 UTC 2023
commit 3a02e477a00077e5442d8e34e92690d26a7ed4ae
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Tue Mar 21 10:24:34 2023 +0100
Sync doc CT settings with dialog-external change of status (#12703)
---
src/frontends/qt/GuiDocument.cpp | 11 +++++++++++
src/frontends/qt/GuiDocument.h | 1 +
src/frontends/qt/GuiView.cpp | 17 +++++++++++++++++
src/frontends/qt/GuiView.h | 2 ++
4 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index f92c129..b72d17b 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -19,6 +19,7 @@
#include "GuiApplication.h"
#include "GuiBranches.h"
#include "GuiIndices.h"
+#include "GuiView.h"
#include "GuiSelectionManager.h"
#include "LaTeXHighlighter.h"
#include "Validator.h"
@@ -1380,6 +1381,8 @@ GuiDocument::GuiDocument(GuiView & lv)
this, SLOT(outputChangesToggled(bool)));
connect(changesModule->changeBarsCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
+ connect(&lv, SIGNAL(changeTrackingToggled(bool)),
+ this, SLOT(changeTrackingChanged(bool)));
// numbering
@@ -1904,6 +1907,14 @@ void GuiDocument::bookmarksopenChanged(bool state)
}
+void GuiDocument::changeTrackingChanged(bool state)
+{
+ // This is triggered if the CT state is toggled outside
+ // the document dialog (e.g., menu).
+ changesModule->trackChangesCB->setChecked(state);
+}
+
+
void GuiDocument::slotApply()
{
bool only_shellescape_changed = !nonModuleChanged_ && !modulesChanged_;
diff --git a/src/frontends/qt/GuiDocument.h b/src/frontends/qt/GuiDocument.h
index 248e584..dbdf34f 100644
--- a/src/frontends/qt/GuiDocument.h
+++ b/src/frontends/qt/GuiDocument.h
@@ -168,6 +168,7 @@ private Q_SLOTS:
void outputChangesToggled(bool);
void setOutputSync(bool);
void bookmarksopenChanged(bool);
+ void changeTrackingChanged(bool);
private:
/// validate listings parameters and return an error message, if any
QString validateListingsParameters();
diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 9a35311..6518216 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -2446,6 +2446,14 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
break;
}
+ case LFUN_CHANGES_TRACK: {
+ if (!doc_buffer) {
+ enable = false;
+ break;
+ }
+ return doc_buffer->getStatus(cmd, flag);
+ }
+
case LFUN_VIEW_SPLIT:
if (cmd.getArg(0) == "vertical")
enable = doc_buffer && (d.splitter_->count() == 1 ||
@@ -4528,6 +4536,15 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
doc_buffer->runChktex();
break;
+ case LFUN_CHANGES_TRACK: {
+ // the actual dispatch is done in Buffer
+ dispatchToBufferView(cmd, dr);
+ // but we inform the GUI (document settings) if this is toggled
+ LASSERT(doc_buffer, break);
+ Q_EMIT changeTrackingToggled(doc_buffer->params().track_changes);
+ break;
+ }
+
case LFUN_COMMAND_EXECUTE: {
command_execute_ = true;
minibuffer_focus_ = true;
diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h
index 29687c3..8453c47 100644
--- a/src/frontends/qt/GuiView.h
+++ b/src/frontends/qt/GuiView.h
@@ -230,6 +230,8 @@ Q_SIGNALS:
void currentZoomChanged(int);
/// emitted when script is killed (e.g., user cancels export)
void scriptKilled();
+ /// emitted when track changes status toggled
+ void changeTrackingToggled(bool);
public Q_SLOTS:
///
More information about the lyx-cvs
mailing list