File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 3
3
Fixes
4
4
^^^^^
5
5
6
+ * fixed the " Cancel" button of the confirmation dialog when trying to quit the editor with unsaved modifications.
7
+ It was equivalent to discard, potentially leading to data loss.
8
+
6
9
* fixed (harmless) error messages appearing when trying to display any variable via the console when using
7
10
matplotlib 3.1+
Original file line number Diff line number Diff line change @@ -773,13 +773,14 @@ def _ask_to_save_if_unsaved_modifications(self):
773
773
return True
774
774
775
775
def closeEvent (self , event ):
776
+ # as per the example in the Qt doc (https://doc.qt.io/qt-5/qwidget.html#closeEvent), we should *NOT* call
777
+ # the closeEvent() method of the superclass in this case because all it does is "event.accept()"
778
+ # unconditionally which results in the application being closed regardless of what the user chooses (see #202).
776
779
if self ._ask_to_save_if_unsaved_modifications ():
780
+ self .save_widgets_state_and_geometry ()
777
781
event .accept ()
778
782
else :
779
783
event .ignore ()
780
- self .save_widgets_state_and_geometry ()
781
- AbstractEditor .closeEvent (self , event )
782
-
783
784
784
785
#########################################
785
786
# FILE MENU #
You can’t perform that action at this time.
0 commit comments