From 89330073b72fb88eec13c322cecabd94dfd6ee59 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Tue, 14 May 2024 17:58:18 +0200 Subject: [PATCH 1/2] Fixed callback for click signal in CAATypesSelectorDialog --- picard/ui/caa_types_selector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/picard/ui/caa_types_selector.py b/picard/ui/caa_types_selector.py index 6f613b1c7..f02c13880 100644 --- a/picard/ui/caa_types_selector.py +++ b/picard/ui/caa_types_selector.py @@ -325,7 +325,7 @@ class CAATypesSelectorDialog(PicardDialog): def excluded(self): return list(self.list_exclude.all_items_data()) or ['none'] - def clear_focus(self, lists): + def clear_focus(self, lists, *args): for temp_list in lists: temp_list.clearSelection() self.set_buttons_enabled_state() From 4f15d262e9b937139e398784419533213de01274 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Thu, 16 May 2024 10:59:53 +0200 Subject: [PATCH 2/2] Renamed CAATypesSelectorDialog.clear_focus to _on_list_clicked This makes the usage of the function clearer, as this is being used as a Qt slot. --- picard/ui/caa_types_selector.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/picard/ui/caa_types_selector.py b/picard/ui/caa_types_selector.py index f02c13880..cd4c5156f 100644 --- a/picard/ui/caa_types_selector.py +++ b/picard/ui/caa_types_selector.py @@ -190,9 +190,9 @@ class CAATypesSelectorDialog(PicardDialog): 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() @@ -325,7 +325,7 @@ class CAATypesSelectorDialog(PicardDialog): def excluded(self): return list(self.list_exclude.all_items_data()) or ['none'] - def clear_focus(self, lists, *args): + def _on_list_clicked(self, lists, index): for temp_list in lists: temp_list.clearSelection() self.set_buttons_enabled_state()