From 552c9eeb50b0d12b4e96f76a6178658046caf264 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 22 May 2017 16:19:44 -0700 Subject: [PATCH] Make systray exit action call OnionShareGui.close() instead of sys.exit(), to give OnionShare a chance to warn users of open servers, and to gracefully shut down --- onionshare_gui/onionshare_gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index cb84d747..caaf6fc5 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -149,7 +149,7 @@ class OnionShareGui(QtWidgets.QMainWindow): def _initSystemTray(self): menu = QtWidgets.QMenu() exitAction = menu.addAction(strings._('systray_menu_exit', True)) - exitAction.triggered.connect(sys.exit) + exitAction.triggered.connect(self.close) self.systemTray = QtWidgets.QSystemTrayIcon(self) self.systemTray.setIcon(QtGui.QIcon(common.get_resource_path('images/logo.png')))