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.setEnabled(True)
|
||||||
self.server_button.setText(strings._('gui_stop_server', True))
|
self.server_button.setText(strings._('gui_stop_server', True))
|
||||||
self.server_shutdown_timeout.setEnabled(False)
|
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:
|
else:
|
||||||
self.server_button.setEnabled(False)
|
self.server_button.setEnabled(False)
|
||||||
self.server_button.setText(strings._('gui_please_wait'))
|
self.server_button.setText(strings._('gui_please_wait'))
|
||||||
|
@ -179,6 +185,7 @@ class ServerStatus(QtWidgets.QVBoxLayout):
|
||||||
The server has finished starting.
|
The server has finished starting.
|
||||||
"""
|
"""
|
||||||
self.status = self.STATUS_STARTED
|
self.status = self.STATUS_STARTED
|
||||||
|
if self.server_shutdown_timeout_checkbox.isChecked():
|
||||||
# Convert the date value to seconds between now and then
|
# Convert the date value to seconds between now and then
|
||||||
now = QtCore.QDateTime.currentDateTime()
|
now = QtCore.QDateTime.currentDateTime()
|
||||||
self.timeout = now.secsTo(self.server_shutdown_timeout.dateTime())
|
self.timeout = now.secsTo(self.server_shutdown_timeout.dateTime())
|
||||||
|
|
Loading…
Reference in a new issue