summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2018-02-24 08:46:33 +1000
committerGitHub <noreply@github.com>2018-02-24 08:46:33 +1000
commit3280e5428b26afa629acdf4982100be6481570c1 (patch)
tree97ab154b843f8aa0b4dec48ac83f23cc8dce5048
parenta53ab8a459af22a56f872fdf0e6b72f3d1914c25 (diff)
parent7bf9c5adfdb16beaaede616bd6ea61ac9007a9c3 (diff)
downloadonionshare-3280e5428b26afa629acdf4982100be6481570c1.tar.gz
onionshare-3280e5428b26afa629acdf4982100be6481570c1.zip
Merge pull request #628 from micahflee/624_deselecting_delete
Show and hide the delete button at the right times
-rw-r--r--onionshare_gui/file_selection.py5
1 files 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()