Mercurial > octave
diff libgui/src/qt-application.cc @ 29153:02ee34a30351
eliminate separate cli_qobject and gui_qobject classes
* octave-qobject.h, octave-qobject.cc (base_qobject::m_main_window):
New data member.
(base_qobject::base_qobject): New arg, GUI_APP. If true, set up GUI
app main main_window object, signals, and set gui_running flag to true
in application context. Otherwise, set up for CLI app. Start main
thread after all other objects are constructed.
(base_qobject::~base_qobject): Delete m_main_window.
(base_qobject::confirm_shutdown): Ask for confirmation from
main_window if it exists.
(class cli_qobject, class gui_qobject): Delete.
* qt-application.cc (qt_application::execute): Pass result of calling
start_gui_p to base_qobject constructor instead of using separate
objects for gui and cli interfaces.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 03 Dec 2020 10:02:08 -0500 |
parents | bd51beb6205e |
children | 7854d5752dd2 |
line wrap: on
line diff
--- a/libgui/src/qt-application.cc Thu Dec 03 12:28:59 2020 -0500 +++ b/libgui/src/qt-application.cc Thu Dec 03 10:02:08 2020 -0500 @@ -62,15 +62,8 @@ // Create and show main window. - if (start_gui_p ()) - { - gui_qobject gui_interface (*this); - return gui_interface.exec (); - } - else - { - cli_qobject cli_interface (*this); - return cli_interface.exec (); - } + base_qobject qt_interface (*this, start_gui_p ()); + + return qt_interface.exec (); } }