diff --git a/fsl/utils/dialog.py b/fsl/utils/dialog.py index e31ee2ad2faacd1b9383792bf1d74c05599cced9..3228ae612c66842840d9742b7ea0185d22765b74 100644 --- a/fsl/utils/dialog.py +++ b/fsl/utils/dialog.py @@ -18,6 +18,7 @@ use throughout ``fslpy``. The available dialogs are: """ +import os import os.path as op import threading @@ -709,11 +710,14 @@ class FSLDirDialog(wx.Dialog): dlg = wx.DirDialog( self, message='Select the directory in which FSL is installed', - defaultPath=op.join('usr', 'local'), + defaultPath=op.join(os.sep, 'usr', 'local'), style=wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST) + # If the user cancels the file + # dialog, focus returns to the + # original 'Choose dir' / 'Skip' + # dialog. if dlg.ShowModal() != wx.ID_OK: - self.EndModal(wx.ID_CANCEL) return self.__fsldir = dlg.GetPath()