commit 7903b665a66e3f2b1490ffa2a9d4032b1d0ccc5d
Author: Juergen Spitzmueller <[email protected]>
Date:   Tue Dec 31 12:49:38 2024 +0100

    Introduce errors-show
    
    a way to re-open the (LaTeX or other processing) errors dialog after it
    had been closed without having to re-compile the document (#2775)
---
 lib/RELEASE-NOTES            |  3 +++
 lib/ui/stdmenus.inc          |  1 +
 src/FuncCode.h               |  1 +
 src/LyXAction.cpp            |  8 ++++++++
 src/frontends/qt/GuiView.cpp | 13 +++++++++++++
 5 files changed, 26 insertions(+)

diff --git a/lib/RELEASE-NOTES b/lib/RELEASE-NOTES
index 0ca44c7805..1b453db6e1 100644
--- a/lib/RELEASE-NOTES
+++ b/lib/RELEASE-NOTES
@@ -17,6 +17,9 @@
 
 !!!The following new LyX functions have been introduced in 2.5:
 
+- The new function show-errors re-displays the (e.g., LaTeX) errors dialog 
+  if there had been any processing errors.
+
 - The new function word-invertcase is a companion of word-upcase and
   word-lowcase: it inverts each character between lowcase and upcase,
   which is useful when one FORGOT THE cAPS lOCK KEY.
diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc
index fd38567844..427a3c8dbd 100644
--- a/lib/ui/stdmenus.inc
+++ b/lib/ui/stdmenus.inc
@@ -575,6 +575,7 @@ Menuset
                Submenu "Change Tracking|C" "document_change"
                OptItem "Build Program|B" "build-program"
                Item "LaTeX Log|L" "dialog-show latexlog"
+               Item "Processing Errors|r" "errors-show"
                Item "Start Appendix Here|x" "appendix"
                Separator
                ViewFormats
diff --git a/src/FuncCode.h b/src/FuncCode.h
index f0a377879e..b3bebaa4b0 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -513,6 +513,7 @@ enum FuncCode
        // 400
        LFUN_REFERENCE_TO_PARAGRAPH,    // spitz, 20240728
        LFUN_WORD_INVERTCASE,           // lasgouttes 20241015
+       LFUN_ERRORS_SHOW,               // spitz 20241231
        LFUN_LASTACTION                 // end of the table
 };
 
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index 6f02a8792e..a1c52af08c 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -1579,6 +1579,14 @@ void LyXAction::init()
  */
                { LFUN_ENVIRONMENT_SPLIT, "environment-split", Noop, Layout },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_ERRORS_SHOW
+ * \li Action: Shows export error dialog if errors exist.
+ * \li Syntax: errors-show
+ * \li Origin: spitz, 31 Dec 2024
+ * \endvar
+ */
+               { LFUN_ERRORS_SHOW, "errors-show", NoBuffer, Edit },
 
 /*!
  * \var lyx::FuncCode lyx::LFUN_ERT_INSERT
diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index b8dd67f9cd..095ff65511 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -2673,6 +2673,12 @@ bool GuiView::getStatus(FuncRequest const & cmd, 
FuncStatus & flag)
                break;
        }
 
+       case LFUN_ERRORS_SHOW: {
+               enable = buf && (!buf->errorList(d.last_export_format).empty()
+                                || 
!buf->masterBuffer()->errorList(d.last_export_format).empty());
+               break;
+       }
+
        case LFUN_COMMAND_EXECUTE:
        case LFUN_MESSAGE:
        case LFUN_MENU_OPEN:
@@ -4916,6 +4922,13 @@ void GuiView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
                        break;
                }
 
+               case LFUN_ERRORS_SHOW: {
+                       // We guess it's from master if the single buffer list 
is empty
+                       bool const from_master = 
bv->buffer().errorList(d.last_export_format).empty();
+                       errors(d.last_export_format, from_master);
+                       break;
+               }
+
                case LFUN_MESSAGE:
                        dr.setMessage(cmd.argument());
                        break;
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to