Changeset 339e22b in sasview for src/sas/qtgui/MainWindow/DataExplorer.py
- Timestamp:
- Sep 7, 2018 12:21:37 PM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 12db2db6
- Parents:
- dda8f16
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
rfd7ef36 r339e22b 42 42 # Main model for keeping loaded data 43 43 self.model = QtGui.QStandardItemModel(self) 44 45 44 # Secondary model for keeping frozen data sets 46 45 self.theory_model = QtGui.QStandardItemModel(self) … … 98 97 self.communicator.plotUpdateSignal.connect(self.updatePlot) 99 98 self.communicator.maskEditorSignal.connect(self.showEditDataMask) 99 self.communicator.extMaskEditorSignal.connect(self.extShowEditDataMask) 100 100 101 101 self.cbgraph.editTextChanged.connect(self.enableGraphCombo) … … 1059 1059 self.new_plot.show() 1060 1060 1061 def extShowEditDataMask(self): 1062 self.showEditDataMask() 1063 1061 1064 def showEditDataMask(self, data=None): 1062 1065 """ 1063 1066 Mask Editor for 2D plots 1064 1067 """ 1065 if data is None or not isinstance(data, Data2D): 1066 index = self.current_view.selectedIndexes()[0] 1067 proxy = self.current_view.model() 1068 model = proxy.sourceModel() 1069 model_item = model.itemFromIndex(proxy.mapToSource(index)) 1070 1071 data = GuiUtils.dataFromItem(model_item) 1068 try: 1069 if data is None or not isinstance(data, Data2D): 1070 index = self.current_view.selectedIndexes()[0] 1071 proxy = self.current_view.model() 1072 model = proxy.sourceModel() 1073 model_item = model.itemFromIndex(proxy.mapToSource(index)) 1074 1075 data = GuiUtils.dataFromItem(model_item) 1076 1077 if data is None or not isinstance(data, Data2D): 1078 msg = QtWidgets.QMessageBox() 1079 msg.setIcon(QtWidgets.QMessageBox.Information) 1080 msg.setText("Error: cannot apply mask. \ 1081 Please select a 2D dataset.") 1082 msg.setStandardButtons(QtWidgets.QMessageBox.Cancel) 1083 msg.exec_() 1084 return 1085 except: 1086 msg = QtWidgets.QMessageBox() 1087 msg.setIcon(QtWidgets.QMessageBox.Information) 1088 msg.setText("Error: No dataset selected. \ 1089 Please select a 2D dataset.") 1090 msg.setStandardButtons(QtWidgets.QMessageBox.Cancel) 1091 msg.exec_() 1092 return 1072 1093 1073 1094 mask_editor = MaskEditor(self, data)
Note: See TracChangeset
for help on using the changeset viewer.