From dbc48f9f7ab41779593a44c9b8cff6cc4bc3614d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 20 Jun 2012 09:55:30 +0900 Subject: [PATCH] on ctrl+c, abort db transaction and roll back --- aqt/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aqt/main.py b/aqt/main.py index 38faa0dd5..74cb85863 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -449,7 +449,12 @@ title="%s">%s''' % ( signal.signal(signal.SIGINT, self.onSigInt) def onSigInt(self, signum, frame): - self.onClose() + # interrupt any current transaction and schedule a rollback & quit + self.col.db.interrupt() + def quit(): + self.col.db.rollback() + self.close() + self.progress.timer(100, quit, False) def setupProgress(self): self.progress = aqt.progress.ProgressManager(self)