changeset 30740:d6ca77706ab3 stable

shutdown via interpreter with experimental terminal in gui mode (bug #61994) * octave-qobject.h (base_qobject::is_gui_app): New function. * main-window.cc (main_window::closeEvent): Also request interpreter to perform shutdown when using experimental terminal in gui app mode.
author John W. Eaton <jwe@octave.org>
date Sun, 13 Feb 2022 12:47:13 -0500
parents 3c4368f0a4ab
children 496e5214c609 60e31b2666d2
files libgui/src/main-window.cc libgui/src/octave-qobject.h
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Sat Feb 12 16:21:46 2022 -0500
+++ b/libgui/src/main-window.cc	Sun Feb 13 12:47:13 2022 -0500
@@ -1984,7 +1984,8 @@
 
         e->ignore ();
 
-        if (m_octave_qobj.experimental_terminal_widget ())
+        if (m_octave_qobj.experimental_terminal_widget ()
+            && ! m_octave_qobj.is_gui_app ())
           emit close_gui_signal ();
         else
           {
--- a/libgui/src/octave-qobject.h	Sat Feb 12 16:21:46 2022 -0500
+++ b/libgui/src/octave-qobject.h	Sun Feb 13 12:47:13 2022 -0500
@@ -201,6 +201,8 @@
 
     virtual bool confirm_shutdown (void);
 
+    bool is_gui_app (void) const { return m_gui_app; }
+
     template <typename T> void connect_interpreter_events (T *widget)
     {
       connect (widget, QOverload<const fcn_callback&>::of (&T::interpreter_event),