"Stop sharing automatically" checkbox respected in GUI when toggled before the server is started (fixes #223)

This commit is contained in:
Micah Lee 2015-11-20 13:43:19 -08:00
parent 76d65c678b
commit ce79633eec
2 changed files with 5 additions and 2 deletions

View File

@ -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()

View File

@ -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