Changeset b1a7a81 in sasview for src/sas/qtgui/MainWindow/DataExplorer.py
- Timestamp:
- Jul 5, 2018 11:03:11 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- f0a8f74
- Parents:
- e20870bc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
re20870bc rb1a7a81 1012 1012 """ 1013 1013 # Assure this is indeed wanted 1014 delete_msg = "This operation will delete the selected data sets." +\ 1014 delete_msg = "This operation will delete the selected data sets " +\ 1015 "and all the dependents." +\ 1015 1016 "\nDo you want to continue?" 1016 1017 reply = QtWidgets.QMessageBox.question(self, … … 1023 1024 return 1024 1025 1025 indices = self.current_view.selectedIndexes()1026 1026 proxy = self.current_view.model() 1027 1027 model = proxy.sourceModel() 1028 1028 1029 for index in indices: 1029 deleted_indices = [] 1030 deleted_names = [] 1031 1032 # Every time a row is removed, the indices change, so we'll just remove 1033 # rows and keep calling selectedIndexes until it returns an empty list. 1034 indices = self.current_view.selectedIndexes() 1035 1036 while len(indices) > 0: 1037 index = indices[0] 1030 1038 row_index = proxy.mapToSource(index) 1031 1039 item_to_delete = model.itemFromIndex(row_index) 1032 1040 if item_to_delete and item_to_delete.isCheckable(): 1033 1041 row = row_index.row() 1042 1043 # store the deleted item details so we can pass them on later 1044 deleted_names.append(str(self.model.item(row).text())) 1045 deleted_indices.append(self.model.item(row)) 1046 1034 1047 if item_to_delete.parent(): 1035 1048 # We have a child item - delete from it … … 1038 1051 # delete directly from model 1039 1052 model.removeRow(row) 1040 pass 1053 indices = self.current_view.selectedIndexes() 1054 1055 # Let others know we deleted data 1056 self.communicator.dataDeletedSignal.emit(deleted_indices) 1057 1058 # update stored_data 1059 self.manager.update_stored_data(deleted_names) 1041 1060 1042 1061 def onAnalysisUpdate(self, new_perspective=""):
Note: See TracChangeset
for help on using the changeset viewer.