Mercurial > octave
diff libgui/src/octave-qt-link.h @ 25639:7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
* main-window.cc (construct_octave_qt_link): connect the slot accessing the
preferences with the related octave-qt-link signal;
(gui_preference): slot for reading the desired preference and for setting
a new value if the given value is not empty, finally resuming the worker
thread by unlocking a mutex
* main-window.h: new slot gui_preference
* octave-qt-link.cc (do_gui_preference): new method signaling a request
for accessing the preferences to the gui, waiting for the result by
a mutex and returning the old value of the preference as a string
* octave-qt-link.h: implementation of purely virtual method
octave_link::do_gui_preference, new signal gui_preference_signal
* octave-link.cc (__octave_link_gui_preference__) new octave internal function
for accessing the gui preferences by calling octave_link::gui_preference
* octave-link.h: (gui_preference): new static method calling purely virtual
method do_gui_preference, which is implemented in octave_qt_link
author | Torsten <mttl@mailbox.org> |
---|---|
date | Wed, 18 Jul 2018 20:54:05 +0200 |
parents | ab10403a0b50 |
children | 3418d3729a51 |
line wrap: on
line diff
--- a/libgui/src/octave-qt-link.h Wed Jul 18 14:23:01 2018 -0400 +++ b/libgui/src/octave-qt-link.h Wed Jul 18 20:54:05 2018 +0200 @@ -138,6 +138,8 @@ void do_show_preferences (void); + std::string do_gui_preference (const std::string& key, + const std::string& value); void do_show_doc (const std::string& file); void do_register_doc (const std::string& file); void do_unregister_doc (const std::string& file); @@ -193,6 +195,9 @@ void show_preferences_signal (void); + void gui_preference_signal (const QString&, const QString&, + QMutex*, QString*); + void show_doc_signal (const QString& file); void register_doc_signal (const QString& file);