Standardise all shutdown_timer, shutdown_timeout, timeout attributes as 'autostop_timer'

This commit is contained in:
Miguel Jacq 2019-03-25 15:05:54 +11:00
parent f6f5ff0b7e
commit a4c8865dcd
65 changed files with 573 additions and 573 deletions

View file

@ -88,28 +88,28 @@ class SettingsDialog(QtWidgets.QDialog):
self.startup_timer_widget = QtWidgets.QWidget()
self.startup_timer_widget.setLayout(startup_timer_layout)
# Whether or not to use a shutdown ('auto-stop') timer
self.shutdown_timeout_checkbox = QtWidgets.QCheckBox()
self.shutdown_timeout_checkbox.setCheckState(QtCore.Qt.Checked)
self.shutdown_timeout_checkbox.setText(strings._("gui_settings_shutdown_timeout_checkbox"))
shutdown_timeout_label = QtWidgets.QLabel(strings._("gui_settings_whats_this").format("https://github.com/micahflee/onionshare/wiki/Using-the-Auto-Stop-Timer"))
shutdown_timeout_label.setStyleSheet(self.common.css['settings_whats_this'])
shutdown_timeout_label.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction)
shutdown_timeout_label.setOpenExternalLinks(True)
shutdown_timeout_label.setMinimumSize(public_mode_label.sizeHint())
shutdown_timeout_layout = QtWidgets.QHBoxLayout()
shutdown_timeout_layout.addWidget(self.shutdown_timeout_checkbox)
shutdown_timeout_layout.addWidget(shutdown_timeout_label)
shutdown_timeout_layout.addStretch()
shutdown_timeout_layout.setContentsMargins(0,0,0,0)
self.shutdown_timeout_widget = QtWidgets.QWidget()
self.shutdown_timeout_widget.setLayout(shutdown_timeout_layout)
# Whether or not to use an auto-stop timer
self.autostop_timer_checkbox = QtWidgets.QCheckBox()
self.autostop_timer_checkbox.setCheckState(QtCore.Qt.Checked)
self.autostop_timer_checkbox.setText(strings._("gui_settings_autostop_timer_checkbox"))
autostop_timer_label = QtWidgets.QLabel(strings._("gui_settings_whats_this").format("https://github.com/micahflee/onionshare/wiki/Using-the-Auto-Stop-Timer"))
autostop_timer_label.setStyleSheet(self.common.css['settings_whats_this'])
autostop_timer_label.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction)
autostop_timer_label.setOpenExternalLinks(True)
autostop_timer_label.setMinimumSize(public_mode_label.sizeHint())
autostop_timer_layout = QtWidgets.QHBoxLayout()
autostop_timer_layout.addWidget(self.autostop_timer_checkbox)
autostop_timer_layout.addWidget(autostop_timer_label)
autostop_timer_layout.addStretch()
autostop_timer_layout.setContentsMargins(0,0,0,0)
self.autostop_timer_widget = QtWidgets.QWidget()
self.autostop_timer_widget.setLayout(autostop_timer_layout)
# General settings layout
general_group_layout = QtWidgets.QVBoxLayout()
general_group_layout.addWidget(self.public_mode_widget)
general_group_layout.addWidget(self.startup_timer_widget)
general_group_layout.addWidget(self.shutdown_timeout_widget)
general_group_layout.addWidget(self.autostop_timer_widget)
general_group = QtWidgets.QGroupBox(strings._("gui_settings_general_label"))
general_group.setLayout(general_group_layout)
@ -512,11 +512,11 @@ class SettingsDialog(QtWidgets.QDialog):
else:
self.startup_timer_checkbox.setCheckState(QtCore.Qt.Unchecked)
shutdown_timeout = self.old_settings.get('shutdown_timeout')
if shutdown_timeout:
self.shutdown_timeout_checkbox.setCheckState(QtCore.Qt.Checked)
autostop_timer = self.old_settings.get('autostop_timer')
if autostop_timer:
self.autostop_timer_checkbox.setCheckState(QtCore.Qt.Checked)
else:
self.shutdown_timeout_checkbox.setCheckState(QtCore.Qt.Unchecked)
self.autostop_timer_checkbox.setCheckState(QtCore.Qt.Unchecked)
save_private_key = self.old_settings.get('save_private_key')
if save_private_key:
@ -957,7 +957,7 @@ class SettingsDialog(QtWidgets.QDialog):
settings.set('close_after_first_download', self.close_after_first_download_checkbox.isChecked())
settings.set('startup_timer', self.startup_timer_checkbox.isChecked())
settings.set('shutdown_timeout', self.shutdown_timeout_checkbox.isChecked())
settings.set('autostop_timer', self.autostop_timer_checkbox.isChecked())
# Complicated logic here to force v2 onion mode on or off depending on other settings
if self.use_legacy_v2_onions_checkbox.isChecked():