reinstate the emitted signals for invalid version/error checking for updates

This commit is contained in:
Miguel Jacq 2018-01-23 16:51:13 +11:00
parent 70a624c331
commit a28f427c0c
No known key found for this signature in database
GPG key ID: 5418373DFF79BA19
2 changed files with 35 additions and 8 deletions

View file

@ -564,26 +564,35 @@ class SettingsDialog(QtWidgets.QDialog):
autoupdate_timestamp = settings.get('autoupdate_timestamp')
self._update_autoupdate_timestamp(autoupdate_timestamp)
# Check for updates
def update_available(update_url, installed_version, latest_version):
Alert(strings._("update_available", True).format(update_url, installed_version, latest_version))
def close_forced_update_thread():
forced_update_thread.quit()
# Enable buttons
self._enable_buttons()
# Update timestamp
update_timestamp()
# Check for updates
def update_available(update_url, installed_version, latest_version):
Alert(strings._("update_available", True).format(update_url, installed_version, latest_version))
close_forced_update_thread()
def update_not_available():
Alert(strings._('update_not_available', True))
forced_update_thread.quit()
# Enable buttons
self._enable_buttons()
# Update timestamp
update_timestamp()
close_forced_update_thread()
def update_error():
Alert(strings._('update_error_check_error', True), QtWidgets.QMessageBox.Warning)
close_forced_update_thread()
def update_invalid_version():
Alert(strings._('update_error_invalid_latest_version', True).format(e.latest_version), QtWidgets.QMessageBox.Warning)
close_forced_update_thread()
forced_update_thread = UpdateThread(self.onion, self.config, force=True)
forced_update_thread.update_available.connect(update_available)
forced_update_thread.update_not_available.connect(update_not_available)
forced_update_thread.update_error.connect(update_error)
forced_update_thread.update_invalid_version.connect(update_invalid_version)
forced_update_thread.start()
def save_clicked(self):