Skip to content

Commit

Permalink
Merge pull request #2032 from astrofrog/fix-autoconnect
Browse files Browse the repository at this point in the history
Fix bug in autoconnect_callbacks_to_qt
  • Loading branch information
astrofrog committed Jun 24, 2019
1 parent 16bed10 commit aeb3e33
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Full changelog
==============

v0.15.2 (unreleased)
--------------------

* Fixed a bug in ``autoconnect_callbacks_to_qt`` which caused some widgets
to not stay connect to state callback properties if a callback property
was linked to multiple widgets. [#2032]

v0.15.1 (2019-06-24)
--------------------

Expand Down
2 changes: 1 addition & 1 deletion glue/dialogs/link_editor/qt/link_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _set_up_combos(self):
@avoid_circular
def _on_attribute_combo_change(self, *args, **kwargs):
# Force a re-sync of the choices
self._handlers['current_link'].update_widget(self.state.current_link, force=True)
self._handlers['listsel_current_link'].update_widget(self.state.current_link, force=True)

@avoid_circular
def _on_data_change_graph(self):
Expand Down
6 changes: 3 additions & 3 deletions glue/external/echo/qt/autoconnect.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import absolute_import, division, print_function

from qtpy import QtWidgets

from .connect import (connect_checkable_button,
connect_value,
connect_combo_data,
Expand Down Expand Up @@ -113,6 +111,8 @@ def autoconnect_callbacks_to_qt(instance, widget, connect_kwargs={}):
if hasattr(instance, wname):
if wtype in HANDLERS:
child = getattr(widget, original_name)
returned_handlers[wname] = HANDLERS[wtype](instance, wname, child, **kwargs)
# NOTE: we need to use original_name here since we need a
# unique key, and some wname values might be duplicate.
returned_handlers[original_name] = HANDLERS[wtype](instance, wname, child, **kwargs)

return returned_handlers

0 comments on commit aeb3e33

Please sign in to comment.