Merge branch 'mig5-dont_uncheck_timer_checkbox_on_stop'

This commit is contained in:
Micah Lee 2017-12-06 16:11:11 -08:00
commit 5bb885c6ec
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
2 changed files with 2 additions and 4 deletions

View file

@ -426,7 +426,6 @@ class OnionShareGui(QtWidgets.QMainWindow):
# close on finish?
if not web.get_stay_open():
self.server_status.stop_server()
self.server_status.shutdown_timeout_reset()
self.status_bar.showMessage(strings._('closing_automatically', True))
else:
if self.server_status.status == self.server_status.STATUS_STOPPED:
@ -449,7 +448,6 @@ class OnionShareGui(QtWidgets.QMainWindow):
if web.download_count == 0 or web.done:
self.server_status.stop_server()
self.status_bar.showMessage(strings._('close_on_timeout', True))
self.server_status.shutdown_timeout_reset()
# A download is probably still running - hold off on stopping the share
else:
self.status_bar.showMessage(strings._('timeout_download_still_running', True))

View file

@ -119,6 +119,7 @@ class ServerStatus(QtWidgets.QVBoxLayout):
"""
Reset the timeout in the UI after stopping a share
"""
self.server_shutdown_timeout_checkbox.setCheckState(QtCore.Qt.Unchecked)
self.server_shutdown_timeout.setDateTime(QtCore.QDateTime.currentDateTime().addSecs(300))
self.server_shutdown_timeout.setMinimumDateTime(QtCore.QDateTime.currentDateTime().addSecs(120))
@ -163,7 +164,6 @@ class ServerStatus(QtWidgets.QVBoxLayout):
self.server_button.setText(strings._('gui_start_server', True))
self.server_shutdown_timeout.setEnabled(True)
self.server_shutdown_timeout_checkbox.setEnabled(True)
self.server_shutdown_timeout_checkbox.setCheckState(QtCore.Qt.Unchecked)
elif self.status == self.STATUS_STARTED:
self.server_button.setEnabled(True)
self.server_button.setText(strings._('gui_stop_server', True))
@ -197,7 +197,6 @@ class ServerStatus(QtWidgets.QVBoxLayout):
self.start_server()
elif self.status == self.STATUS_STARTED:
self.stop_server()
self.shutdown_timeout_reset()
def start_server(self):
"""
@ -220,6 +219,7 @@ class ServerStatus(QtWidgets.QVBoxLayout):
Stop the server.
"""
self.status = self.STATUS_WORKING
self.shutdown_timeout_reset()
self.update()
self.server_stopped.emit()