Changeset 04295ea in sasview for invariantview


Ignore:
Timestamp:
Apr 22, 2011 11:29:20 AM (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:
270e240
Parents:
cefb3fb
Message:

This fixes the problems w/ status file open/close

Location:
invariantview/perspectives/invariant
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • invariantview/perspectives/invariant/invariant.py

    rcefb3fb r04295ea  
    233233                msg += " be None in standalone mode" 
    234234                raise RuntimeError, msg 
    235              
     235            # Make sure the user sees the invariant panel after loading 
     236            #self.parent.set_perspective(self.perspective) 
     237            self.on_perspective(event=None) 
    236238            name = data.meta_data['invstate'].file 
    237239            data.meta_data['invstate'].file = name 
    238240            data.name = name 
    239241            data.filename = name 
     242 
    240243            data = self.parent.create_gui_data(data,None) 
    241244            self.__data = data 
     
    247250            self.invariant_panel.is_state_data = True 
    248251             
    249             # Make sure the user sees the invariant panel after loading 
    250             #self.parent.set_perspective(self.perspective) 
    251             self.on_perspective(event=None) 
    252252            # Load the invariant states 
    253             temp_state0 = self.invariant_panel.state.state_list['0'] 
    254253            self.temp_state = state 
    255  
    256             self.invariant_panel.set_state(state=self.temp_state,data=self.__data)  
    257             # Must reset the 1st state using the state from file         
    258             self.invariant_panel.state.state_list['0'] = temp_state0 
     254            # Requires to have self.__data and self.temp_state  first. 
     255            self.on_set_state_helper(None) 
     256 
    259257        except:  
    260258            logging.error("invariant.set_state: %s" % sys.exc_value) 
  • invariantview/perspectives/invariant/invariant_panel.py

    rcefb3fb r04295ea  
    169169        set state when loading it from a .inv/.svs file 
    170170        """ 
     171         
    171172        if state == None and data == None: 
    172173            self.state = IState() 
    173174        elif state == None or data == None: return 
    174175        else: 
     176            new_state = copy.deepcopy(state) 
    175177            self.new_state = True 
    176178            if not self.set_data(data): 
    177179                return 
    178             self.state = state  
     180 
     181            self.state = new_state  
    179182            self.state.file = data.name    
    180183 
     
    188191            self.bookmark_num = len(self.state.bookmark_list) 
    189192            total_bookmark_num = self.bookmark_num + 1 
     193 
    190194            for ind in range(1,total_bookmark_num): 
    191195                #bookmark_num = ind 
     
    196200                self.popUpMenu.Append(id,name,str('')) 
    197201                wx.EVT_MENU(self, id, self._back_to_bookmark)  
    198  
    199202                wx.PostEvent(self.parent, AppendBookmarkEvent(title=name,  
    200203                                          hint='', 
Note: See TracChangeset for help on using the changeset viewer.