Commit 83dd4c0b authored by Guillaume Seguin's avatar Guillaume Seguin

Move exit dialog to kill() (#597)

parent 7dbcea77
...@@ -325,14 +325,13 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -325,14 +325,13 @@ class PronterWindow(MainWindow, pronsole.pronsole):
event.Skip() event.Skip()
def on_exit(self, event): def on_exit(self, event):
# prevent unwanted exit
if(self.p.printing | self.p.paused):
dlg = wx.MessageDialog(self, _("Print in progress ! Are you really sure you want to quit ?"), _("Exit"), wx.YES_NO | wx.ICON_WARNING)
if dlg.ShowModal() == wx.ID_NO:
return
self.Close() self.Close()
def kill(self, e): def kill(self, e):
if self.p.printing or self.p.paused:
dlg = wx.MessageDialog(self, _("Print in progress ! Are you really sure you want to quit ?"), _("Exit"), wx.YES_NO | wx.ICON_WARNING)
if dlg.ShowModal() == wx.ID_NO:
return
pronsole.pronsole.kill(self) pronsole.pronsole.kill(self)
global pronterface_quitting global pronterface_quitting
pronterface_quitting = True pronterface_quitting = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment