mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-11 04:02:40 -03:00
more UI fixes - hide checkbox if server is working/started and it was not checked. Ensure we only set the timer if the timeout checkbox was checked to begin with
This commit is contained in:
parent
9657df282e
commit
d49e7cf1d1
1 changed files with 14 additions and 7 deletions
|
@ -152,6 +152,12 @@ class ServerStatus(QtWidgets.QVBoxLayout):
|
|||
self.server_button.setEnabled(True)
|
||||
self.server_button.setText(strings._('gui_stop_server', True))
|
||||
self.server_shutdown_timeout.setEnabled(False)
|
||||
self.server_shutdown_timeout_checkbox.hide()
|
||||
elif self.status == self.STATUS_WORKING:
|
||||
self.server_button.setEnabled(False)
|
||||
self.server_button.setText(strings._('gui_please_wait'))
|
||||
self.server_shutdown_timeout.setEnabled(False)
|
||||
self.server_shutdown_timeout_checkbox.hide()
|
||||
else:
|
||||
self.server_button.setEnabled(False)
|
||||
self.server_button.setText(strings._('gui_please_wait'))
|
||||
|
@ -179,13 +185,14 @@ class ServerStatus(QtWidgets.QVBoxLayout):
|
|||
The server has finished starting.
|
||||
"""
|
||||
self.status = self.STATUS_STARTED
|
||||
# Convert the date value to seconds between now and then
|
||||
now = QtCore.QDateTime.currentDateTime()
|
||||
self.timeout = now.secsTo(self.server_shutdown_timeout.dateTime())
|
||||
# Set the shutdown timeout value
|
||||
if self.timeout > 0:
|
||||
self.app.shutdown_timer = common.close_after_seconds(self.timeout)
|
||||
self.app.shutdown_timer.start()
|
||||
if self.server_shutdown_timeout_checkbox.isChecked():
|
||||
# Convert the date value to seconds between now and then
|
||||
now = QtCore.QDateTime.currentDateTime()
|
||||
self.timeout = now.secsTo(self.server_shutdown_timeout.dateTime())
|
||||
# Set the shutdown timeout value
|
||||
if self.timeout > 0:
|
||||
self.app.shutdown_timer = common.close_after_seconds(self.timeout)
|
||||
self.app.shutdown_timer.start()
|
||||
self.copy_url()
|
||||
self.update()
|
||||
|
||||
|
|
Loading…
Reference in a new issue