Changeset 0eff615 in sasview for src/sas/qtgui/Perspectives


Ignore:
Timestamp:
Sep 6, 2018 3:18:50 AM (6 years ago)
Author:
Laura Forster <Awork@…>
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:
6da3e3d
Parents:
c1cfa80
Message:

Paste params edited

When GUI loaded Paste is now disabled until user copies params. Paste also checks if model has changed since last copy, and displays message warning user that not all params may
paste, with option to cancel. Also - focus fixed such that if paste is clicked the params automatically update without having to move mouse to reset the focus.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    reef298d4 r0eff615  
    4747from sas.qtgui.Perspectives.Fitting.MultiConstraint import MultiConstraint 
    4848from sas.qtgui.Perspectives.Fitting.ReportPageLogic import ReportPageLogic 
    49  
    5049 
    5150 
     
    29352934        # first - regular params 
    29362935        param_list = [] 
     2936 
     2937        param_list.append(['model_name', str(self.cbModel.currentText())]) 
    29372938        def gatherParams(row): 
    29382939            """ 
     
    30213022        if lines[0] != 'sasview_parameter_values': 
    30223023            return False 
    3023         for line in lines[1:-1]: 
     3024 
     3025        model = lines[1].split(',') 
     3026 
     3027        if model[0] != 'model_name': 
     3028            return False 
     3029 
     3030        context['model_name'] = [model[1]] 
     3031        for line in lines[2:-1]: 
    30243032            if len(line) != 0: 
    30253033                item = line.split(',') 
     
    30473055                    except IndexError: 
    30483056                        pass 
     3057 
     3058        if str(self.cbModel.currentText()) != str(context['model_name'][0]): 
     3059            msg = QtWidgets.QMessageBox() 
     3060            msg.setIcon(QtWidgets.QMessageBox.Information) 
     3061            msg.setText("The model in the clipboard is not the same as the currently loaded model. \ 
     3062                         Not all parameters saved may paste correctly.") 
     3063            msg.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel) 
     3064            result = msg.exec_() 
     3065            if result == QtWidgets.QMessageBox.Ok: 
     3066                pass 
     3067            else: 
     3068                return 
    30493069 
    30503070        self.updateFullModel(context) 
     
    30853105            param_repr = GuiUtils.formatNumber(param_dict[param_name][3+ioffset], high=True) 
    30863106            self._model_model.item(row, 3+ioffset).setText(param_repr) 
     3107            self.setFocus() 
     3108 
    30873109 
    30883110        # block signals temporarily, so we don't end up 
     
    30913113        self.iterateOverModel(updateFittedValues) 
    30923114        self._model_model.blockSignals(False) 
     3115 
    30933116 
    30943117    def updateFullPolyModel(self, param_dict): 
     
    31353158            param_repr = GuiUtils.formatNumber(param_dict[param_name][5+ioffset], high=True) 
    31363159            self._poly_model.item(row, 5+ioffset).setText(param_repr) 
     3160            self.setFocus() 
    31373161 
    31383162        # block signals temporarily, so we don't end up 
     
    31423166        self._poly_model.blockSignals(False) 
    31433167 
    3144  
Note: See TracChangeset for help on using the changeset viewer.