Changeset d38d0042 in sasview for guiframe/gui_manager.py


Ignore:
Timestamp:
Apr 21, 2011 8:33:18 PM (13 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:
cefb3fb
Parents:
2657df9
Message:

open analysis now responds to the current analysis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/gui_manager.py

    r2a62d5c rd38d0042  
    12541254        if self._default_save_location == None: 
    12551255            self._default_save_location = os.getcwd() 
    1256   
     1256         
     1257        plug_wlist = self._on_open_state_app_helper() 
    12571258        dlg = wx.FileDialog(self,  
    12581259                            "Choose a file",  
    12591260                            self._default_save_location, "", 
    1260                              PLUGINS_WLIST) 
     1261                             plug_wlist) 
    12611262        if dlg.ShowModal() == wx.ID_OK: 
    12621263            path = dlg.GetPath() 
     
    12651266        dlg.Destroy() 
    12661267        self.load_state(path=path)   
    1267              
     1268     
     1269    def _on_open_state_app_helper(self): 
     1270        """ 
     1271        Helps '_on_open_state_application()' to find the extension of  
     1272        the current perspective/application 
     1273        """ 
     1274        # No current perspective or no extension attr 
     1275        if self._current_perspective is None: 
     1276            return PLUGINS_WLIST  
     1277        try: 
     1278            # Find the extension of the perspective and get that as 1st item in list 
     1279            ind = None 
     1280            app_ext = self._current_perspective._extensions 
     1281            plug_wlist = config.PLUGINS_WLIST 
     1282            for ext in set(plug_wlist): 
     1283                if ext.count(app_ext) > 0: 
     1284                    ind = ext 
     1285                    break 
     1286            # Found the extension 
     1287            if ind != None: 
     1288                plug_wlist.remove(ind) 
     1289                plug_wlist.insert(0, ind) 
     1290                try: 
     1291                    plug_wlist ='|'.join(plug_wlist) 
     1292                except: 
     1293                    plug_wlist = '' 
     1294        except: 
     1295            plug_wlist = PLUGINS_WLIST  
     1296             
     1297        return plug_wlist 
     1298     
    12681299    def _on_open_state_project(self, event): 
    12691300        """ 
     
    12721303        if self._default_save_location == None: 
    12731304            self._default_save_location = os.getcwd() 
    1274   
     1305         
    12751306        dlg = wx.FileDialog(self,  
    12761307                            "Choose a file",  
    12771308                            self._default_save_location, "", 
    12781309                             APPLICATION_WLIST) 
     1310        print dlg.GetFilterIndex() 
    12791311        if dlg.ShowModal() == wx.ID_OK: 
    12801312            path = dlg.GetPath() 
Note: See TracChangeset for help on using the changeset viewer.