mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-27 23:07:14 -05:00
comments
This commit is contained in:
parent
ae4b7ef8a5
commit
92ba6430e9
@ -209,6 +209,9 @@ class ZipWriter(object):
|
||||
self.z.close()
|
||||
|
||||
class close_after_seconds(threading.Thread):
|
||||
"""
|
||||
Background thread sleeps t hours and returns.
|
||||
"""
|
||||
def __init__(self, time):
|
||||
threading.Thread.__init__(self)
|
||||
self.setDaemon(True)
|
||||
|
@ -30,7 +30,6 @@ class Options(QtWidgets.QHBoxLayout):
|
||||
|
||||
self.web = web
|
||||
self.app = app
|
||||
self.hours = 0
|
||||
|
||||
# close automatically
|
||||
self.close_automatically = QtWidgets.QCheckBox()
|
||||
@ -65,12 +64,16 @@ class Options(QtWidgets.QHBoxLayout):
|
||||
self.app.stay_open = self.hours
|
||||
|
||||
def on_text_changed(self,state):
|
||||
h = self.timer_field.text()
|
||||
"""
|
||||
When the state of the QLineBox is altered, let the web app know.
|
||||
"""
|
||||
text = self.timer_field.text()
|
||||
h = text if text != "" else 999999 # if field empty, no bound to timer.
|
||||
try:
|
||||
self.hours = int(h)
|
||||
self.web.set_stay_open(self.hours)
|
||||
self.app.stay_open = self.hours
|
||||
self.app.t_cas = helpers.close_after_seconds(self.hours)
|
||||
hours = int(h)
|
||||
self.web.set_stay_open(hours)
|
||||
self.app.stay_open = hours
|
||||
self.app.t_cas = helpers.close_after_seconds(hours)
|
||||
except Exception:
|
||||
# warn input here
|
||||
print('Input restricted to positive integer values')
|
||||
|
Loading…
x
Reference in New Issue
Block a user