diff libgui/src/qt-interpreter-events.cc @ 29835:a946d742fb97

allow community news window to be opened from command line * libgui/src/community-news.h, libgui/src/community-news.cc: New files with community news widget extracted from main-window.cc. * libgui/src/module.mk: Update. * main-window.h, main-window.cc (main_window::m_community_news_window): Delete member variable and all uses. (main_window::load_and_display_community_news, main_window::display_community_news): Delete. (main_window::show_community_news_signal): New signal. (main_window::main_window): To display community news, emit show_community_news_signal instead of calling load_and_display_community_news. (main_window::construct_news_menu): Use lambda expression in menu action to emit show_community_news_signal. * event-manager.h, event-manager.cc (interpreter_events::show_community_news, event_manager::show_community_news): New functions. (F__event_manager_show_community_news__): New function. * qt-interpreter-events.h, qt-interpreter-events.cc (qt_interpreter_events::show_community_news): New function. qt_interpreter_events::show_community_news_signal): New signal. * octave-qobject.h, octave-qobject.cc (base_qobject::m_community_news): New data member. (base_qobject::community_news_widget, base_qobject::show_community_news): New functions. (base_qobject::base_qobject): Connect qt_interpreter_events show_community_news_signal to base_object show_community_news slot. If creating main_window, also connect main_window show_community_news_signal to base_object show_community_news slot. (base_qobject::start_gui): Connect main_window show_community_news_signal to base_object show_community_news slot. (base_qobject::~base_qobject): Also close m_community_news window and delete object.
author John W. Eaton <jwe@octave.org>
date Fri, 25 Jun 2021 17:27:17 -0400
parents a0fce019cd1f
children 56465c0739fa
line wrap: on
line diff
--- a/libgui/src/qt-interpreter-events.cc	Sat Jun 26 07:05:12 2021 -0400
+++ b/libgui/src/qt-interpreter-events.cc	Fri Jun 25 17:27:17 2021 -0400
@@ -286,6 +286,11 @@
     emit show_workspace_signal ();
   }
 
+  void qt_interpreter_events::show_community_news (int serial)
+  {
+    emit show_community_news_signal (serial);
+  }
+
   bool qt_interpreter_events::edit_file (const std::string& file)
   {
     emit edit_file_signal (QString::fromStdString (file));