Changeset 2657df9 in sasview for sansview/perspectives/fitting


Ignore:
Timestamp:
Apr 20, 2011 8:47:11 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
d38d0042
Parents:
2a62d5c
Message:

disabled right-click book mark when no data was set yet

Location:
sansview/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/basepage.py

    r1258aa3 r2657df9  
    148148                                 " Keep the panel status to recall it later") 
    149149        self.popUpMenu.AppendItem(self._keep) 
    150         self._keep.Enable(True) 
     150        self._keep.Enable(False) 
    151151        self._set_bookmark_flag(False) 
    152152        self._set_save_flag(False) 
     
    930930            return  
    931931        # set data, etc. from the state 
    932         self.set_data(state.data) 
     932        # reset page between theory and fitting from bookmarking 
     933        #if state.data == None: 
     934        #    data = None 
     935        #else: 
     936        data = state.data 
     937 
     938        #if data != None: 
     939         
     940        if data == None: 
     941            data_min = state.qmin 
     942            data_max = state.qmax 
     943            self.qmin_x = data_min 
     944            self.qmax_x = data_max 
     945            self.minimum_q.SetValue(str(data_min)) 
     946            self.maximum_q.SetValue(str(data_max)) 
     947            self.qmin.SetValue(str(data_min)) 
     948            self.qmax.SetValue(str(data_max)) 
     949 
     950            self.state.data = data 
     951            self.state.qmin = self.qmin_x 
     952            self.state.qmax = self.qmax_x 
     953        else: 
     954            self.set_data(data) 
     955             
    933956        self.enable2D= state.enable2D 
    934957        self.engine_type = state.engine_type 
     
    955978        #draw the pnael according to the new model parameter  
    956979        self._on_select_model(event=None) 
    957         
     980        # take care of 2D button 
     981        if data == None and self.model_view.IsEnabled(): 
     982            if self.enable2D: 
     983                self.model_view.SetLabel("Switch to 1D") 
     984            else: 
     985                self.model_view.SetLabel("Switch to 2D") 
     986        # else: 
     987                 
    958988        if self._manager !=None: 
    959989            self._manager._on_change_engine(engine=self.engine_type) 
  • sansview/perspectives/fitting/fitpage.py

    r1258aa3 r2657df9  
    10231023        if self.model is None: 
    10241024            self._set_bookmark_flag(False) 
     1025            self._keep.Enable(False) 
    10251026            self._set_save_flag(False) 
    10261027        self.enable_disp.SetValue(False) 
     
    10421043            if self.data != None: 
    10431044                self._set_bookmark_flag(True) 
     1045                self._keep.Enable(True) 
    10441046            #self._set_save_flag(True) 
    10451047            # Reset smearer, model and data 
     
    15821584            data_name = "" 
    15831585            self._set_bookmark_flag(False) 
     1586            self._keep.Enable(False) 
    15841587            self._set_save_flag(False) 
    15851588        else: 
    15861589            if self.model != None: 
    15871590                self._set_bookmark_flag(True) 
     1591                self._keep.Enable(True) 
    15881592            self._set_save_flag(True) 
    15891593            self._set_preview_flag(True) 
Note: See TracChangeset for help on using the changeset viewer.