mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
on ctrl+c, abort db transaction and roll back
This commit is contained in:
parent
3e84c03c1e
commit
dbc48f9f7a
1 changed files with 6 additions and 1 deletions
|
@ -449,7 +449,12 @@ title="%s">%s</button>''' % (
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue