# HG changeset patch # User Torsten Lilge # Date 1662157129 -7200 # Node ID 1a0756f7c90af1fe2b7ecd7f682ae8cc54e20f2d # Parent f5755dbacd8d3fc70cd991052065ee0100455a4d 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 diff -r f5755dbacd8d -r 1a0756f7c90a libgui/src/command-widget.cc --- a/libgui/src/command-widget.cc Wed Aug 31 22:04:02 2022 +0200 +++ b/libgui/src/command-widget.cc Sat Sep 03 00:18:49 2022 +0200 @@ -27,6 +27,8 @@ # include "config.h" #endif +#if defined (HAVE_QSCINTILLA) + #include #include #include @@ -300,3 +302,5 @@ } } + +#endif \ No newline at end of file diff -r f5755dbacd8d -r 1a0756f7c90a libgui/src/main-window.cc --- a/libgui/src/main-window.cc Wed Aug 31 22:04:02 2022 +0200 +++ b/libgui/src/main-window.cc Sat Sep 03 00:18:49 2022 +0200 @@ -58,8 +58,8 @@ #if defined (HAVE_QSCINTILLA) # include "file-editor.h" +# include "command-widget.h" #endif -#include "command-widget.h" #include "gui-preferences-cs.h" #include "gui-preferences-dw.h" #include "gui-preferences-ed.h" diff -r f5755dbacd8d -r 1a0756f7c90a libgui/src/module.mk --- a/libgui/src/module.mk Wed Aug 31 22:04:02 2022 +0200 +++ b/libgui/src/module.mk Sat Sep 03 00:18:49 2022 +0200 @@ -265,17 +265,23 @@ $(OCTAVE_GUI_SRC_M_EDITOR_MOC): | %reldir%/m-editor/$(octave_dirstamp) +OCTAVE_GUI_SRC_COMMAND_WIDGET_MOC = \ + %reldir%/moc-command-widget.cc + +$(OCTAVE_GUI_SRC_COMMAND_WIDGET_MOC): | %reldir%/$(octave_dirstamp) + octave_gui_MOC += \ - $(OCTAVE_GUI_SRC_M_EDITOR_MOC) + $(OCTAVE_GUI_SRC_M_EDITOR_MOC) \ + $(OCTAVE_GUI_SRC_COMMAND_WIDGET_MOC) DIRSTAMP_FILES += \ - %reldir%/m-editor/$(octave_dirstamp) + %reldir%/m-editor/$(octave_dirstamp) \ + %reldir%/$(octave_dirstamp) endif OCTAVE_GUI_SRC_MOC = \ %reldir%/moc-external-editor-interface.cc \ - %reldir%/moc-command-widget.cc \ %reldir%/moc-community-news.cc \ %reldir%/moc-dialog.cc \ %reldir%/moc-documentation-dock-widget.cc \ diff -r f5755dbacd8d -r 1a0756f7c90a libgui/src/octave-qobject.cc --- a/libgui/src/octave-qobject.cc Wed Aug 31 22:04:02 2022 +0200 +++ b/libgui/src/octave-qobject.cc Sat Sep 03 00:18:49 2022 +0200 @@ -40,7 +40,9 @@ // QTerminal includes #include "QTerminal.h" -#include "command-widget.h" +#if defined (HAVE_QSCINTILLA) +# include "command-widget.h" +#endif #include "community-news.h" #include "documentation-dock-widget.h" #include "files-dock-widget.h" @@ -461,6 +463,7 @@ = QPointer (new terminal_dock_widget (mw, *this)); if (experimental_terminal_widget ()) { +#if defined (HAVE_QSCINTILLA) command_widget *cmd_widget = m_terminal_widget->get_command_widget (); @@ -483,6 +486,7 @@ m_terminal_widget, &terminal_dock_widget::new_command_line_signal); connect_interpreter_events (cmd_widget); +#endif } else { diff -r f5755dbacd8d -r 1a0756f7c90a libgui/src/terminal-dock-widget.cc --- a/libgui/src/terminal-dock-widget.cc Wed Aug 31 22:04:02 2022 +0200 +++ b/libgui/src/terminal-dock-widget.cc Sat Sep 03 00:18:49 2022 +0200 @@ -30,7 +30,9 @@ #include // This header is only needed for the new terminal widget. -#include "command-widget.h" +#if defined (HAVE_QSCINTILLA) +# include "command-widget.h" +#endif // This header is only needed for the old terminal widget. #include "QTerminal.h" @@ -52,6 +54,7 @@ // matter much if we will eventually be removing the old terminal. if (m_experimental_terminal_widget) { +#if defined (HAVE_QSCINTILLA) command_widget *widget = new command_widget (oct_qobj, this); console *con = widget->get_console (); @@ -71,6 +74,7 @@ con, &console::new_command_line); m_terminal = widget; +#endif } else { @@ -139,11 +143,13 @@ ? nullptr : dynamic_cast (m_terminal)); } +#if defined (HAVE_QSCINTILLA) command_widget * terminal_dock_widget::get_command_widget (void) { return (m_experimental_terminal_widget ? dynamic_cast (m_terminal) : nullptr); } +#endif void terminal_dock_widget::notice_settings (const gui_settings *settings) { @@ -154,9 +160,11 @@ { if (m_experimental_terminal_widget) { +#if defined (HAVE_QSCINTILLA) command_widget *cmd = get_command_widget (); if (cmd) cmd->init_command_prompt (); +#endif } } } diff -r f5755dbacd8d -r 1a0756f7c90a libgui/src/terminal-dock-widget.h --- a/libgui/src/terminal-dock-widget.h Wed Aug 31 22:04:02 2022 +0200 +++ b/libgui/src/terminal-dock-widget.h Sat Sep 03 00:18:49 2022 +0200 @@ -58,8 +58,10 @@ // Only valid if using the old terminal widget. QTerminal * get_qterminal (void); +#if defined (HAVE_QSCINTILLA) // Only valid if using the new terminal widget. command_widget * get_command_widget (void); +#endif signals: diff -r f5755dbacd8d -r 1a0756f7c90a libinterp/octave.cc --- a/libinterp/octave.cc Wed Aug 31 22:04:02 2022 +0200 +++ b/libinterp/octave.cc Sat Sep 03 00:18:49 2022 +0200 @@ -159,7 +159,9 @@ break; case EXPERIMENTAL_TERMINAL_WIDGET_OPTION: +#if defined (HAVE_QSCINTILLA) m_experimental_terminal_widget = true; +#endif break; case GUI_OPTION: