Changeset 6063b16 in sasview


Ignore:
Timestamp:
Apr 15, 2009 2:30:19 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
60132ef
Parents:
998b6b8
Message:

remember the previous directory for save option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/local_perspectives/plotting/Plotter1D.py

    r7959f297 r6063b16  
    1111 
    1212import wx 
    13 import sys 
     13import sys, os 
    1414import pylab, time 
    1515 
     
    6565        ## Action IDs for internal call-backs 
    6666        self.action_ids = {} 
     67        ## Default locations 
     68        self._default_save_location = os.getcwd()         
    6769        ## Graph         
    6870        self.graph = Graph() 
     
    368370            datainfo= self.plots[self.graph.selected_plottable].info 
    369371            reader.write( path, datainfo) 
     372            
     373            try: 
     374                self._default_save_location = os.path.dirname(path) 
     375            except: 
     376                pass 
     377         
    370378        return  
    371379     
     
    407415                     
    408416            out.close()                  
    409                  
     417            try: 
     418                self._default_save_location = os.path.dirname(path) 
     419            except: 
     420                pass     
    410421                 
    411422    def _onSave(self, evt): 
     
    421432            wildcard = "Text files (*.txt)|*.txt|"\ 
    422433            "CanSAS 1D files(*.xml)|*.xml"  
    423             
    424             dlg = wx.FileDialog(self, "Choose a file", os.getcwd(), "",wildcard , wx.SAVE) 
     434            dlg = wx.FileDialog(self, "Choose a file", 
     435                                self._default_save_location, "",wildcard , wx.SAVE) 
    425436            
    426437            if dlg.ShowModal() == wx.ID_OK: 
     
    431442                if os.path.splitext(mypath)[1].lower() ==".xml": 
    432443                    self._onSaveXML(path) 
    433                   
     444             
    434445            dlg.Destroy() 
    435446             
Note: See TracChangeset for help on using the changeset viewer.