# HG changeset patch # User Torsten Lilge # Date 1626628845 -7200 # Node ID 7f22f024afdf771103cfb6d80d7a340d94ac3ed7 # Parent bc19d9360bace492accb86414badda5ab9ba8cde 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. diff -r bc19d9360bac -r 7f22f024afdf libgui/src/octave-dock-widget.cc --- 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 ())); } } diff -r bc19d9360bac -r 7f22f024afdf libgui/src/octave-qobject.h --- 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; diff -r bc19d9360bac -r 7f22f024afdf libgui/src/variable-editor.cc --- 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); }