Add ability to save the key to avoid being prompted for it
This commit is contained in:
parent
4f773e1c1b
commit
43bbe971eb
7 changed files with 98 additions and 46 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue