Commit 801d52febe74f70d94b455cd96681b21fdbe3125

Authored by Paulo Henrique Junqueira Amorim
1 parent 8839f26c
Exists in master

Fixed problem that hide folder dialog from dicom and bitmap (uCT)

invesalius/control.py
@@ -158,7 +158,7 @@ class Controller(): @@ -158,7 +158,7 @@ class Controller():
158 Publisher.sendMessage("Set slice interaction style", const.STATE_DEFAULT) 158 Publisher.sendMessage("Set slice interaction style", const.STATE_DEFAULT)
159 159
160 # Import TIFF, BMP, JPEG or PNG 160 # Import TIFF, BMP, JPEG or PNG
161 - dirpath = dialog.ShowImportBitmapDirDialog() 161 + dirpath = dialog.ShowImportBitmapDirDialog(self.frame)
162 162
163 if dirpath and not os.listdir(dirpath): 163 if dirpath and not os.listdir(dirpath):
164 dialog.ImportEmptyDirectory(dirpath) 164 dialog.ImportEmptyDirectory(dirpath)
@@ -181,7 +181,7 @@ class Controller(): @@ -181,7 +181,7 @@ class Controller():
181 Publisher.sendMessage("Stop Config Recording") 181 Publisher.sendMessage("Stop Config Recording")
182 Publisher.sendMessage("Set slice interaction style", const.STATE_DEFAULT) 182 Publisher.sendMessage("Set slice interaction style", const.STATE_DEFAULT)
183 # Import project 183 # Import project
184 - dirpath = dialog.ShowImportDirDialog() 184 + dirpath = dialog.ShowImportDirDialog(self.frame)
185 if dirpath and not os.listdir(dirpath): 185 if dirpath and not os.listdir(dirpath):
186 dialog.ImportEmptyDirectory(dirpath) 186 dialog.ImportEmptyDirectory(dirpath)
187 elif dirpath: 187 elif dirpath:
invesalius/gui/dialogs.py
@@ -259,7 +259,7 @@ def ShowOpenProjectDialog(): @@ -259,7 +259,7 @@ def ShowOpenProjectDialog():
259 return filepath 259 return filepath
260 260
261 261
262 -def ShowImportDirDialog(): 262 +def ShowImportDirDialog(self):
263 current_dir = os.path.abspath(".") 263 current_dir = os.path.abspath(".")
264 264
265 if (sys.platform == 'win32') or (sys.platform == 'linux2'): 265 if (sys.platform == 'win32') or (sys.platform == 'linux2'):
@@ -272,7 +272,7 @@ def ShowImportDirDialog(): @@ -272,7 +272,7 @@ def ShowImportDirDialog():
272 else: 272 else:
273 folder = '' 273 folder = ''
274 274
275 - dlg = wx.DirDialog(None, _("Choose a DICOM folder:"), folder, 275 + dlg = wx.DirDialog(self, _("Choose a DICOM folder:"), folder,
276 style=wx.DD_DEFAULT_STYLE 276 style=wx.DD_DEFAULT_STYLE
277 | wx.DD_DIR_MUST_EXIST 277 | wx.DD_DIR_MUST_EXIST
278 | wx.DD_CHANGE_DIR) 278 | wx.DD_CHANGE_DIR)
@@ -300,7 +300,7 @@ def ShowImportDirDialog(): @@ -300,7 +300,7 @@ def ShowImportDirDialog():
300 os.chdir(current_dir) 300 os.chdir(current_dir)
301 return path 301 return path
302 302
303 -def ShowImportBitmapDirDialog(): 303 +def ShowImportBitmapDirDialog(self):
304 current_dir = os.path.abspath(".") 304 current_dir = os.path.abspath(".")
305 305
306 if (sys.platform == 'win32') or (sys.platform == 'linux2'): 306 if (sys.platform == 'win32') or (sys.platform == 'linux2'):
@@ -313,7 +313,7 @@ def ShowImportBitmapDirDialog(): @@ -313,7 +313,7 @@ def ShowImportBitmapDirDialog():
313 else: 313 else:
314 folder = '' 314 folder = ''
315 315
316 - dlg = wx.DirDialog(None, _("Choose a folder with TIFF, BMP, JPG or PNG:"), folder, 316 + dlg = wx.DirDialog(self, _("Choose a folder with TIFF, BMP, JPG or PNG:"), folder,
317 style=wx.DD_DEFAULT_STYLE 317 style=wx.DD_DEFAULT_STYLE
318 | wx.DD_DIR_MUST_EXIST 318 | wx.DD_DIR_MUST_EXIST
319 | wx.DD_CHANGE_DIR) 319 | wx.DD_CHANGE_DIR)