diff libgui/src/octave-qobject.cc @ 31726:eacd3dee4b01

eliminate some uses of the event manager in GUI callback functions * command-widget.h, command-widget.cc (command_widget::update_prompt_signal): New signal. (command_widget::command_widget): Connect command_widget update_prompt_signal to command_widget update_prompt slot. (command_widget::init_command_prompt, command_widget::process_input_line): In interpreter_event callback function, emit update_prompt_signal directly instead of going through event_manager. * main-window.h, main-window.cc (main_window::update_prompt_signal): New signal. (main_window::handle_octave_ready): In interpreter_event callback function, emit update_prompt_signal directly instead of going through event_manager. Use QPointer to avoid emitting signal for invalid object. (base_qobject::terminal_widget): If using experimental terminal widget, forward main_window::update_prompt_signal to termital_dock_widget::update_prompt_signal.
author John W. Eaton <jwe@octave.org>
date Wed, 11 Jan 2023 16:15:38 -0500
parents 32bc0f1c0a88
children 21f9b34eb893
line wrap: on
line diff
--- a/libgui/src/octave-qobject.cc	Wed Jan 11 17:19:39 2023 -0500
+++ b/libgui/src/octave-qobject.cc	Wed Jan 11 16:15:38 2023 -0500
@@ -482,6 +482,9 @@
             connect (qt_link (), &qt_interpreter_events::new_command_line_signal,
                      m_terminal_widget, &terminal_dock_widget::new_command_line_signal);
 
+            connect (mw, &main_window::update_prompt_signal,
+                     m_terminal_widget, &terminal_dock_widget::update_prompt_signal);
+
             connect_interpreter_events (cmd_widget);
 #endif
           }