Commit 2f7aeff121f95c4ab870e0a7d0cb10800c2bb931

Authored by Thiago Franco de Moraes
1 parent 27fc72c2

When there isn't a mask the task slice is disabled

Showing 1 changed file with 7 additions and 0 deletions   Show diff stats
invesalius/gui/task_slice.py
@@ -399,6 +399,11 @@ class MaskProperties(wx.Panel): @@ -399,6 +399,11 @@ class MaskProperties(wx.Panel):
399 for i in list_index: 399 for i in list_index:
400 self.combo_mask_name.Delete(i) 400 self.combo_mask_name.Delete(i)
401 401
  402 + if self.combo_mask_name.IsEmpty():
  403 + self.combo_mask_name.SetValue('')
  404 + self.Disable()
  405 +
  406 +
402 def __bind_events_wx(self): 407 def __bind_events_wx(self):
403 self.Bind(grad.EVT_THRESHOLD_CHANGED, self.OnSlideChanged, self.gradient) 408 self.Bind(grad.EVT_THRESHOLD_CHANGED, self.OnSlideChanged, self.gradient)
404 self.Bind(grad.EVT_THRESHOLD_CHANGING, self.OnSlideChanging, self.gradient) 409 self.Bind(grad.EVT_THRESHOLD_CHANGING, self.OnSlideChanging, self.gradient)
@@ -454,6 +459,8 @@ class MaskProperties(wx.Panel): @@ -454,6 +459,8 @@ class MaskProperties(wx.Panel):
454 self.button_colour.SetColour(colour) 459 self.button_colour.SetColour(colour)
455 460
456 def AddMask(self, evt_pubsub): 461 def AddMask(self, evt_pubsub):
  462 + if self.combo_mask_name.IsEmpty():
  463 + self.Enable()
457 mask_name = evt_pubsub.data[1] 464 mask_name = evt_pubsub.data[1]
458 mask_thresh = evt_pubsub.data[2] 465 mask_thresh = evt_pubsub.data[2]
459 mask_colour = [int(c*255) for c in evt_pubsub.data[3]] 466 mask_colour = [int(c*255) for c in evt_pubsub.data[3]]