Mercurial > octave
changeset 29891:7f22f024afdf
fix broken signal/slot connections for the variable editor
* octave-dock-widget.cc (label_dock_widget::label_dock_widget): do not
connect copy/paste/select/undo signals from to the parent but from the
main window to the related slots
* octave-qobject.h: new function returning the data member for
containing the pointer to the main window
* variable-editor.cc (edit_variable): fix refloat in connection from
signal to slot, fix name of the signal for updating the title to
description_changed.
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sun, 18 Jul 2021 19:20:45 +0200 |
parents | bc19d9360bac |
children | 474f41101569 |
files | libgui/src/octave-dock-widget.cc libgui/src/octave-qobject.h libgui/src/variable-editor.cc |
diffstat | 3 files changed, 13 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/octave-dock-widget.cc Sun Jul 18 15:54:48 2021 +0200 +++ b/libgui/src/octave-dock-widget.cc Sun Jul 18 19:20:45 2021 +0200 @@ -103,19 +103,20 @@ m_title_widget->setLayout (h_layout); - if (p) + main_window* mw = oct_qobj.get_main_window (); + if (mw) { // Only connect the when a parent (main window) is given // copy & paste handling - connect (p, SIGNAL (copyClipboard_signal ()), + connect (mw, SIGNAL (copyClipboard_signal ()), this, SLOT (copyClipboard ())); - connect (p, SIGNAL (pasteClipboard_signal ()), + connect (mw, SIGNAL (pasteClipboard_signal ()), this, SLOT (pasteClipboard ())); - connect (p, SIGNAL (selectAll_signal ()), + connect (mw, SIGNAL (selectAll_signal ()), this, SLOT (selectAll ())); // undo handling - connect (p, SIGNAL (undo_signal ()), this, SLOT (do_undo ())); + connect (mw, SIGNAL (undo_signal ()), this, SLOT (do_undo ())); } }
--- a/libgui/src/octave-qobject.h Sun Jul 18 15:54:48 2021 +0200 +++ b/libgui/src/octave-qobject.h Sun Jul 18 19:20:45 2021 +0200 @@ -131,6 +131,11 @@ return ! m_terminal_widget.isNull (); } + main_window* get_main_window (void) + { + return m_main_window; + } + resource_manager& get_resource_manager (void) { return m_resource_manager;
--- a/libgui/src/variable-editor.cc Sun Jul 18 15:54:48 2021 +0200 +++ b/libgui/src/variable-editor.cc Sun Jul 18 19:20:45 2021 +0200 @@ -1257,7 +1257,7 @@ connect (page, SIGNAL (queue_unfloat_float ()), page, SLOT (unfloat_float ()), Qt::QueuedConnection); connect (page, SIGNAL (queue_float ()), - page, SIGNAL (refloat ()), Qt::QueuedConnection); + page, SLOT (refloat ()), Qt::QueuedConnection); #endif variable_editor_stack *stack @@ -1355,7 +1355,7 @@ // FIXME: What was the intent here? update_label_signal does // not seem to exist now. - connect (model, SIGNAL (update_label_signal (const QString&)), + connect (model, SIGNAL (description_changed (const QString&)), existing_ql, SLOT (setText (const QString&))); existing_ql->setMargin (2); }