Merge Linuxero with main

This commit is contained in:
2025-03-07 12:10:18 +01:00
13 changed files with 323 additions and 88 deletions

View File

@@ -41,6 +41,7 @@ class ConfigLoader(QObject):
else:
config_dir.mkdir(0o750, True, True)
@Slot(dict, result = bool)
def setConfig(self, app_config):
# print(f"In {__file__} file, setConfig()")
@@ -110,18 +111,13 @@ class ConfigLoader(QObject):
self.backupEncryptionKey.emit()
return admin
"""###################################################"""
""" """
""" TODO: Rename method and rename self.__encrypt_key """
""" """
"""###################################################"""
@Slot(str, str)
def saveRecoveryKey(self, recovery_file, recovery_password):
# print(f"In {__file__} file, saveRecoveryKey()")
def __saveData(self, recovery_file, recovery_password, data):
# print(f"In {__file__} file, __saveData()")
local = False
rp = self.__setRecoveryPassword(recovery_password)
rf = rp[1] + self.__encrypt_key + rp[0]
rf = rp[1] + data + rp[0]
rf = Vermasseln().oscarVermasseln(rf, local)
rec_file = urlparse(recovery_file)
if os.name == "nt":
@@ -197,7 +193,8 @@ class ConfigLoader(QObject):
if ek:
self.__config = toml.loads(ek)
self.__saveConfig()
self.configurationReady.emit()
self.__configLoad()
else:
self.invalidEncryptionKey.emit()
except Exception as e:
@@ -242,8 +239,9 @@ class ConfigLoader(QObject):
@Slot(str, str)
def backupConfig(self, filename, password):
self.__encrypt_key = toml.dumps(self.getConfig())
self.saveRecoveryKey(filename, password)
conf_file = toml.dumps(self.getConfig())
self.__saveData(filename, password, conf_file)
@Slot(dict)
def saveCompanyInfo(self, company = None):
@@ -263,3 +261,9 @@ class ConfigLoader(QObject):
def systray(self):
return self.__config['misc']['SYSTRAY']
@Slot(str, str)
def backupEncryptkey(self, filename, password):
encrypt_key = self.__config['pyqcrm']['ENCRYPTION_KEY']
self.__saveData(filename, password, encrypt_key)

View File

@@ -22,7 +22,6 @@ class EmployeeModel(QAbstractTableModel):
self.__employee_dao.newEmployeeAdded.connect(self.__refreshView)
self.__conf = ConfigLoader().getConfig()
self.__key = self.__conf['pyqcrm']['ENCRYPTION_KEY']
print(self.__key)
self.__getData()
@Slot(dict, bool)