Clean up and exit on Ctrl-Q

This commit is contained in:
Christopher J. Markiewicz 2015-11-06 20:43:37 -05:00
parent d50601f5bd
commit 89c363d247

View File

@ -42,6 +42,14 @@ class Application(QtGui.QApplication):
if platform == 'Tails' or platform == 'Linux':
self.setAttribute(QtCore.Qt.AA_X11InitThreads, True)
QtGui.QApplication.__init__(self, sys.argv)
self.installEventFilter(self)
def eventFilter(self, obj, event):
if (event.type() == QtCore.QEvent.KeyPress and
event.key() == QtCore.Qt.Key_Q and
event.modifiers() == QtCore.Qt.ControlModifier):
self.quit()
return False
class OnionShareGui(QtGui.QWidget):