2014-08-27 19:46:19 -04:00
|
|
|
from PyQt4 import QtCore, QtGui
|
|
|
|
|
|
|
|
import common
|
|
|
|
from onionshare import strings, helpers
|
|
|
|
|
|
|
|
class Options(QtGui.QHBoxLayout):
|
2014-08-28 02:52:56 -04:00
|
|
|
def __init__(self, web):
|
2014-08-27 19:46:19 -04:00
|
|
|
super(Options, self).__init__()
|
|
|
|
self.addSpacing(10)
|
2014-08-28 02:52:56 -04:00
|
|
|
|
|
|
|
self.web = web
|
2014-08-27 19:46:19 -04:00
|
|
|
|
|
|
|
# close automatically
|
|
|
|
self.close_automatically = QtGui.QCheckBox()
|
2014-08-28 02:52:56 -04:00
|
|
|
if self.web.stay_open:
|
2014-08-27 20:27:54 -04:00
|
|
|
self.close_automatically.setCheckState(QtCore.Qt.Unchecked)
|
|
|
|
else:
|
|
|
|
self.close_automatically.setCheckState(QtCore.Qt.Checked)
|
2014-08-27 19:46:19 -04:00
|
|
|
self.close_automatically.setText(strings._("close_on_finish"))
|
2014-08-28 02:52:56 -04:00
|
|
|
self.connect(self.close_automatically, QtCore.SIGNAL('stateChanged(int)'), self.stay_open_changed)
|
2014-08-27 19:46:19 -04:00
|
|
|
|
|
|
|
# add the widgets
|
|
|
|
self.addWidget(self.close_automatically)
|
|
|
|
|
2014-08-28 02:52:56 -04:00
|
|
|
def stay_open_changed(self, state):
|
|
|
|
if state > 0:
|
|
|
|
self.web.set_stay_open(False)
|
|
|
|
else:
|
|
|
|
self.web.set_stay_open(True)
|
|
|
|
|