From bddb9596d19a92598418476774e41cac9ad7b9cd Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Wed, 6 Dec 2017 10:02:22 +1100 Subject: [PATCH 1/2] Don't uncheck the auto-stop timer when the server stops (adding new files before starting the share will otherwise uncheck it) --- onionshare_gui/server_status.py | 1 - 1 file changed, 1 deletion(-) diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index e0a944e3..4e05bf22 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -163,7 +163,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)) From d5000693985cd18c3c0566099b33097d3fd085a6 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Wed, 6 Dec 2017 10:21:39 +1100 Subject: [PATCH 2/2] Actually still uncheck the timer when the server stops, but *only* when it stops --- onionshare_gui/onionshare_gui.py | 2 -- onionshare_gui/server_status.py | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index fd278394..8c354eeb 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -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)) diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index 4e05bf22..48bffdca 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -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)) @@ -196,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): """ @@ -219,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()