# HG changeset patch # User John W. Eaton # Date 1516599911 18000 # Node ID 57f36275e605fa2adbd7c867b835ca1fe29930f1 # Parent 55da6c4f1382a8d2ba5899df08f1732c5e800d5f handle run file and execute command in terminal in the same way * main-window.h, main-window.cc (main_window::run_file_in_terminal): Similar to the execute_command_in_terminal function, add octave_cmd_eval object to m_cmd_queue here instead of posting an event in the octave_link queue. (main_window::run_file_callback): Delete. diff -r 55da6c4f1382 -r 57f36275e605 libgui/src/main-window.cc --- a/libgui/src/main-window.cc Sun Jan 21 17:33:20 2018 -0500 +++ b/libgui/src/main-window.cc Mon Jan 22 00:45:11 2018 -0500 @@ -902,7 +902,9 @@ main_window::execute_command_in_terminal (const QString& command) { octave_cmd_exec *cmd = new octave_cmd_exec (command); + m_cmd_queue.add_cmd (cmd); + if (focus_console_after_command ()) focus_command_window (); } @@ -910,7 +912,10 @@ void main_window::run_file_in_terminal (const QFileInfo& info) { - octave_link::post_event (this, &main_window::run_file_callback, info); + octave_cmd_eval *cmd = new octave_cmd_eval (info); + + m_cmd_queue.add_cmd (cmd); + if (focus_console_after_command ()) focus_command_window (); } @@ -2595,13 +2600,6 @@ Fhistory (ovl ("-c")); } -void -main_window::run_file_callback (const QFileInfo& info) -{ - octave_cmd_eval *cmd = new octave_cmd_eval (info); - m_cmd_queue.add_cmd (cmd); -} - bool main_window::focus_console_after_command (void) { diff -r 55da6c4f1382 -r 57f36275e605 libgui/src/main-window.h --- a/libgui/src/main-window.h Sun Jan 21 17:33:20 2018 -0500 +++ b/libgui/src/main-window.h Mon Jan 22 00:45:11 2018 -0500 @@ -337,8 +337,6 @@ void clear_history_callback (void); - void run_file_callback (const QFileInfo& info); - bool focus_console_after_command (void); void new_figure_callback (void);