Changeset 339e22b in sasview for src/sas/qtgui/MainWindow
- 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
- Location:
- src/sas/qtgui/MainWindow
- Files:
-
- 3 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) -
src/sas/qtgui/MainWindow/GuiManager.py
rf84d793 r339e22b 422 422 self._workspace.actionExcel.triggered.connect(self.actionExcel) 423 423 self._workspace.actionLatex.triggered.connect(self.actionLatex) 424 425 424 # View 426 425 self._workspace.actionShow_Grid_Window.triggered.connect(self.actionShow_Grid_Window) … … 452 451 self._workspace.actionManage_Custom_Models.triggered.connect(self.actionManage_Custom_Models) 453 452 self._workspace.actionAddMult_Models.triggered.connect(self.actionAddMult_Models) 453 self._workspace.actionEditMask.triggered.connect(self.actionEditMask) 454 454 455 # Window 455 456 self._workspace.actionCascade.triggered.connect(self.actionCascade) … … 781 782 self.add_mult_editor.show() 782 783 784 def actionEditMask(self): 785 786 self.communicate.extMaskEditorSignal.emit() 787 783 788 #============ ANALYSIS ================= 784 789 def actionFitting(self): -
src/sas/qtgui/MainWindow/UI/MainWindowUI.ui
rdda8f16 r339e22b 113 113 <addaction name="actionManage_Custom_Models"/> 114 114 <addaction name="actionAddMult_Models"/> 115 <addaction name="separator"/> 116 <addaction name="EditMask"/> 115 117 </widget> 116 118 <widget class="QMenu" name="menuWindow"> … … 413 415 </property> 414 416 </action> 417 <action name="EditMask"> 418 <property name="text"> 419 <string>Edit Mask</string> 420 </property> 421 </action> 415 422 <action name="actionCascade"> 416 423 <property name="text">
Note: See TracChangeset
for help on using the changeset viewer.