Use 'Delete' rather than 'Clear' when talking about removing file items from the FileList, since we have a Delete button for individual files

This commit is contained in:
Miguel Jacq 2020-06-08 09:48:00 +10:00
parent 6012e21899
commit 8f1da24c0d
5 changed files with 39 additions and 39 deletions

View file

@ -208,7 +208,7 @@ class GuiCommon:
color: #cc0000;
}""",
# Share mode and child widget styles
"share_clear_all_files_button": """
"share_delete_all_files_button": """
QPushButton {
color: #3f7fcf;
}

View file

@ -111,12 +111,12 @@ class ShareMode(Mode):
self.info_label = QtWidgets.QLabel()
self.info_label.hide()
# Clear all files button
self.clear_all_button = QtWidgets.QPushButton(strings._("gui_file_selection_clear_all"))
self.clear_all_button.setFlat(True)
self.clear_all_button.setStyleSheet(self.common.gui.css["share_clear_all_files_button"])
self.clear_all_button.clicked.connect(self.clear_all)
self.clear_all_button.hide()
# Delete all files button
self.delete_all_button = QtWidgets.QPushButton(strings._("gui_file_selection_delete_all"))
self.delete_all_button.setFlat(True)
self.delete_all_button.setStyleSheet(self.common.gui.css["share_delete_all_files_button"])
self.delete_all_button.clicked.connect(self.delete_all)
self.delete_all_button.hide()
# Toggle history
self.toggle_history = ToggleHistory(
@ -133,7 +133,7 @@ class ShareMode(Mode):
top_bar_layout = QtWidgets.QHBoxLayout()
top_bar_layout.addWidget(self.info_label)
top_bar_layout.addStretch()
top_bar_layout.addWidget(self.clear_all_button)
top_bar_layout.addWidget(self.delete_all_button)
top_bar_layout.addWidget(self.toggle_history)
# Primary action layout
@ -206,7 +206,7 @@ class ShareMode(Mode):
# Hide and reset the downloads if we have previously shared
self.reset_info_counters()
self.clear_all_button.hide()
self.delete_all_button.hide()
def start_server_step2_custom(self):
"""
@ -267,7 +267,7 @@ class ShareMode(Mode):
self.history.update_in_progress()
self.file_selection.file_list.adjustSize()
self.clear_all_button.show()
self.delete_all_button.show()
def cancel_server_custom(self):
"""
@ -355,7 +355,7 @@ class ShareMode(Mode):
if self.server_status.file_selection.get_num_files() > 0:
self.primary_action.show()
self.info_label.show()
self.clear_all_button.show()
self.delete_all_button.show()
def update_primary_action(self):
self.common.log("ShareMode", "update_primary_action")
@ -365,7 +365,7 @@ class ShareMode(Mode):
if file_count > 0:
self.primary_action.show()
self.info_label.show()
self.clear_all_button.show()
self.delete_all_button.show()
# Update the file count in the info label
total_size_bytes = 0
@ -388,7 +388,7 @@ class ShareMode(Mode):
else:
self.primary_action.hide()
self.info_label.hide()
self.clear_all_button.hide()
self.delete_all_button.hide()
def reset_info_counters(self):
"""
@ -398,9 +398,9 @@ class ShareMode(Mode):
self.toggle_history.indicator_count = 0
self.toggle_history.update_indicator()
def clear_all(self):
def delete_all(self):
"""
Clear All button clicked
Delete All button clicked
"""
self.file_selection.file_list.clear()
self.file_selection.file_list.files_updated.emit()

View file

@ -114,12 +114,12 @@ class WebsiteMode(Mode):
self.info_label = QtWidgets.QLabel()
self.info_label.hide()
# Clear all files button
self.clear_all_button = QtWidgets.QPushButton(strings._("gui_file_selection_clear_all"))
self.clear_all_button.setFlat(True)
self.clear_all_button.setStyleSheet(self.common.gui.css["share_clear_all_files_button"])
self.clear_all_button.clicked.connect(self.clear_all)
self.clear_all_button.hide()
# Delete all files button
self.delete_all_button = QtWidgets.QPushButton(strings._("gui_file_selection_delete_all"))
self.delete_all_button.setFlat(True)
self.delete_all_button.setStyleSheet(self.common.gui.css["share_delete_all_files_button"])
self.delete_all_button.clicked.connect(self.delete_all)
self.delete_all_button.hide()
# Toggle history
self.toggle_history = ToggleHistory(
@ -136,7 +136,7 @@ class WebsiteMode(Mode):
top_bar_layout = QtWidgets.QHBoxLayout()
top_bar_layout.addWidget(self.info_label)
top_bar_layout.addStretch()
top_bar_layout.addWidget(self.clear_all_button)
top_bar_layout.addWidget(self.delete_all_button)
top_bar_layout.addWidget(self.toggle_history)
# Primary action layout
@ -199,7 +199,7 @@ class WebsiteMode(Mode):
# Hide and reset the downloads if we have previously shared
self.reset_info_counters()
self.clear_all_button.hide()
self.delete_all_button.hide()
def start_server_step2_custom(self):
"""
@ -238,7 +238,7 @@ class WebsiteMode(Mode):
self.history.completed_count = 0
self.file_selection.file_list.adjustSize()
self.clear_all_button.show()
self.delete_all_button.show()
def cancel_server_custom(self):
"""
@ -260,7 +260,7 @@ class WebsiteMode(Mode):
if self.server_status.file_selection.get_num_files() > 0:
self.primary_action.show()
self.info_label.show()
self.clear_all_button.show()
self.delete_all_button.show()
def update_primary_action(self):
self.common.log("WebsiteMode", "update_primary_action")
@ -270,7 +270,7 @@ class WebsiteMode(Mode):
if file_count > 0:
self.primary_action.show()
self.info_label.show()
self.clear_all_button.show()
self.delete_all_button.show()
# Update the file count in the info label
total_size_bytes = 0
@ -293,7 +293,7 @@ class WebsiteMode(Mode):
else:
self.primary_action.hide()
self.info_label.hide()
self.clear_all_button.hide()
self.delete_all_button.hide()
def reset_info_counters(self):
"""
@ -303,9 +303,9 @@ class WebsiteMode(Mode):
self.toggle_history.indicator_count = 0
self.toggle_history.update_indicator()
def clear_all(self):
def delete_all(self):
"""
Clear All button clicked
Delete All button clicked
"""
self.file_selection.file_list.clear()
self.file_selection.file_list.files_updated.emit()