Mods
This commit is contained in:
parent
8117a6a588
commit
788c5c698f
|
@ -18,6 +18,7 @@ class Args:
|
|||
width: int = 0
|
||||
height: int = 0
|
||||
program: str = ""
|
||||
speed: str = ""
|
||||
|
||||
@staticmethod
|
||||
def prepare() -> None:
|
||||
|
@ -42,6 +43,7 @@ class Args:
|
|||
"width",
|
||||
"height",
|
||||
"program",
|
||||
"speed",
|
||||
]
|
||||
|
||||
for n_item in normals:
|
||||
|
|
|
@ -123,3 +123,10 @@ class ArgSpec:
|
|||
type=str,
|
||||
info="The internal name of the program",
|
||||
)
|
||||
|
||||
ArgSpec.add_argument(
|
||||
"speed",
|
||||
type=str,
|
||||
choices=["fast", "normal", "slow"],
|
||||
info="Use this update speed",
|
||||
)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from .args import Args
|
||||
from .window import Window
|
||||
from .storage import Storage
|
||||
|
||||
|
@ -17,8 +18,14 @@ class Settings:
|
|||
@staticmethod
|
||||
def prepare() -> None:
|
||||
settings = Storage.get_settings()
|
||||
changed = False
|
||||
|
||||
if Args.speed:
|
||||
Settings.speed = Args.speed
|
||||
changed = True
|
||||
else:
|
||||
Settings.speed = settings.get("speed", "normal")
|
||||
|
||||
speed = Settings.speed.capitalize()
|
||||
Window.speed.setCurrentText(speed)
|
||||
|
||||
|
@ -29,6 +36,9 @@ class Settings:
|
|||
|
||||
Settings.merge = settings.get("merge", True)
|
||||
|
||||
if changed:
|
||||
Settings.save()
|
||||
|
||||
@staticmethod
|
||||
def save() -> None:
|
||||
settings = {
|
||||
|
|
Loading…
Reference in New Issue