[LyX/master] Introduce buffer-reset-export
Juergen Spitzmueller
spitz at lyx.org
Fri Dec 27 09:51:07 UTC 2019
commit c0f4eb058047d665bcf2d3b697f11da2ecd30b3a
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Fri Dec 27 11:06:34 2019 +0100
Introduce buffer-reset-export
Small helper lfun that makes LyX remove the aux file before doing the
next export. A bit more convenient than removing the files manually
or restarting LyX.
---
src/FuncCode.h | 2 ++
src/LyXAction.cpp | 9 +++++++++
src/frontends/qt/GuiView.cpp | 10 ++++++++++
3 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/src/FuncCode.h b/src/FuncCode.h
index f2021dd..e94a787 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -486,6 +486,8 @@ enum FuncCode
LFUN_TABULAR_STYLE_INSERT, // spitz, 20190325
LFUN_PARAGRAPH_SELECT, // Kornel, 20190416
LFUN_BIDI,
+ // 380
+ LFUN_BUFFER_RESET_EXPORT, // spitz 20191226
LFUN_LASTACTION // end of the table
};
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index 9187c78..410d0f6 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -778,6 +778,15 @@ void LyXAction::init()
{ LFUN_BUFFER_RELOAD, "buffer-reload", ReadOnly, Buffer },
/*!
+ * \var lyx::FuncCode lyx::LFUN_BUFFER_RESET_EXPORT
+ * \li Action: Removes the auxiliary file before next export to assure export is done afresh.
+ * \li Syntax: buffer-reset-export
+ * \li Origin: spitz, 27 Dec 2019
+ * \endvar
+ */
+ { LFUN_BUFFER_RESET_EXPORT, "buffer-reset-export", ReadOnly, Buffer },
+
+/*!
* \var lyx::FuncCode lyx::LFUN_BUFFER_SAVE_AS_DEFAULT
* \li Action: Save the current document settings as default.
* \li Notion: The file will will be saved into ~/.lyx/templates/defaults.lyx .
diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index bbc9beb..32d6d93 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -1959,6 +1959,10 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
&& (!doc_buffer->isClean() || doc_buffer->notifiesExternalModification());
break;
+ case LFUN_BUFFER_RESET_EXPORT:
+ enable = doc_buffer != 0;
+ break;
+
case LFUN_BUFFER_CHILD_OPEN:
enable = doc_buffer != 0;
break;
@@ -4135,6 +4139,12 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
break;
}
+ case LFUN_BUFFER_RESET_EXPORT:
+ LASSERT(doc_buffer, break);
+ doc_buffer->requireFreshStart(true);
+ dr.setMessage(_("Buffer export reset."));
+ break;
+
case LFUN_BUFFER_WRITE:
LASSERT(doc_buffer, break);
saveBuffer(*doc_buffer);
More information about the lyx-cvs
mailing list