Add warning popup when old settings.json detected

This commit is contained in:
miruka
2021-01-19 13:22:29 -04:00
parent 5dfe700880
commit 86f0a8a6a0
6 changed files with 85 additions and 3 deletions

View File

@@ -18,7 +18,9 @@ import pyotherside
from watchgod import Change, awatch
from .pcn.section import Section
from .pyotherside_events import LoopException, UserFileChanged
from .pyotherside_events import (
LoopException, Pre070SettingsDetected, UserFileChanged,
)
from .theme_parser import convert_to_qml
from .utils import (
aiopen, atomic_write, deep_serialize_for_qml, dict_update_recursive,
@@ -396,6 +398,17 @@ class Accounts(ConfigFile, JSONFile):
self.save()
@dataclass
class Pre070Settings(ConfigFile):
"""Detect and warn about the presence of a pre-0.7.0 settings.json file."""
filename: str = "settings.json"
def __post_init__(self) -> None:
if self.path.exists():
Pre070SettingsDetected(self.path)
@dataclass
class Settings(ConfigFile, PCNFile):
"""General config file for UI and backend settings"""