Commit 9a2bc8bf8ce3a2f6582ee947d6d34cc4426995e8

Authored by Thiago Franco de Moraes
1 parent bea8019a
Exists in ff_mask

Closing the ffill dialog when getting out the ffill interaction style

Showing 1 changed file with 10 additions and 4 deletions   Show diff stats
invesalius/data/styles.py
@@ -1761,7 +1761,6 @@ class FFillConfig(object): @@ -1761,7 +1761,6 @@ class FFillConfig(object):
1761 1761
1762 1762
1763 class FloodFillMaskInteractorStyle(DefaultInteractorStyle): 1763 class FloodFillMaskInteractorStyle(DefaultInteractorStyle):
1764 - dialog = None  
1765 def __init__(self, viewer): 1764 def __init__(self, viewer):
1766 DefaultInteractorStyle.__init__(self, viewer) 1765 DefaultInteractorStyle.__init__(self, viewer)
1767 1766
@@ -1773,13 +1772,20 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): @@ -1773,13 +1772,20 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle):
1773 self.slice_data = viewer.slice_data 1772 self.slice_data = viewer.slice_data
1774 1773
1775 self.config = FFillConfig() 1774 self.config = FFillConfig()
  1775 + self.dlg_ffill = None
1776 1776
  1777 + self.AddObserver("LeftButtonPressEvent", self.OnFFClick)
  1778 +
  1779 + def SetUp(self):
1777 if not self.config.dlg_visible: 1780 if not self.config.dlg_visible:
1778 self.config.dlg_visible = True 1781 self.config.dlg_visible = True
1779 - dlg_ffill = dialogs.FFillOptionsDialog(self.config)  
1780 - dlg_ffill.Show() 1782 + self.dlg_ffill = dialogs.FFillOptionsDialog(self.config)
  1783 + self.dlg_ffill.Show()
1781 1784
1782 - self.AddObserver("LeftButtonPressEvent", self.OnFFClick) 1785 + def CleanUp(self):
  1786 + self.config.dlg_visible = False
  1787 + if self.dlg_ffill is not None:
  1788 + self.dlg_ffill.Destroy()
1783 1789
1784 def OnFFClick(self, obj, evt): 1790 def OnFFClick(self, obj, evt):
1785 if (self.viewer.slice_.buffer_slices[self.orientation].mask is None): 1791 if (self.viewer.slice_.buffer_slices[self.orientation].mask is None):