mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Leave the FileList enabled, but hide the item buttons when the server is working or started
This commit is contained in:
parent
0b18129947
commit
2b15020e7d
@ -205,16 +205,16 @@ class FileList(QtWidgets.QListWidget):
|
||||
self.takeItem(itemrow)
|
||||
self.files_updated.emit()
|
||||
|
||||
item_button = QtWidgets.QPushButton()
|
||||
item_button.setDefault(False)
|
||||
item_button.setFlat(True)
|
||||
item_button.setIcon( QtGui.QIcon(common.get_resource_path('images/file_delete.png')) )
|
||||
item_button.clicked.connect(delete_item)
|
||||
item.item_button = QtWidgets.QPushButton()
|
||||
item.item_button.setDefault(False)
|
||||
item.item_button.setFlat(True)
|
||||
item.item_button.setIcon( QtGui.QIcon(common.get_resource_path('images/file_delete.png')) )
|
||||
item.item_button.clicked.connect(delete_item)
|
||||
|
||||
# Create an item widget to display on the item
|
||||
item_widget_layout = QtWidgets.QHBoxLayout()
|
||||
item_widget_layout.addStretch()
|
||||
item_widget_layout.addWidget(item_button)
|
||||
item_widget_layout.addWidget(item.item_button)
|
||||
item_widget = QtWidgets.QWidget()
|
||||
item_widget.setLayout(item_widget_layout)
|
||||
|
||||
|
@ -180,9 +180,11 @@ class ServerStatus(QtWidgets.QWidget):
|
||||
|
||||
# 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)
|
||||
for index in range(self.file_selection.file_list.count()):
|
||||
self.file_selection.file_list.item(index).item_button.hide()
|
||||
else:
|
||||
self.file_selection.file_list.setEnabled(True)
|
||||
for index in range(self.file_selection.file_list.count()):
|
||||
self.file_selection.file_list.item(index).item_button.show()
|
||||
|
||||
# Button
|
||||
button_stopped_style = 'QPushButton { background-color: #5fa416; color: #ffffff; padding: 10px; border: 0; border-radius: 5px; }'
|
||||
|
Loading…
Reference in New Issue
Block a user