Ignore:
Timestamp:
Sep 5, 2017 2:18:07 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
9909967
Parents:
4d1eff2
Message:

SASVIEW-625: code review fixes. Corrected handling for cancelling the file open dialog, updated test cases.

File:
1 edited

Legend:

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

    re43fc91 r8222f171  
    3939from sas.qtgui.Perspectives.Fitting.ViewDelegate import PolyViewDelegate 
    4040from sas.qtgui.Perspectives.Fitting.ViewDelegate import MagnetismViewDelegate 
     41 
    4142 
    4243TAB_MAGNETISM = 4 
     
    181182        self.page_stack = [] 
    182183        self.all_data = [] 
     184        # Polydisp widget table default index for function combobox 
     185        self.orig_poly_index = 3 
    183186 
    184187        # Data for chosen model 
     
    15611564        # For the given row, invoke the "array" combo handler 
    15621565        array_caption = 'array' 
    1563         self.onPolyComboIndexChange(array_caption, row_index) 
     1566 
    15641567        # Get the combo box reference 
    15651568        ind = self._poly_model.index(row_index, self.lstPoly.itemDelegate().poly_function) 
    15661569        widget = self.lstPoly.indexWidget(ind) 
     1570 
    15671571        # Update the combo box so it displays "array" 
    15681572        widget.blockSignals(True) 
     
    15701574        widget.blockSignals(False) 
    15711575 
     1576        # Invoke the file reader 
     1577        self.onPolyComboIndexChange(array_caption, row_index) 
     1578 
    15721579    def onPolyComboIndexChange(self, combo_string, row_index): 
    15731580        """ 
     
    15781585        file_index = self._poly_model.index(row_index, self.lstPoly.itemDelegate().poly_function) 
    15791586        combo_box = self.lstPoly.indexWidget(file_index) 
    1580         orig_index = combo_box.currentIndex() 
    15811587 
    15821588        def updateFunctionCaption(row): 
     
    15991605                return 
    16001606            except IOError: 
    1601                 combo_box.setCurrentIndex(orig_index) 
     1607                combo_box.setCurrentIndex(self.orig_poly_index) 
    16021608                # Pass for cancel/bad read 
    16031609                pass 
     
    16211627 
    16221628        self.iterateOverModel(updateFunctionCaption) 
     1629        self.orig_poly_index = combo_box.currentIndex() 
    16231630 
    16241631    def loadPolydispArray(self, row_index): 
Note: See TracChangeset for help on using the changeset viewer.