Changeset 464 for trunk/GSASIIIO.py


Ignore:
Timestamp:
Feb 1, 2012 10:45:14 AM (10 years ago)
Author:
vondreele
Message:

revamp directory behavior

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r457 r464  
    144144def GetInstrumentFile(self,filename):
    145145    import os.path as op
    146     dlg = wx.FileDialog(self,'Choose an instrument file','.', '', 'GSAS iparm file (*.prm)|*.prm|All files(*.*)|*.*', wx.OPEN)
    147     if self.dirname:
    148         dlg.SetDirectory(self.dirname)
    149         Tname = filename[:filename.index('.')]+'.prm'
    150         if op.exists(Tname):
    151             self.IparmName = Tname       
     146    dlg = wx.FileDialog(self,'Choose an instrument file','.', '', 'GSAS iparm file (*.prm)|*.prm|All files(*.*)|*.*',
     147        wx.OPEN|wx.CHANGE_DIR)
     148#    if self.dirname:
     149#        dlg.SetDirectory(self.dirname)
     150    Tname = filename[:filename.index('.')]+'.prm'
     151    if op.exists(Tname):
     152        self.IparmName = Tname       
    152153    if self.IparmName: dlg.SetFilename(self.IparmName)
    153154    filename = ''
     
    482483        GE Image (*.avg;*.sum)|*.avg;*.sum|\
    483484        ADSC Image (*.img)|*.img|\
    484         All files (*.*)|*.*',wx.OPEN)
    485         if self.dirname:
    486             dlg.SetDirectory(self.dirname)
     485        All files (*.*)|*.*',wx.OPEN|wx.CHANGE_DIR)
     486#        if self.dirname:
     487#            dlg.SetDirectory(self.dirname)
    487488        try:
    488489            dlg.SetFilename(ospath.split(imagefile)[1])
    489490            if dlg.ShowModal() == wx.ID_OK:
    490                 self.dirname = dlg.GetDirectory()
     491#                self.dirname = dlg.GetDirectory()
    491492                imagefile = dlg.GetPath()
    492493            else:
Note: See TracChangeset for help on using the changeset viewer.