Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cancel in qt console closeevent should trigger event.ignore() #933

Closed
wants to merge 1 commit into from

3 participants

Jens Hedegaard Nielsen Min RK Evan Patterson
Jens Hedegaard Nielsen

When quitting ipython using for example the file quit option ipython quits even if you press cancel.
This pull request fixes that by inserting event.ignore() in the code the runs when cancel is pressed
and indenting the event.accept() so that it is only triggered when the yes button is pressed.

From the qt documentation and tutorials that I could find this seems to be the right way of using closeevent.

Min RK
Owner

makes sense.

Evan Patterson
Collaborator

I committed this without a merge, but GitHub hasn't clued in. Thanks for the fix!

Evan Patterson epatters closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 26, 2011
  1. Jens Hedegaard Nielsen
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 IPython/frontend/qt/console/mainwindow.py
4 IPython/frontend/qt/console/mainwindow.py
View
@@ -835,6 +835,7 @@ def closeEvent(self, event):
reply = okay
if reply == cancel:
+ event.ignore()
return
if reply == okay:
while self.tab_widget.count() >= 1:
@@ -842,6 +843,5 @@ def closeEvent(self, event):
widget = self.active_frontend
widget._confirm_exit = False
self.close_tab(widget)
-
- event.accept()
+ event.accept()
Something went wrong with that request. Please try again.