- Timestamp:
- Sep 12, 2018 6:03:00 AM (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:
- f37cab0
- Parents:
- 2d47985
- Location:
- src/sas/qtgui/MainWindow
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
ra54bbf2b r33b3e4d 949 949 self.context_menu.addAction(self.actionQuick3DPlot) 950 950 self.context_menu.addAction(self.actionEditMask) 951 #self.context_menu.addSeparator() 952 #self.context_menu.addAction(self.actionFreezeResults) 951 953 self.context_menu.addSeparator() 952 954 self.context_menu.addAction(self.actionDelete) … … 960 962 self.actionEditMask.triggered.connect(self.showEditDataMask) 961 963 self.actionDelete.triggered.connect(self.deleteItem) 964 self.actionFreezeResults.triggered.connect(self.freezeSelectedItems) 962 965 963 966 def onCustomContextMenu(self, position): … … 980 983 self.actionQuick3DPlot.setEnabled(is_2D) 981 984 self.actionEditMask.setEnabled(is_2D) 985 986 # Freezing 987 # check that the selection has inner items 988 freeze_enabled = False 989 if model_item.parent() is not None: 990 freeze_enabled = True 991 self.actionFreezeResults.setEnabled(freeze_enabled) 992 982 993 # Fire up the menu 983 994 self.context_menu.exec_(self.current_view.mapToGlobal(position)) … … 1115 1126 mask_editor.exec_() 1116 1127 1128 def freezeItem(self, item=None): 1129 """ 1130 Freeze given item 1131 """ 1132 if item is None: 1133 return 1134 self.model.beginResetModel() 1135 new_item = self.cloneTheory(item) 1136 self.model.appendRow(new_item) 1137 self.model.endResetModel() 1138 1139 def freezeSelectedItems(self): 1140 """ 1141 Freeze selected items 1142 """ 1143 indices = self.treeView.selectedIndexes() 1144 1145 proxy = self.treeView.model() 1146 model = proxy.sourceModel() 1147 1148 for index in indices: 1149 row_index = proxy.mapToSource(index) 1150 item_to_copy = model.itemFromIndex(row_index) 1151 if item_to_copy and item_to_copy.isCheckable(): 1152 self.freezeItem(item_to_copy) 1153 1117 1154 def deleteItem(self): 1118 1155 """ … … 1275 1312 1276 1313 # Caption for the theories 1277 checkbox_item.setChild(2, QtGui.QStandardItem(" THEORIES"))1314 checkbox_item.setChild(2, QtGui.QStandardItem("FIT RESULTS")) 1278 1315 1279 1316 # New row in the model -
src/sas/qtgui/MainWindow/UI/DataExplorerUI.ui
rf4a6f2c r33b3e4d 508 508 </property> 509 509 </action> 510 <action name="actionFreezeResults"> 511 <property name="text"> 512 <string>Freeze Results</string> 513 </property> 514 </action> 510 515 </widget> 511 516 <resources/> -
src/sas/qtgui/MainWindow/UI/MainWindowUI.ui
r2f14b5d r33b3e4d 415 415 </property> 416 416 </action> 417 417 <action name="actionEditMask"> 418 418 <property name="text"> 419 419 <string>Edit Mask</string> … … 549 549 <action name="actionFreeze_Theory"> 550 550 <property name="text"> 551 <string>Freeze Theory</string>551 <string>Freeze Fit Results</string> 552 552 </property> 553 553 </action>
Note: See TracChangeset
for help on using the changeset viewer.