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