Changes in src/sas/qtgui/Perspectives/Fitting/FittingWidget.py [97df8a9:060413c] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r97df8a9 r060413c 373 373 self.cbCategory.addItem(CATEGORY_DEFAULT) 374 374 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) 376 377 self.cbCategory.setCurrentIndex(0) 377 378 … … 523 524 self.communicate.copyFitParamsSignal.connect(self.onParameterCopy) 524 525 self.communicate.pasteFitParamsSignal.connect(self.onParameterPaste) 526 527 # Communicator signal 528 self.communicate.updateModelCategoriesSignal.connect(self.onCategoriesChanged) 525 529 526 530 def modelName(self): … … 1931 1935 # custom kernel load requires full path 1932 1936 name = os.path.join(ModelUtilities.find_plugins_dir(), model_name+".py") 1933 kernel_module = generate.load_kernel_module(name) 1937 try: 1938 kernel_module = generate.load_kernel_module(name) 1939 except ModuleNotFoundError: 1940 # maybe it's a recategorised custom model? 1941 name = os.path.join(ModelUtilities.find_plugins_dir(), model_name+".py") 1942 # If this rises, it's a valid problem. 1943 kernel_module = generate.load_kernel_module(name) 1934 1944 1935 1945 if hasattr(kernel_module, 'parameters'): … … 2248 2258 self.createNewIndex(residuals_plot) 2249 2259 2260 def onCategoriesChanged(self): 2261 """ 2262 Reload the category/model comboboxes 2263 """ 2264 # Store the current combo indices 2265 current_cat = self.cbCategory.currentText() 2266 current_model = self.cbModel.currentText() 2267 2268 # reread the category file and repopulate the combo 2269 self.cbCategory.blockSignals(True) 2270 self.cbCategory.clear() 2271 self.readCategoryInfo() 2272 self.initializeCategoryCombo() 2273 2274 # Scroll back to the original index in Categories 2275 new_index = self.cbCategory.findText(current_cat) 2276 if new_index != -1: 2277 self.cbCategory.setCurrentIndex(new_index) 2278 self.cbCategory.blockSignals(False) 2279 # ...and in the Models 2280 self.cbModel.blockSignals(True) 2281 new_index = self.cbModel.findText(current_model) 2282 if new_index != -1: 2283 self.cbModel.setCurrentIndex(new_index) 2284 self.cbModel.blockSignals(False) 2285 2286 return 2287 2250 2288 def calcException(self, etype, value, tb): 2251 2289 """
Note: See TracChangeset
for help on using the changeset viewer.