comparison libgui/src/terminal-dock-widget.cc @ 31222:1a0756f7c90a

disable experimental terminal widget when building without qscintilla * command-widget.cc: inlcude into #if defined (HAVE_QSCINTILLA) * main-window.cc: include command-widget.h only if HAVE_QSCINTILLA * module.mk: only build moc-command-widget.cc if HAVE_QSCINTILLA * octave-qobject.cc: include command-widget.h only if HAVE_QSCINTILLA, (base_qobject::terminal_widget): use conditional compilation where referring to new terminal widget * terminal-dock-widget.cc: include command-widget.h only if HAVE_QSCINTILLA, (terminal_dock_widget, init_command_prompt): use conditional compilation where referring to new terminal widget * terminal-dock-widget.h: use conditional compilation where referring to new terminal widget Thu Sep 01 02:34:37 2022 +0200 * octave.cc (cmdline_options): only return true on experimental terminal widget option if built with scintilla
author Torsten Lilge <ttl-octave@mailbox.org>
date Sat, 03 Sep 2022 00:18:49 +0200
parents 9c0099048264
children ad014fc78bd6 c6d54dd31a7e
comparison
equal deleted inserted replaced
31221:f5755dbacd8d 31222:1a0756f7c90a
28 #endif 28 #endif
29 29
30 #include <QScreen> 30 #include <QScreen>
31 31
32 // This header is only needed for the new terminal widget. 32 // This header is only needed for the new terminal widget.
33 #include "command-widget.h" 33 #if defined (HAVE_QSCINTILLA)
34 # include "command-widget.h"
35 #endif
34 36
35 // This header is only needed for the old terminal widget. 37 // This header is only needed for the old terminal widget.
36 #include "QTerminal.h" 38 #include "QTerminal.h"
37 39
38 #include "gui-preferences-cs.h" 40 #include "gui-preferences-cs.h"
50 { 52 {
51 // FIXME: we could do this in a better way, but improving it doesn't 53 // 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. 54 // matter much if we will eventually be removing the old terminal.
53 if (m_experimental_terminal_widget) 55 if (m_experimental_terminal_widget)
54 { 56 {
57 #if defined (HAVE_QSCINTILLA)
55 command_widget *widget = new command_widget (oct_qobj, this); 58 command_widget *widget = new command_widget (oct_qobj, this);
56 console *con = widget->get_console (); 59 console *con = widget->get_console ();
57 60
58 connect (this, &terminal_dock_widget::settings_changed, 61 connect (this, &terminal_dock_widget::settings_changed,
59 widget, &command_widget::notice_settings); 62 widget, &command_widget::notice_settings);
69 72
70 connect (this, &terminal_dock_widget::new_command_line_signal, 73 connect (this, &terminal_dock_widget::new_command_line_signal,
71 con, &console::new_command_line); 74 con, &console::new_command_line);
72 75
73 m_terminal = widget; 76 m_terminal = widget;
77 #endif
74 } 78 }
75 else 79 else
76 { 80 {
77 QTerminal *widget = QTerminal::create (oct_qobj, this); 81 QTerminal *widget = QTerminal::create (oct_qobj, this);
78 82
137 { 141 {
138 return (m_experimental_terminal_widget 142 return (m_experimental_terminal_widget
139 ? nullptr : dynamic_cast<QTerminal *> (m_terminal)); 143 ? nullptr : dynamic_cast<QTerminal *> (m_terminal));
140 } 144 }
141 145
146 #if defined (HAVE_QSCINTILLA)
142 command_widget * terminal_dock_widget::get_command_widget (void) 147 command_widget * terminal_dock_widget::get_command_widget (void)
143 { 148 {
144 return (m_experimental_terminal_widget 149 return (m_experimental_terminal_widget
145 ? dynamic_cast<command_widget *> (m_terminal) : nullptr); 150 ? dynamic_cast<command_widget *> (m_terminal) : nullptr);
146 } 151 }
152 #endif
147 153
148 void terminal_dock_widget::notice_settings (const gui_settings *settings) 154 void terminal_dock_widget::notice_settings (const gui_settings *settings)
149 { 155 {
150 emit settings_changed (settings); 156 emit settings_changed (settings);
151 } 157 }
152 158
153 void terminal_dock_widget::init_command_prompt () 159 void terminal_dock_widget::init_command_prompt ()
154 { 160 {
155 if (m_experimental_terminal_widget) 161 if (m_experimental_terminal_widget)
156 { 162 {
163 #if defined (HAVE_QSCINTILLA)
157 command_widget *cmd = get_command_widget (); 164 command_widget *cmd = get_command_widget ();
158 if (cmd) 165 if (cmd)
159 cmd->init_command_prompt (); 166 cmd->init_command_prompt ();
167 #endif
160 } 168 }
161 } 169 }
162 } 170 }