comparison libgui/src/command-widget.h @ 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 56ee6a223c51
comparison
equal deleted inserted replaced
31067:5261a81765b0 31068:0b402f523f09
50 50
51 console (command_widget *p); 51 console (command_widget *p);
52 52
53 public slots: 53 public slots:
54 54
55 void new_command_line (void); 55 void new_command_line (const QString& command = QString ());
56
57 void execute_command (const QString& command);
56 58
57 protected: 59 protected:
58 60
59 void keyPressEvent (QKeyEvent *e); 61 void keyPressEvent (QKeyEvent *e);
60 62
76 78
77 public: 79 public:
78 80
79 command_widget (base_qobject& oct_qobj, QWidget *p); 81 command_widget (base_qobject& oct_qobj, QWidget *p);
80 82
83 console * get_console ( ) { return m_console; };
84
81 void init_command_prompt (); 85 void init_command_prompt ();
82 86
83 QString prompt (void); 87 QString prompt (void);
84 88
85 signals: 89 signals:
91 void interpreter_stop (void); 95 void interpreter_stop (void);
92 96
93 void interpreter_event (const fcn_callback& fcn); 97 void interpreter_event (const fcn_callback& fcn);
94 void interpreter_event (const meth_callback& meth); 98 void interpreter_event (const meth_callback& meth);
95 99
96 void new_command_line_signal (void); 100 void new_command_line_signal (const QString& command = QString ());
97 101
98 public slots: 102 public slots:
99 103
100 void process_input_line (const QString& input_line); 104 void process_input_line (const QString& input_line);
101 105