Changeset 1228007 in sasview


Ignore:
Timestamp:
Feb 17, 2017 3:25:42 AM (3 years ago)
Author:
wojciech
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:
8595edd
Parents:
6a9559d
Message:

Category and models selections are responosive now

File:
1 edited

Legend:

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

    rd84bc69 r1228007  
    2525        self.comboBox.addItems(cat_list) 
    2626        self.tableView.setModel(self._model_model) 
     27        self.comboBox.currentIndexChanged.connect(self.selectCategoryModels) 
    2728 
    28         model_list = self.master_category_dict['Cylinder'] 
     29        category = self.comboBox.currentText() 
     30 
     31        model_list = self.master_category_dict[str(category)] 
    2932        for (model, enabled) in model_list: 
    3033            self.comboBox_2.addItem(model) 
    31         self.setModelModel('barbell') 
     34 
     35        self.comboBox_2.currentIndexChanged.connect(self.selectModel) 
    3236 
    3337        self.pushButton.setEnabled(False) 
     
    4953            i = self.tableView_2.model().index(row,6) 
    5054            self.tableView_2.setIndexWidget(i,c) 
     55 
     56    def selectCategoryModels(self, index): 
     57        self.comboBox_2.clear() 
     58        category = self.comboBox.currentText() 
     59        model_list = self.master_category_dict[str(category)] 
     60        for (model, enabled) in model_list: 
     61            self.comboBox_2.addItem(model) 
     62 
     63    def selectModel(self, index): 
     64 
     65        model = self.comboBox_2.currentText() 
     66        self.setModelModel(model) 
    5167 
    5268    def _readCategoryInfo(self): 
     
    87103    def setModelModel(self, model_name): 
    88104        # Crete/overwrite model items 
    89  
     105        self._model_model.clear() 
    90106        model_name = str(model_name) 
    91107        kernel_module = generate.load_kernel_module(model_name) 
Note: See TracChangeset for help on using the changeset viewer.