mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
make sure we save when main window closed while not focused
This commit is contained in:
parent
45ae2cbbfb
commit
6415474db4
1 changed files with 3 additions and 3 deletions
|
@ -604,12 +604,12 @@ upload, overwriting any changes either here or on AnkiWeb. Proceed?""")):
|
|||
def closeEvent(self, event):
|
||||
"User hit the X button, etc."
|
||||
event.accept()
|
||||
self.onClose()
|
||||
self.onClose(force=True)
|
||||
|
||||
def onClose(self):
|
||||
def onClose(self, force=False):
|
||||
"Called from a shortcut key. Close current active window."
|
||||
aw = self.app.activeWindow()
|
||||
if not aw or aw == self:
|
||||
if not aw or aw == self or force:
|
||||
self.unloadProfile(browser=False)
|
||||
self.app.closeAllWindows()
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue