From 96d2a541a668b5f484916b3ef916278877fe7d0b Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Tue, 11 Apr 2017 10:28:18 -0300 Subject: [PATCH] About dialog working again --- invesalius/data/slice_.py | 10 ++++++---- invesalius/gui/dialogs.py | 11 ++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index af70f59..b6e41c6 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -267,10 +267,12 @@ class Slice(object): self.CloseProject() def CloseProject(self): - f = self._matrix.filename - self._matrix._mmap.close() - self._matrix = None - os.remove(f) + if self._matrix is not None: + f = self._matrix.filename + self._matrix._mmap.close() + self._matrix = None + os.remove(f) + self.current_mask = None for name in self.aux_matrices: diff --git a/invesalius/gui/dialogs.py b/invesalius/gui/dialogs.py index c31068d..2a95bc6 100644 --- a/invesalius/gui/dialogs.py +++ b/invesalius/gui/dialogs.py @@ -1059,8 +1059,10 @@ def SaveChangesDialog2(filename): def ShowAboutDialog(parent): - - info = wx.AboutDialogInfo() + try: + info = wx.adv.AboutDialogInfo() + except AttributeError: + info = wx.AboutDialogInfo() info.Name = "InVesalius" info.Version = "3.1" info.Copyright = _("(c) 2007-2017 Center for Information Technology Renato Archer - CTI") @@ -1107,7 +1109,10 @@ def ShowAboutDialog(parent): info.Artists = ["Otavio Henrique Junqueira Amorim"] # Then we call wx.AboutBox providing its info object - wx.AboutBox(info) + try: + wx.adv.AboutBox(info) + except AttributeError: + wx.AboutBox(info) def ShowSavePresetDialog(default_filename="raycasting"): -- libgit2 0.21.2