Mods
This commit is contained in:
26
cromulant/settings.py
Normal file
26
cromulant/settings.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from .window import Window
|
||||
from .storage import Storage
|
||||
|
||||
|
||||
class Settings:
|
||||
speed: str
|
||||
|
||||
@staticmethod
|
||||
def prepare() -> None:
|
||||
settings = Storage.get_settings()
|
||||
Settings.speed = settings.get("speed", "normal")
|
||||
speed = Settings.speed.capitalize()
|
||||
Window.speed.setCurrentText(speed)
|
||||
|
||||
@staticmethod
|
||||
def save() -> None:
|
||||
settings = {
|
||||
"speed": Settings.speed,
|
||||
}
|
||||
|
||||
Storage.save_settings(settings)
|
||||
|
||||
@staticmethod
|
||||
def set_speed(speed: str) -> None:
|
||||
Settings.speed = speed
|
||||
Settings.save()
|
Reference in New Issue
Block a user