Commit 8cbb2a515d6b9a0c9342a03f33d0829b5eb4de99

Authored by tfmoraes
1 parent 7c4e8934

ENH: When the user hides a mask the combobox in mask properties is cleaned its s…

…election so the user can select again the previous mask selected in the combobox
invesalius/data/slice_.py
... ... @@ -280,6 +280,8 @@ class Slice(object):
280 280 if self.current_mask:
281 281 index, value = pubsub_evt.data
282 282 self.ShowMask(index, value)
  283 + if not value:
  284 + Publisher.sendMessage('Select mask name in combo', -1)
283 285  
284 286 def edit_mask_pixel(self, operation, index, position, radius, orientation):
285 287 mask = self.buffer_slices[orientation].mask
... ...
invesalius/gui/task_slice.py
... ... @@ -396,7 +396,10 @@ class MaskProperties(wx.Panel):
396 396  
397 397 def SelectMaskName(self, pubsub_evt):
398 398 index = pubsub_evt.data
399   - self.combo_mask_name.SetSelection(index)
  399 + if index >= 0:
  400 + self.combo_mask_name.SetSelection(index)
  401 + else:
  402 + self.combo_mask_name.SetValue('')
400 403  
401 404 def ChangeMaskName(self, pubsub_evt):
402 405 index, name = pubsub_evt.data
... ...