mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
add sigint handler
This commit is contained in:
parent
84914fabb9
commit
9231e79f08
1 changed files with 5 additions and 1 deletions
|
@ -3,7 +3,7 @@
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
|
|
||||||
import os, sys, re, types, gettext, stat, traceback, inspect
|
import os, sys, re, types, gettext, stat, traceback, inspect, signal
|
||||||
import shutil, time, glob, tempfile, datetime, zipfile, locale
|
import shutil, time, glob, tempfile, datetime, zipfile, locale
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
|
|
||||||
|
@ -94,6 +94,10 @@ class AnkiQt(QMainWindow):
|
||||||
if (self.deck and self.config['syncOnLoad'] and
|
if (self.deck and self.config['syncOnLoad'] and
|
||||||
self.deck.syncName):
|
self.deck.syncName):
|
||||||
self.syncDeck(interactive=False)
|
self.syncDeck(interactive=False)
|
||||||
|
signal.signal(signal.SIGINT, self.onSigInt)
|
||||||
|
|
||||||
|
def onSigInt(self, signum, frame):
|
||||||
|
self.close()
|
||||||
|
|
||||||
def setupMainWindow(self):
|
def setupMainWindow(self):
|
||||||
# main window
|
# main window
|
||||||
|
|
Loading…
Reference in a new issue