Commit dba9e5a4ddd8496d057d5211a7afd0deed07ee51

Authored by tatiana
1 parent a95df161

FIX: Close project/ Exit InVesalius under darwin (needs testing)

invesalius/control.py
@@ -169,7 +169,6 @@ class Controller(): @@ -169,7 +169,6 @@ class Controller():
169 ps.Publisher().sendMessage("Enable state project", False) 169 ps.Publisher().sendMessage("Enable state project", False)
170 ps.Publisher().sendMessage('Set project name') 170 ps.Publisher().sendMessage('Set project name')
171 ps.Publisher().sendMessage("Stop Config Recording") 171 ps.Publisher().sendMessage("Stop Config Recording")
172 - ps.Publisher().sendMessage('Close Window')  
173 elif answer == 1: 172 elif answer == 1:
174 self.ShowDialogSaveProject() 173 self.ShowDialogSaveProject()
175 debug("Save changes and close") 174 debug("Save changes and close")
@@ -177,7 +176,6 @@ class Controller(): @@ -177,7 +176,6 @@ class Controller():
177 ps.Publisher().sendMessage("Enable state project", False) 176 ps.Publisher().sendMessage("Enable state project", False)
178 ps.Publisher().sendMessage('Set project name') 177 ps.Publisher().sendMessage('Set project name')
179 ps.Publisher().sendMessage("Stop Config Recording") 178 ps.Publisher().sendMessage("Stop Config Recording")
180 - ps.Publisher().sendMessage('Close Window')  
181 179
182 elif answer == -1: 180 elif answer == -1:
183 debug("Cancel") 181 debug("Cancel")
@@ -186,11 +184,9 @@ class Controller(): @@ -186,11 +184,9 @@ class Controller():
186 ps.Publisher().sendMessage("Enable state project", False) 184 ps.Publisher().sendMessage("Enable state project", False)
187 ps.Publisher().sendMessage('Set project name') 185 ps.Publisher().sendMessage('Set project name')
188 ps.Publisher().sendMessage("Stop Config Recording") 186 ps.Publisher().sendMessage("Stop Config Recording")
189 - ps.Publisher().sendMessage('Close Window')  
190 187
191 else: 188 else:
192 ps.Publisher().sendMessage('Stop Config Recording') 189 ps.Publisher().sendMessage('Stop Config Recording')
193 - ps.Publisher().sendMessage('Close Window')  
194 190
195 191
196 ########################### 192 ###########################
invesalius/gui/frame.py
@@ -78,7 +78,6 @@ class Frame(wx.Frame): @@ -78,7 +78,6 @@ class Frame(wx.Frame):
78 sub = ps.Publisher().subscribe 78 sub = ps.Publisher().subscribe
79 sub(self._BeginBusyCursor, 'Begin busy cursor') 79 sub(self._BeginBusyCursor, 'Begin busy cursor')
80 sub(self._ShowContentPanel, 'Cancel DICOM load') 80 sub(self._ShowContentPanel, 'Cancel DICOM load')
81 - sub(self._Exit, 'Close Window')  
82 sub(self._EndBusyCursor, 'End busy cursor') 81 sub(self._EndBusyCursor, 'End busy cursor')
83 sub(self._HideContentPanel, 'Hide content panel') 82 sub(self._HideContentPanel, 'Hide content panel')
84 sub(self._HideImportPanel, 'Hide import panel') 83 sub(self._HideImportPanel, 'Hide import panel')
@@ -189,7 +188,7 @@ class Frame(wx.Frame): @@ -189,7 +188,7 @@ class Frame(wx.Frame):
189 #no matching wxBeginBusyCursor() for wxEndBusyCursor() 188 #no matching wxBeginBusyCursor() for wxEndBusyCursor()
190 pass 189 pass
191 190
192 - def _Exit(self, pubsub_evt): 191 + def _Exit(self):
193 """ 192 """
194 Exit InVesalius. 193 Exit InVesalius.
195 """ 194 """
@@ -276,6 +275,7 @@ class Frame(wx.Frame): @@ -276,6 +275,7 @@ class Frame(wx.Frame):
276 Close all project data. 275 Close all project data.
277 """ 276 """
278 ps.Publisher().sendMessage('Close Project') 277 ps.Publisher().sendMessage('Close Project')
  278 + self._Exit()
279 279
280 def OnMenuClick(self, evt): 280 def OnMenuClick(self, evt):
281 """ 281 """