Commit 0eb985ed16713cc8f3c3b48970e545995b2af8eb
1 parent
993a095b
Exists in
master
and in
68 other branches
ENH: Inserted new mask dialog into appropriate module
Showing
1 changed file
with
20 additions
and
0 deletions
Show diff stats
invesalius/gui/dialogs.py
... | ... | @@ -336,6 +336,26 @@ def MaskSelectionRequiredForDuplication(): |
336 | 336 | dlg.ShowModal() |
337 | 337 | dlg.Destroy() |
338 | 338 | |
339 | + | |
340 | +def NewMask(): | |
341 | + import data.mask as mask | |
342 | + dlg = wx.TextEntryDialog(None, _('Name of new mask:'), | |
343 | + _('InVesalius 3 - New mask')) | |
344 | + | |
345 | + dlg.CenterOnScreen() | |
346 | + default_mask_name = const.MASK_NAME_PATTERN %(mask.Mask.general_index+2) | |
347 | + dlg.SetValue(default_mask_name) | |
348 | + | |
349 | + try: | |
350 | + op = dlg.ShowModal() == wx.ID_OK | |
351 | + except(wx._core.PyAssertionError): | |
352 | + print "win64 - wx._core.PyAssertionError" | |
353 | + op = True | |
354 | + | |
355 | + if op: | |
356 | + return dlg.GetValue() | |
357 | + return None | |
358 | + | |
339 | 359 | def InexistentPath(path): |
340 | 360 | msg = _("%s does not exist.")%(path) |
341 | 361 | if sys.platform == 'darwin': | ... | ... |