Merge pull request #217 from effigies/ctrlq

Clean up and exit on Ctrl-Q
This commit is contained in:
Micah Lee 2015-11-08 12:52:12 -08:00
commit ecb8128f91

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):