Save the slug when using a persistent private key

This commit is contained in:
Miguel Jacq 2018-01-15 10:01:34 +11:00
parent 448f6af796
commit 3e7d4c64ff
No known key found for this signature in database
GPG key ID: EEA4341C6D97A0B6
7 changed files with 34 additions and 10 deletions

View file

@ -21,7 +21,7 @@ import platform
from .alert import Alert
from PyQt5 import QtCore, QtWidgets, QtGui
from onionshare import strings, common
from onionshare import strings, common, settings
class ServerStatus(QtWidgets.QVBoxLayout):
"""
@ -36,7 +36,7 @@ class ServerStatus(QtWidgets.QVBoxLayout):
STATUS_WORKING = 1
STATUS_STARTED = 2
def __init__(self, qtapp, app, web, file_selection):
def __init__(self, qtapp, app, web, file_selection, settings):
super(ServerStatus, self).__init__()
self.status = self.STATUS_STOPPED
@ -45,6 +45,8 @@ class ServerStatus(QtWidgets.QVBoxLayout):
self.web = web
self.file_selection = file_selection
self.settings = settings
# Helper boolean as this is used in a few places
self.timer_enabled = False
# Shutdown timeout layout
@ -141,6 +143,11 @@ class ServerStatus(QtWidgets.QVBoxLayout):
self.url_label.show()
self.copy_url_button.show()
if self.settings.get('save_private_key'):
if not self.settings.get('slug'):
self.settings.set('slug', self.web.slug)
self.settings.save()
if self.app.stealth:
self.copy_hidservauth_button.show()
else: