encrypt save support, smileys fix, bug fixes

This commit is contained in:
ingvar1995 2016-06-21 23:43:43 +03:00
parent dd53c6a842
commit 42aa102d1d
9 changed files with 18 additions and 13 deletions

View file

@ -144,9 +144,11 @@ class Settings(dict, Singleton):
text = json.dumps(self)
inst = LibToxEncryptSave.get_instance()
if inst.has_password():
text = inst.pass_encrypt(text)
text = bytes(inst.pass_encrypt(bytes(text, 'utf-8')))
else:
text = bytes(text, 'utf-8')
with open(self.path, 'wb') as fl:
fl.write(bytes(text, 'UTF-8'))
fl.write(text)
def close(self):
path = Settings.get_default_path() + 'toxygen.json'