Ignore:
Timestamp:
Aug 6, 2018 9:37:19 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:
060413c
Parents:
97df8a9
git-author:
wpotrzebowski <Wojciech.Potrzebowski@…> (10/27/17 04:35:49)
git-committer:
Piotr Rozyczko <rozyczko@…> (08/06/18 09:37:19)
Message:

New category manager design

File:
1 edited

Legend:

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

    r97df8a9 r3d18691  
    373373        self.cbCategory.addItem(CATEGORY_DEFAULT) 
    374374        self.cbCategory.addItems(category_list) 
    375         self.cbCategory.addItem(CATEGORY_STRUCTURE) 
     375        if CATEGORY_STRUCTURE not in category_list: 
     376            self.cbCategory.addItem(CATEGORY_STRUCTURE) 
    376377        self.cbCategory.setCurrentIndex(0) 
    377378 
     
    523524        self.communicate.copyFitParamsSignal.connect(self.onParameterCopy) 
    524525        self.communicate.pasteFitParamsSignal.connect(self.onParameterPaste) 
     526 
     527        # Communicator signal 
     528        self.communicate.updateModelCategoriesSignal.connect(self.onCategoriesChanged) 
    525529 
    526530    def modelName(self): 
     
    22482252        self.createNewIndex(residuals_plot) 
    22492253 
     2254    def onCategoriesChanged(self): 
     2255            """ 
     2256            Reload the category/model comboboxes 
     2257            """ 
     2258            # Store the current combo indices 
     2259            current_cat = self.cbCategory.currentText() 
     2260            current_model = self.cbModel.currentText() 
     2261 
     2262            # reread the category file and repopulate the combo 
     2263            self.cbCategory.blockSignals(True) 
     2264            self.cbCategory.clear() 
     2265            self.readCategoryInfo() 
     2266            self.initializeCategoryCombo() 
     2267 
     2268            # Scroll back to the original index in Categories 
     2269            new_index = self.cbCategory.findText(current_cat) 
     2270            if new_index != -1: 
     2271                self.cbCategory.setCurrentIndex(new_index) 
     2272            self.cbCategory.blockSignals(False) 
     2273            # ...and in the Models 
     2274            self.cbModel.blockSignals(True) 
     2275            new_index = self.cbModel.findText(current_model) 
     2276            if new_index != -1: 
     2277                self.cbModel.setCurrentIndex(new_index) 
     2278            self.cbModel.blockSignals(False) 
     2279 
     2280            return 
     2281 
    22502282    def calcException(self, etype, value, tb): 
    22512283        """ 
Note: See TracChangeset for help on using the changeset viewer.