mailr14573 - /1.3/gui/filedialog.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on September 02, 2011 - 11:55:
Author: bugman
Date: Fri Sep  2 11:55:57 2011
New Revision: 14573

URL: http://svn.gna.org/viewcvs/relax?rev=14573&view=rev
Log:
The RelaxFileDialog object now changes the working directory as the user 
changes directories.


Modified:
    1.3/gui/filedialog.py

Modified: 1.3/gui/filedialog.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/filedialog.py?rev=14573&r1=14572&r2=14573&view=diff
==============================================================================
--- 1.3/gui/filedialog.py (original)
+++ 1.3/gui/filedialog.py Fri Sep  2 11:55:57 2011
@@ -75,6 +75,10 @@
         self.field = field
         self.style = style
 
+        # No directory supplied, so use the current working directory.
+        if defaultDir == wx.EmptyString:
+            defaultDir = getcwd()
+
         # Initialise the base class.
         super(RelaxFileDialog, self).__init__(parent, message=message, 
defaultDir=defaultDir, defaultFile=defaultFile, wildcard=wildcard, 
style=style, pos=pos)
 
@@ -86,11 +90,16 @@
         @rtype:         str or list of str
         """
 
-        # The file(s).
+        # The multiple files.
         if self.style in [wx.FD_OPEN|wx.FD_MULTIPLE, 
wx.FD_SAVE|wx.FD_MULTIPLE]:
             file = self.GetPaths()
+
+        # The single file.
         else:
             file = self.GetPath()
+
+        # Change the current working directory.
+        chdir(self.GetDirectory())
 
         # Return the file.
         return file




Related Messages


Powered by MHonArc, Updated Fri Sep 02 12:20:02 2011