commit 299242bb16e2fdd026ac975e8ac4d81e8dfef890
Author: Guillaume Munch <[email protected]>
Date: Wed Mar 1 21:16:37 2017 +0100
New LFUN buffer-external-modification-clear
---
src/FuncCode.h | 1 +
src/LyXAction.cpp | 10 ++++++++++
src/frontends/qt4/GuiView.cpp | 9 +++++++++
3 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/FuncCode.h b/src/FuncCode.h
index ad9cb56..4ad5a78 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -468,6 +468,7 @@ enum FuncCode
LFUN_BRANCH_INVERT, // rgheck, 20160712
LFUN_LYX_ACTIVATE, // skostysh, 20160804
LFUN_ICON_SIZE, // daniel, 20160712
+ LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR,// gm, 20170302
LFUN_LASTACTION // end of the table
};
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index 673cf3b..3cccc37 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -879,6 +879,16 @@ void LyXAction::init()
{ LFUN_BUFFER_WRITE_AS, "buffer-write-as", ReadOnly, Buffer },
/*!
+ * \var lyx::FuncCode lyx::LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR
+ * \li Action: Clear the external modification flag on the current buffer.
+ * \li Syntax: buffer-external-modification-clear
+ * \li Origin: gm, 2 March 2017
+ * \endvar
+ */
+ { LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR,
+ "buffer-external-modification-clear", ReadOnly, Buffer },
+
+/*!
* \var lyx::FuncCode lyx::LFUN_BUFFER_ZOOM_IN
* \li Action: Increases the zoom of the screen fonts.
* \li Syntax: buffer-zoom-in [<ZOOM>]
diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 7ff8e04..e2e6555 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -1848,6 +1848,10 @@ bool GuiView::getStatus(FuncRequest const & cmd,
FuncStatus & flag)
break;
}
+ case LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR:
+ enable = doc_buffer &&
doc_buffer->notifiesExternalModification();
+ break;
+
case LFUN_BUFFER_WRITE_AS:
case LFUN_BUFFER_EXPORT_AS:
enable = doc_buffer != 0;
@@ -3773,6 +3777,11 @@ void GuiView::dispatch(FuncRequest const & cmd,
DispatchResult & dr)
break;
}
+ case LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR:
+ LASSERT(doc_buffer, break);
+ doc_buffer->clearExternalModification();
+ break;
+
case LFUN_BUFFER_CLOSE:
closeBuffer();
break;