def remove_selected(self):
"""Remove the curves selected in the curve list from the curve library."""
items = self.control_list.selectedItems()
if items:
button = QtWidgets.QMessageBox.question(self, 'Remove Controls',
'Are you sure you want to remove the selected controls?',
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
if button == QtWidgets.QMessageBox.Yes:
for item in items:
text = item.text()
control_file = os.path.join(CONTROLS_DIRECTORY, '{0}.json'.format(text))
os.remove(control_file)
self.populate_controls()
评论列表
文章目录