Changeset c994f8f in sasview


Ignore:
Timestamp:
Sep 5, 2011 9:43:17 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:
d72ef56
Parents:
902f373
Message:

added custom path saving by view setting

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/custom_config.py

    rcda8c34 rc994f8f  
    1010TOOLBAR_SHOW = False 
    1111DEFAULT_PERSPECTIVE = "Calculator" 
     12DEFAULT_OPEN_FOLDER = None 
  • sansguiframe/src/sans/guiframe/gui_manager.py

    r53cf669 rc994f8f  
    8383    # Didn't find local config, load the default  
    8484    import sans.guiframe.config as config 
     85custom_config = None 
    8586try: 
    8687    path = PATH_APP 
     
    118119    DEFAULT_PERSPECTIVE = custom_config.DEFAULT_PERSPECTIVE 
    119120    CLEANUP_PLOT = custom_config.CLEANUP_PLOT 
     121    # custom open_path 
     122    open_folder = custom_config.DEFAULT_OPEN_FOLDER 
     123    if open_folder != None and os.path.isdir(open_folder): 
     124        DEFAULT_OPEN_FOLDER = os.path.abspath(open_folder) 
     125    else: 
     126        DEFAULT_OPEN_FOLDER = PATH_APP 
    120127except: 
     128    raise 
    121129    DATALOADER_SHOW = True 
    122130    TOOLBAR_SHOW = True 
     
    129137    DEFAULT_PERSPECTIVE = None 
    130138    CLEANUP_PLOT = False 
     139    DEFAULT_OPEN_FOLDER = PATH_APP 
    131140 
    132141DEFAULT_STYLE = config.DEFAULT_STYLE 
     
    238247 
    239248        # Default locations 
    240         self._default_save_location = os.getcwd()         
    241          
     249        self._default_save_location = DEFAULT_OPEN_FOLDER        
    242250        # Welcome panel 
    243251        self.defaultPanel = None 
     
    15641572            error_message += str(sys.exc_value) + "\n" 
    15651573            print error_message 
    1566             
     1574        print "_default_save_location", self._default_save_location   
    15671575    def load_folder(self, path): 
    15681576        """ 
  • sansguiframe/src/sans/guiframe/startup_configuration.py

    r8c347a6 rc994f8f  
    2727                   'WELCOME_PANEL_SHOW':False, 
    2828                   'CLEANUP_PLOT':False, 
    29                    'DEFAULT_PERSPECTIVE':'Fitting'} 
     29                   'DEFAULT_PERSPECTIVE':'Fitting', 
     30                   'DEFAULT_OPEN_FOLDER': None} 
    3031try: 
    3132    CURRENT_STRINGS = {'GUIFRAME_WIDTH':CURRENT.GUIFRAME_WIDTH, 
     
    3839                       'WELCOME_PANEL_SHOW':CURRENT.WELCOME_PANEL_SHOW, 
    3940                       'CLEANUP_PLOT':CURRENT.CLEANUP_PLOT, 
    40                        'DEFAULT_PERSPECTIVE':CURRENT.DEFAULT_PERSPECTIVE} 
     41                       'DEFAULT_PERSPECTIVE':CURRENT.DEFAULT_PERSPECTIVE, 
     42                       'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER} 
    4143except: 
    4244    CURRENT_STRINGS = DEFAULT_STRINGS 
     
    6870        self.SetWindowVariant(variant=FONT_VARIANT) 
    6971        self.current_string = copy.deepcopy(CURRENT_STRINGS) 
    70         self.return_string = {} 
     72        self.return_string = copy.deepcopy(DEFAULT_STRINGS) 
    7173        # build layout 
    7274        panel = wx.Panel(self, -1) 
     
    160162                                        self.parent.cleanup_plots 
    161163            perspective = self.parent.get_current_perspective() 
    162             self.current_string['DEFAULT_PERSPECTIVE'] = str(perspective.sub_menu) 
     164            self.current_string['DEFAULT_PERSPECTIVE'] =\ 
     165                                            str(perspective.sub_menu) 
     166            location = '' 
     167            temp = self.parent._default_save_location.split("\\") 
     168            for strings in temp: 
     169                location += (strings + "/") 
     170            self.current_string['DEFAULT_OPEN_FOLDER'] = location 
     171                        #self.parent._default_save_location.ascii_letters 
    163172             
    164173        except: 
     
    199208        out_f.write("#Application appearance custom configuration\n" ) 
    200209        for key, item in strings.iteritems(): 
    201             if key == 'DEFAULT_PERSPECTIVE': 
    202                 out_f.write("%s = '%s'\n" % (key,str(item))) 
     210            if (key == 'DEFAULT_PERSPECTIVE') or \ 
     211                (key == 'DEFAULT_OPEN_FOLDER' and item != None): 
     212                out_f.write("%s = \"%s\"\n" % (key,str(item))) 
    203213            else: 
    204214                out_f.write("%s = %s\n" % (key,str(item))) 
  • sansview/custom_config.py

    rfa597990 rc994f8f  
    11#Application appearance custom configuration 
    22DATAPANEL_WIDTH = 235 
     3CLEANUP_PLOT = False 
    34FIXED_PANEL = True 
    45PLOPANEL_WIDTH = 415 
     
    67GUIFRAME_HEIGHT = 840 
    78GUIFRAME_WIDTH = 1150 
    8 CLEANUP_PLOT = False 
     9DEFAULT_OPEN_FOLDER = None 
    910WELCOME_PANEL_SHOW = False 
    1011TOOLBAR_SHOW = True 
    11 DEFAULT_PERSPECTIVE = 'Fitting' 
     12DEFAULT_PERSPECTIVE = "Fitting" 
Note: See TracChangeset for help on using the changeset viewer.