Mercurial > octave
comparison libgui/src/terminal-dock-widget.cc @ 31068:0b402f523f09
allow executing a command in the new terminal widget
* command-widget.cc (console::new_command_line): Allow a new command
line with preset text;
(console::execute_command): Slot for executing a command
* command-widget.h, class console: new_command_line with optional
string argument, new functions execute_command and get_console
* main-window.cc (adopt_terminal_widget): connect execute command
signal with related signal in terminal widget;
(execute_command_in_terminal): in case of exp. terminal widget,
emit new signal execute_command_signal
* main-window.h: new signal execute_command_signal
* terminal-dock-widget.cc (terminal_dock_widget): connect own
execute signal to the slot in the console
* terminal-dock-widget.h: new signal execute_command_signal
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sat, 04 Jun 2022 22:17:58 +0200 |
parents | 5261a81765b0 |
children | 9c0099048264 |
comparison
equal
deleted
inserted
replaced
31067:5261a81765b0 | 31068:0b402f523f09 |
---|---|
51 // FIXME: we could do this in a better way, but improving it doesn't | 51 // FIXME: we could do this in a better way, but improving it doesn't |
52 // matter much if we will eventually be removing the old terminal. | 52 // matter much if we will eventually be removing the old terminal. |
53 if (m_experimental_terminal_widget) | 53 if (m_experimental_terminal_widget) |
54 { | 54 { |
55 command_widget *widget = new command_widget (oct_qobj, this); | 55 command_widget *widget = new command_widget (oct_qobj, this); |
56 console *con = widget->get_console (); | |
56 | 57 |
57 connect (this, &terminal_dock_widget::settings_changed, | 58 connect (this, &terminal_dock_widget::settings_changed, |
58 widget, &command_widget::notice_settings); | 59 widget, &command_widget::notice_settings); |
59 | 60 |
60 connect (this, &terminal_dock_widget::update_prompt_signal, | 61 connect (this, &terminal_dock_widget::update_prompt_signal, |
61 widget, &command_widget::update_prompt); | 62 widget, &command_widget::update_prompt); |
62 | 63 |
63 connect (this, &terminal_dock_widget::interpreter_output_signal, | 64 connect (this, &terminal_dock_widget::interpreter_output_signal, |
64 widget, &command_widget::insert_interpreter_output); | 65 widget, &command_widget::insert_interpreter_output); |
66 | |
67 connect (this, &terminal_dock_widget::execute_command_signal, | |
68 con, &console::execute_command); | |
65 | 69 |
66 m_terminal = widget; | 70 m_terminal = widget; |
67 } | 71 } |
68 else | 72 else |
69 { | 73 { |