Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/fitting.py

    r86b049b r243fbc0  
    5656    ON_MAC = True 
    5757 
    58  
     58import bumps.options 
     59from bumps.gui.fit_dialog import show_fit_config 
     60try: 
     61    from bumps.gui.fit_dialog import EVT_FITTER_CHANGED 
     62except ImportError: 
     63    # CRUFT: bumps 0.7.5.8 and below 
     64    EVT_FITTER_CHANGED = None  # type: wx.PyCommandEvent 
    5965 
    6066class Plugin(PluginBase): 
     
    501507        self.parent.Bind(EVT_SLICER_PANEL, self._on_slicer_event) 
    502508        self.parent.Bind(EVT_SLICER_PARS_UPDATE, self._onEVT_SLICER_PANEL) 
     509 
     510        # CRUFT: EVT_FITTER_CHANGED is not None for bumps 0.7.5.9 and above 
     511        if EVT_FITTER_CHANGED is not None: 
     512            self.parent.Bind(EVT_FITTER_CHANGED, self.on_fitter_changed) 
     513        self._set_fitter_label(bumps.options.FIT_CONFIG) 
     514 
    503515        #self.parent._mgr.Bind(wx.aui.EVT_AUI_PANE_CLOSE,self._onclearslicer) 
    504516        #Create reader when fitting panel are created 
     
    763775        Open the bumps options panel. 
    764776        """ 
    765         try: 
    766             from bumps.gui.fit_dialog import show_fit_config 
    767             show_fit_config(self.parent, help=self.on_help) 
    768         except ImportError: 
    769             # CRUFT: Bumps 0.7.5.6 and earlier do not have the help button 
    770             from bumps.gui.fit_dialog import OpenFitOptions 
    771             OpenFitOptions() 
     777        show_fit_config(self.parent, help=self.on_help) 
     778 
     779    def on_fitter_changed(self, event): 
     780        self._set_fitter_label(event.config) 
     781 
     782    def _set_fitter_label(self, config): 
     783        self.fit_panel.parent.SetTitle(self.fit_panel.window_name 
     784                                       + " - Active Fitting Optimizer: " 
     785                                       + config.selected_name) 
    772786 
    773787    def on_help(self, algorithm_id): 
Note: See TracChangeset for help on using the changeset viewer.