From 8cbb2a515d6b9a0c9342a03f33d0829b5eb4de99 Mon Sep 17 00:00:00 2001 From: tfmoraes Date: Fri, 20 Apr 2012 13:39:24 +0000 Subject: [PATCH] ENH: When the user hides a mask the combobox in mask properties is cleaned its selection so the user can select again the previous mask selected in the combobox --- invesalius/data/slice_.py | 2 ++ invesalius/gui/task_slice.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 96e59b1..4d25bd2 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -280,6 +280,8 @@ class Slice(object): if self.current_mask: index, value = pubsub_evt.data self.ShowMask(index, value) + if not value: + Publisher.sendMessage('Select mask name in combo', -1) def edit_mask_pixel(self, operation, index, position, radius, orientation): mask = self.buffer_slices[orientation].mask diff --git a/invesalius/gui/task_slice.py b/invesalius/gui/task_slice.py index 7789937..b554700 100644 --- a/invesalius/gui/task_slice.py +++ b/invesalius/gui/task_slice.py @@ -396,7 +396,10 @@ class MaskProperties(wx.Panel): def SelectMaskName(self, pubsub_evt): index = pubsub_evt.data - self.combo_mask_name.SetSelection(index) + if index >= 0: + self.combo_mask_name.SetSelection(index) + else: + self.combo_mask_name.SetValue('') def ChangeMaskName(self, pubsub_evt): index, name = pubsub_evt.data -- libgit2 0.21.2