From 7bf9c5adfdb16beaaede616bd6ea61ac9007a9c3 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Fri, 23 Feb 2018 14:18:57 -0800 Subject: [PATCH] Change how FileSelection.update tells if items are selected to correctly show and hide the delete button --- onionshare_gui/file_selection.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/onionshare_gui/file_selection.py b/onionshare_gui/file_selection.py index e4861694..29bcc592 100644 --- a/onionshare_gui/file_selection.py +++ b/onionshare_gui/file_selection.py @@ -283,7 +283,7 @@ class FileSelection(QtWidgets.QVBoxLayout): # File list self.file_list = FileList() - self.file_list.currentItemChanged.connect(self.update) + self.file_list.itemSelectionChanged.connect(self.update) self.file_list.files_dropped.connect(self.update) self.file_list.files_updated.connect(self.update) @@ -315,8 +315,7 @@ class FileSelection(QtWidgets.QVBoxLayout): self.add_button.show() # Delete button should be hidden if item isn't selected - current_item = self.file_list.currentItem() - if not current_item: + if len(self.file_list.selectedItems()) == 0: self.delete_button.hide() else: self.delete_button.show()