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()
# options
options = Options()
options = Options(web.stay_open)
# main layout
self.layout = QtGui.QVBoxLayout()

View File

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