From 629887e62587b252f7be33679a73413a2381627a Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Thu, 8 Feb 2018 11:53:56 +1100 Subject: [PATCH] Friendlier datetime format for the shutdown timer --- onionshare_gui/server_status.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index adf064fb..79fb4d67 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -51,10 +51,11 @@ class ServerStatus(QtWidgets.QWidget): self.shutdown_timeout_label = QtWidgets.QLabel(strings._('gui_settings_shutdown_timeout', True)) self.shutdown_timeout = QtWidgets.QDateTimeEdit() # Set proposed timeout to be 5 minutes into the future + self.shutdown_timeout.setDisplayFormat("HH:mm A MMM d, yy") self.shutdown_timeout.setDateTime(QtCore.QDateTime.currentDateTime().addSecs(300)) # Onion services can take a little while to start, so reduce the risk of it expiring too soon by setting the minimum to 2 min from now self.shutdown_timeout.setMinimumDateTime(QtCore.QDateTime.currentDateTime().addSecs(120)) - self.shutdown_timeout.setCurrentSectionIndex(4) + self.shutdown_timeout.setCurrentSection(QtWidgets.QDateTimeEdit.MinuteSection) shutdown_timeout_layout = QtWidgets.QHBoxLayout() shutdown_timeout_layout.addWidget(self.shutdown_timeout_label) shutdown_timeout_layout.addWidget(self.shutdown_timeout)