mailr28182 - /trunk/gui/relax_gui.py


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

Header


Content

Posted by tlinnet on April 02, 2016 - 15:46:
Author: tlinnet
Date: Sat Apr  2 15:46:09 2016
New Revision: 28182

URL: http://svn.gna.org/viewcvs/relax?rev=28182&view=rev
Log:
Adding a relax gui menu for changing the current working directory.

Modified:
    trunk/gui/relax_gui.py

Modified: trunk/gui/relax_gui.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/gui/relax_gui.py?rev=28182&r1=28181&r2=28182&view=diff
==============================================================================
--- trunk/gui/relax_gui.py      (original)
+++ trunk/gui/relax_gui.py      Sat Apr  2 15:46:09 2016
@@ -41,7 +41,7 @@
 from gui.spin_viewer.frame import Spin_view_window
 from gui.controller import Controller
 from gui.export_bmrb import Export_bmrb_window
-from gui.filedialog import RelaxFileDialog
+from gui.filedialog import RelaxDirDialog, RelaxFileDialog
 from gui.fonts import font
 from gui.icons import relax_icons
 from gui.interpreter import Interpreter
@@ -893,6 +893,37 @@
                 page.sync_ds(upload)
 
 
+    def system_cwd(self, event=None):
+        """Change the system current working directory.
+
+        @keyword event: The wx event.
+        @type event:    wx event
+        """
+
+        # The dialog.
+        dialog = RelaxDirDialog(parent=self, message="Select working 
directory", defaultPath=wx.EmptyString, style=wx.DD_CHANGE_DIR)
+
+        # Show the dialog and catch if no directory has been selected.
+        if status.show_gui and dialog.ShowModal() != wx.ID_OK:
+            # Don't do anything.
+            return
+
+        # Call the get_path function to get the directory name and change 
path.
+        path_name = dialog.get_path()
+
+        # Change the directory
+        try:
+            wx.BeginBusyCursor()
+
+            # Sleep a little so the user sees the busy cursor and knows that 
the directory changes has occurred.
+            sleep(1)
+
+        # Turn off the user feedback.
+        finally:
+            if wx.IsBusy():
+                wx.EndBusyCursor()
+
+
     def uf_call(self, event=None):
         """Catch the user function call to properly specify the parent 
window.
 




Related Messages


Powered by MHonArc, Updated Sat Apr 02 16:00:08 2016