Commit 8cbb2a515d6b9a0c9342a03f33d0829b5eb4de99
1 parent
7c4e8934
Exists in
master
and in
67 other branches
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
Showing
2 changed files
with
6 additions
and
1 deletions
Show diff stats
invesalius/data/slice_.py
@@ -280,6 +280,8 @@ class Slice(object): | @@ -280,6 +280,8 @@ class Slice(object): | ||
280 | if self.current_mask: | 280 | if self.current_mask: |
281 | index, value = pubsub_evt.data | 281 | index, value = pubsub_evt.data |
282 | self.ShowMask(index, value) | 282 | self.ShowMask(index, value) |
283 | + if not value: | ||
284 | + Publisher.sendMessage('Select mask name in combo', -1) | ||
283 | 285 | ||
284 | def edit_mask_pixel(self, operation, index, position, radius, orientation): | 286 | def edit_mask_pixel(self, operation, index, position, radius, orientation): |
285 | mask = self.buffer_slices[orientation].mask | 287 | mask = self.buffer_slices[orientation].mask |
invesalius/gui/task_slice.py
@@ -396,7 +396,10 @@ class MaskProperties(wx.Panel): | @@ -396,7 +396,10 @@ class MaskProperties(wx.Panel): | ||
396 | 396 | ||
397 | def SelectMaskName(self, pubsub_evt): | 397 | def SelectMaskName(self, pubsub_evt): |
398 | index = pubsub_evt.data | 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 | def ChangeMaskName(self, pubsub_evt): | 404 | def ChangeMaskName(self, pubsub_evt): |
402 | index, name = pubsub_evt.data | 405 | index, name = pubsub_evt.data |