Changeset 33b3e4d in sasview for src/sas/qtgui/MainWindow


Ignore:
Timestamp:
Sep 12, 2018 6:03:00 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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
Message:

Replace THEORIES in data tab with FIT RESULTS. SASVIEW-1055

Location:
src/sas/qtgui/MainWindow
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    ra54bbf2b r33b3e4d  
    949949        self.context_menu.addAction(self.actionQuick3DPlot) 
    950950        self.context_menu.addAction(self.actionEditMask) 
     951        #self.context_menu.addSeparator() 
     952        #self.context_menu.addAction(self.actionFreezeResults) 
    951953        self.context_menu.addSeparator() 
    952954        self.context_menu.addAction(self.actionDelete) 
     
    960962        self.actionEditMask.triggered.connect(self.showEditDataMask) 
    961963        self.actionDelete.triggered.connect(self.deleteItem) 
     964        self.actionFreezeResults.triggered.connect(self.freezeSelectedItems) 
    962965 
    963966    def onCustomContextMenu(self, position): 
     
    980983        self.actionQuick3DPlot.setEnabled(is_2D) 
    981984        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 
    982993        # Fire up the menu 
    983994        self.context_menu.exec_(self.current_view.mapToGlobal(position)) 
     
    11151126        mask_editor.exec_() 
    11161127 
     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 
    11171154    def deleteItem(self): 
    11181155        """ 
     
    12751312 
    12761313        # Caption for the theories 
    1277         checkbox_item.setChild(2, QtGui.QStandardItem("THEORIES")) 
     1314        checkbox_item.setChild(2, QtGui.QStandardItem("FIT RESULTS")) 
    12781315 
    12791316        # New row in the model 
  • src/sas/qtgui/MainWindow/UI/DataExplorerUI.ui

    rf4a6f2c r33b3e4d  
    508508   </property> 
    509509  </action> 
     510  <action name="actionFreezeResults"> 
     511   <property name="text"> 
     512    <string>Freeze Results</string> 
     513   </property> 
     514  </action> 
    510515 </widget> 
    511516 <resources/> 
  • src/sas/qtgui/MainWindow/UI/MainWindowUI.ui

    r2f14b5d r33b3e4d  
    415415   </property> 
    416416  </action> 
    417     <action name="actionEditMask"> 
     417  <action name="actionEditMask"> 
    418418   <property name="text"> 
    419419    <string>Edit Mask</string> 
     
    549549  <action name="actionFreeze_Theory"> 
    550550   <property name="text"> 
    551     <string>Freeze Theory</string> 
     551    <string>Freeze Fit Results</string> 
    552552   </property> 
    553553  </action> 
Note: See TracChangeset for help on using the changeset viewer.