Add ability to save the key to avoid being prompted for it

This commit is contained in:
Miguel Jacq 2025-11-02 11:44:22 +11:00
parent 4f773e1c1b
commit 43bbe971eb
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
7 changed files with 98 additions and 46 deletions

View file

@ -21,9 +21,11 @@ def get_settings() -> QSettings:
def load_db_config() -> DBConfig:
s = get_settings()
path = Path(s.value("db/path", str(default_db_path())))
return DBConfig(path=path, key="")
key = s.value("db/key", "")
return DBConfig(path=path, key=key)
def save_db_config(cfg: DBConfig) -> None:
s = get_settings()
s.setValue("db/path", str(cfg.path))
s.setValue("db/key", str(cfg.key))