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