close automatically checkbox respects --stay-open argument again

This commit is contained in:
Micah Lee 2014-08-27 17:27:54 -07:00
parent 49eac35196
commit 9cb1871b02
2 changed files with 6 additions and 3 deletions

View file

@ -48,7 +48,7 @@ class OnionShareGui(QtGui.QWidget):
downloads = Downloads() downloads = Downloads()
# options # options
options = Options() options = Options(web.stay_open)
# main layout # main layout
self.layout = QtGui.QVBoxLayout() self.layout = QtGui.QVBoxLayout()

View file

@ -4,12 +4,15 @@ import common
from onionshare import strings, helpers from onionshare import strings, helpers
class Options(QtGui.QHBoxLayout): class Options(QtGui.QHBoxLayout):
def __init__(self): def __init__(self, stay_open=False):
super(Options, self).__init__() super(Options, self).__init__()
self.addSpacing(10) self.addSpacing(10)
# close automatically # close automatically
self.close_automatically = QtGui.QCheckBox() self.close_automatically = QtGui.QCheckBox()
if stay_open:
self.close_automatically.setCheckState(QtCore.Qt.Unchecked)
else:
self.close_automatically.setCheckState(QtCore.Qt.Checked) self.close_automatically.setCheckState(QtCore.Qt.Checked)
self.close_automatically.setText(strings._("close_on_finish")) self.close_automatically.setText(strings._("close_on_finish"))