Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in autoconnect_callbacks_to_qt #2032

Merged
merged 3 commits into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ v0.16.0 (unreleased)

* No changes yet.

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