summaryrefslogtreecommitdiff
path: root/onionshare
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2019-11-02 21:45:55 -0700
committerMicah Lee <micah@micahflee.com>2019-11-02 21:45:55 -0700
commita5f8fee065af1758f7247be1ecc32d7d34acdfb0 (patch)
tree3496cc97ccefce2bc7d9cd5111d7fbf747b493b4 /onionshare
parent1b36fe4036e5963ef702273b8d2218f5c043c4ed (diff)
downloadonionshare-a5f8fee065af1758f7247be1ecc32d7d34acdfb0.tar.gz
onionshare-a5f8fee065af1758f7247be1ecc32d7d34acdfb0.zip
Starting to make persistent tabs persistent
Diffstat (limited to 'onionshare')
-rw-r--r--onionshare/mode_settings.py9
-rw-r--r--onionshare/settings.py1
2 files changed, 7 insertions, 3 deletions
diff --git a/onionshare/mode_settings.py b/onionshare/mode_settings.py
index ffc32d06..3b14dbe8 100644
--- a/onionshare/mode_settings.py
+++ b/onionshare/mode_settings.py
@@ -28,12 +28,13 @@ class ModeSettings:
is only one TabSettings, and in the GUI there is a separate TabSettings for each tab
"""
- def __init__(self, common, filename=None):
+ def __init__(self, common, filename=None, id=None):
self.common = common
self.default_settings = {
"persistent": {
"enabled": False,
+ "mode": None,
"private_key": None,
"hidservauth": None,
"password": None,
@@ -52,7 +53,10 @@ class ModeSettings:
self._settings = {}
self.just_created = False
- self.id = self.common.build_password(3)
+ if id:
+ self.id = id
+ else:
+ self.id = self.common.build_password(3)
self.load(filename)
@@ -104,7 +108,6 @@ class ModeSettings:
if filename:
self.filename = filename
else:
- # Give it a persistent filename
self.filename = os.path.join(
self.common.build_persistent_dir(), f"{self.id}.json"
)
diff --git a/onionshare/settings.py b/onionshare/settings.py
index 11227817..f9348a8e 100644
--- a/onionshare/settings.py
+++ b/onionshare/settings.py
@@ -112,6 +112,7 @@ class Settings(object):
"tor_bridges_use_obfs4": False,
"tor_bridges_use_meek_lite_azure": False,
"tor_bridges_use_custom_bridges": "",
+ "persistent_tabs": [],
"locale": None, # this gets defined in fill_in_defaults()
}
self._settings = {}