Mercurial > octave
diff libinterp/corefcn/event-manager.h @ 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 | b4d2fa28d1d4 |
children | 56465c0739fa |
line wrap: on
line diff
--- a/libinterp/corefcn/event-manager.h Sat Jun 26 07:05:12 2021 -0400 +++ b/libinterp/corefcn/event-manager.h Fri Jun 25 17:27:17 2021 -0400 @@ -161,6 +161,8 @@ virtual void show_workspace (void) { } + virtual void show_community_news (int /*serial*/) { } + virtual bool edit_file (const std::string& /*file*/) { return false; } virtual void @@ -485,6 +487,12 @@ instance->show_workspace (); } + void show_community_news (int serial = -1) + { + if (enabled ()) + instance->show_community_news (serial); + } + bool edit_file (const std::string& file) { return enabled () ? instance->edit_file (file) : false;