# HG changeset patch # User John W. Eaton # Date 1572547427 14400 # Node ID ba317c535adbf0ac4c59d32fcbc8ebae6dffbcdf # Parent 7a748f7545c95cbac42b3d9fa295b736c9f6e2bf define new __event_manager_apply_preferences__ function * qt-interpreter-events.h, qt-interpreter-events.cc (): (qt_interpreter_events::apply_preferences): New function. (qt_interpreter_events::apply_new_settings): New signal. * event-manager.h, event-manager.cc (interpreter_events::apply_preferences): New virtual function. (event_manager::apply_preferences): New function. (F__event_manager_apply_preferences__): New function. * main-window.cc (main_window::construct_octave_qt_link): Connect qt_interpreter_events apply_new_settings signal to main_window request_reload_settings slot. diff -r 7a748f7545c9 -r ba317c535adb libgui/src/main-window.cc --- a/libgui/src/main-window.cc Thu Oct 31 14:36:11 2019 -0400 +++ b/libgui/src/main-window.cc Thu Oct 31 14:43:47 2019 -0400 @@ -2132,6 +2132,9 @@ connect (qt_link, SIGNAL (settings_changed (const QSettings *)), this, SLOT (notice_settings (const QSettings *))); + connect (qt_link, SIGNAL (apply_new_settings (void)), + this, SLOT (request_reload_settings (void))); + connect (qt_link, SIGNAL (set_workspace_signal (bool, bool, const symbol_info_list&)), m_workspace_model, diff -r 7a748f7545c9 -r ba317c535adb libgui/src/qt-interpreter-events.cc --- a/libgui/src/qt-interpreter-events.cc Thu Oct 31 14:36:11 2019 -0400 +++ b/libgui/src/qt-interpreter-events.cc Thu Oct 31 14:43:47 2019 -0400 @@ -237,6 +237,11 @@ emit show_preferences_signal (); } + void qt_interpreter_events::apply_preferences (void) + { + emit apply_new_settings (); + } + void qt_interpreter_events::show_doc (const std::string& file) { emit show_doc_signal (QString::fromStdString (file)); diff -r 7a748f7545c9 -r ba317c535adb libgui/src/qt-interpreter-events.h --- a/libgui/src/qt-interpreter-events.h Thu Oct 31 14:36:11 2019 -0400 +++ b/libgui/src/qt-interpreter-events.h Thu Oct 31 14:43:47 2019 -0400 @@ -109,6 +109,8 @@ void show_preferences (void); + void apply_preferences (void); + void show_doc (const std::string& file); bool edit_file (const std::string& file); @@ -243,6 +245,8 @@ void settings_changed (const QSettings *); + void apply_new_settings (void); + private: QString gui_preference_adjust (const QString& key, const QString& value); diff -r 7a748f7545c9 -r ba317c535adb libinterp/corefcn/event-manager.cc --- a/libinterp/corefcn/event-manager.cc Thu Oct 31 14:36:11 2019 -0400 +++ b/libinterp/corefcn/event-manager.cc Thu Oct 31 14:43:47 2019 -0400 @@ -407,6 +407,17 @@ return ovl (evmgr.show_preferences ()); } +DEFMETHOD (__event_manager_apply_preferences__, interp, , , + doc: /* -*- texinfo -*- +@deftypefn {} {} __event_manager_apply_preferences__ () +Undocumented internal function. +@end deftypefn */) +{ + octave::event_manager& evmgr = interp.get_event_manager (); + + return ovl (evmgr.apply_preferences ()); +} + DEFMETHOD (__event_manager_gui_preference__, interp, args, , doc: /* -*- texinfo -*- @deftypefn {} {} __event_manager_gui_preference__ () diff -r 7a748f7545c9 -r ba317c535adb libinterp/corefcn/event-manager.h --- a/libinterp/corefcn/event-manager.h Thu Oct 31 14:36:11 2019 -0400 +++ b/libinterp/corefcn/event-manager.h Thu Oct 31 14:43:47 2019 -0400 @@ -132,6 +132,8 @@ virtual void show_preferences (void) { } + virtual void apply_preferences (void) { } + virtual void show_doc (const std::string& /*file*/) { } virtual bool edit_file (const std::string& /*file*/) { return false; } @@ -378,6 +380,17 @@ return false; } + bool apply_preferences (void) + { + if (enabled ()) + { + instance->apply_preferences (); + return true; + } + else + return false; + } + bool show_doc (const std::string& file) { if (enabled ())