Fix: Template name at config add

This commit is contained in:
LmeSzinc 2023-09-11 23:49:07 +08:00
parent c41210d6fb
commit b734e1c407
2 changed files with 4 additions and 4 deletions

View File

@ -166,7 +166,7 @@ def alas_template():
for file in os.listdir('./config'):
name, extension = os.path.splitext(file)
if name == 'template' and extension == '.json':
out.append(f'{name}-alas')
out.append(f'{name}-src')
# out.extend(mod_template())

View File

@ -1020,8 +1020,8 @@ class AlasGUI(Frame):
def get_unused_name():
all_name = alas_instance()
for i in range(2, 100):
if f"alas{i}" not in all_name:
return f"alas{i}"
if f"src{i}" not in all_name:
return f"src{i}"
else:
return ""
@ -1060,7 +1060,7 @@ class AlasGUI(Frame):
name="AddAlas_copyfrom",
label=t("Gui.AddAlas.CopyFrom"),
options=alas_template() + alas_instance(),
value=origin or "template-alas",
value=origin or "template-src",
scope=s,
),
put_button(label=t("Gui.AddAlas.Confirm"), onclick=add, scope=s)