From ce79633eec74b6992dcb276fdd5122be2f015f6d Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Fri, 20 Nov 2015 13:43:19 -0800 Subject: [PATCH] "Stop sharing automatically" checkbox respected in GUI when toggled before the server is started (fixes #223) --- onionshare_gui/onionshare_gui.py | 2 +- onionshare_gui/options.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index dc33a5b2..d9d94f98 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -106,7 +106,7 @@ class OnionShareGui(QtGui.QWidget): self.downloads = Downloads() # options - self.options = Options(web) + self.options = Options(web, self.app) # status bar self.status_bar = QtGui.QStatusBar() diff --git a/onionshare_gui/options.py b/onionshare_gui/options.py index f3a91d29..176f1c34 100644 --- a/onionshare_gui/options.py +++ b/onionshare_gui/options.py @@ -27,10 +27,11 @@ class Options(QtGui.QHBoxLayout): """ The extra onionshare options in the GUI. """ - def __init__(self, web): + def __init__(self, web, app): super(Options, self).__init__() self.web = web + self.app = app # close automatically self.close_automatically = QtGui.QCheckBox() @@ -50,5 +51,7 @@ class Options(QtGui.QHBoxLayout): """ if state > 0: self.web.set_stay_open(False) + self.app.stay_open = False else: self.web.set_stay_open(True) + self.app.stay_open = True