Skip to content

Commit

Permalink
Merge pull request #2474 from phw/fix-QListWidget-click-slot
Browse files Browse the repository at this point in the history
Fixed callback for click signal in CAATypesSelectorDialog
  • Loading branch information
zas authored May 16, 2024
2 parents 5350b2c + 4f15d26 commit b02c0a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions picard/ui/caa_types_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ def __init__(
self.fill_lists(types_include, types_exclude)

# Set triggers when the lists receive the current focus
self.list_include.clicked.connect(partial(self.clear_focus, [self.list_ignore, self.list_exclude]))
self.list_exclude.clicked.connect(partial(self.clear_focus, [self.list_ignore, self.list_include]))
self.list_ignore.clicked.connect(partial(self.clear_focus, [self.list_include, self.list_exclude]))
self.list_include.clicked.connect(partial(self._on_list_clicked, (self.list_ignore, self.list_exclude)))
self.list_exclude.clicked.connect(partial(self._on_list_clicked, (self.list_ignore, self.list_include)))
self.list_ignore.clicked.connect(partial(self._on_list_clicked, (self.list_include, self.list_exclude)))

# Add instructions to the dialog box
instructions = QtWidgets.QLabel()
Expand Down Expand Up @@ -325,7 +325,7 @@ def included(self):
def excluded(self):
return list(self.list_exclude.all_items_data()) or ['none']

def clear_focus(self, lists):
def _on_list_clicked(self, lists, index):
for temp_list in lists:
temp_list.clearSelection()
self.set_buttons_enabled_state()
Expand Down

0 comments on commit b02c0a8

Please sign in to comment.