From 0b18129947478312909822e29029189ec5ed3fb7 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Wed, 7 Feb 2018 16:40:41 +1100 Subject: [PATCH] Set the File List widget to readonly while running, so items can't be deleted mid-share --- onionshare_gui/server_status.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index 3f7e390c..32b1aa32 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -178,6 +178,12 @@ class ServerStatus(QtWidgets.QWidget): self.copy_url_button.hide() self.copy_hidservauth_button.hide() + # Set the File List widget to readonly while running, so items can't be deleted mid-share + if self.status == self.STATUS_STARTED or self.status == self.STATUS_WORKING: + self.file_selection.file_list.setEnabled(False) + else: + self.file_selection.file_list.setEnabled(True) + # Button button_stopped_style = 'QPushButton { background-color: #5fa416; color: #ffffff; padding: 10px; border: 0; border-radius: 5px; }' button_working_style = 'QPushButton { background-color: #4c8211; color: #ffffff; padding: 10px; border: 0; border-radius: 5px; font-style: italic; }'