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:
Miguel Jacq 2017-11-09 11:46:26 +11:00
parent 9657df282e
commit d49e7cf1d1
No known key found for this signature in database
GPG key ID: EEA4341C6D97A0B6

View file

@ -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())