From 3d9bdedb8da47c53525998a487dccc8b6d67cf78 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Sun, 2 Sep 2012 18:51:15 +0200 Subject: [PATCH] Adds dialog to avoid hard exit while processing --- ivolution/gui/IvolutionWindow.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ivolution/gui/IvolutionWindow.py b/ivolution/gui/IvolutionWindow.py index 7330679..6a28edd 100644 --- a/ivolution/gui/IvolutionWindow.py +++ b/ivolution/gui/IvolutionWindow.py @@ -200,11 +200,16 @@ either expressed or implied, of the FreeBSD Project.""" """ # Clean up code for saving application state should be added here. self.my_logger.debug("Exit pressed") - self.console_logger.debug("Exit pressed") - self.notify(["Application", ["STOP"]]) # Asking the Facemovie to stop - self.process_running = False - #self.Close(True) # Close the frame. - sys.exit(0) + + if self.process_running == False: + sys.exit(0) + else: + # shows dialog asking to stop first. + dial = wx.MessageDialog(None, 'Cannot exit while processing! \n \ + Please press stop first.', + 'Exclamation', + wx.OK | wx.ICON_EXCLAMATION) + dial.ShowModal() # system methods def get_current_mode(self):