Compare commits
No commits in common. "d757e81f78cccb46a56a6974bdd810580da6bb0c" and "291db1828c3182c4c4ce6d352196d3e753407d58" have entirely different histories.
d757e81f78
...
291db1828c
11
main.py
11
main.py
@ -14,7 +14,7 @@ REGISTRY_PATH = r"Software\StudentIDDraw"
|
||||
DEFAULT_ALLOW_REPEAT = False
|
||||
DEFAULT_MIN_ID = 1
|
||||
DEFAULT_MAX_ID = 45
|
||||
PASSWORD = "admin000"
|
||||
PASSWORD = "Admin@123"
|
||||
|
||||
selected_ids = []
|
||||
temp_selected_ids = []
|
||||
@ -185,7 +185,7 @@ def open_settings():
|
||||
update_history_list()
|
||||
|
||||
def add_id():
|
||||
new_id = simpledialog.askstring("新增学号", "请输入新的学号:", parent=settings_window)
|
||||
new_id = simpledialog.askstring("新增学号", "请输入新的学号:")
|
||||
if new_id:
|
||||
if new_id.isdigit():
|
||||
new_id = int(new_id)
|
||||
@ -197,7 +197,6 @@ def open_settings():
|
||||
messagebox.showerror("错误", f"学号必须在 {min_id} 和 {max_id} 之间")
|
||||
else:
|
||||
messagebox.showerror("错误", "请输入有效的学号")
|
||||
settings_window.focus_force()
|
||||
|
||||
def delete_id():
|
||||
selected = history_list.curselection()
|
||||
@ -211,7 +210,6 @@ def open_settings():
|
||||
history_list.select_set(index - 1)
|
||||
else:
|
||||
messagebox.showerror("错误", "请选择一个学号进行删除")
|
||||
settings_window.focus_force()
|
||||
|
||||
def edit_id():
|
||||
selected = history_list.curselection()
|
||||
@ -219,7 +217,7 @@ def open_settings():
|
||||
index = selected[0]
|
||||
current_id, _ = temp_selected_ids[index]
|
||||
new_id = simpledialog.askstring(
|
||||
"修改学号", "请输入新的学号:", initialvalue=str(current_id), parent=settings_window
|
||||
"修改学号", "请输入新的学号:", initialvalue=str(current_id)
|
||||
)
|
||||
if new_id:
|
||||
if new_id.isdigit():
|
||||
@ -235,7 +233,6 @@ def open_settings():
|
||||
messagebox.showerror("错误", "请输入有效的学号")
|
||||
else:
|
||||
messagebox.showerror("错误", "请选择一个学号进行修改")
|
||||
settings_window.focus_force()
|
||||
|
||||
def clear_all_ids():
|
||||
global temp_selected_ids
|
||||
@ -340,7 +337,7 @@ settings_button.pack(pady=10)
|
||||
# 创建多行标签,用于显示信息,内容居中显示
|
||||
info_label = tk.Label(
|
||||
root,
|
||||
text="LuckyDraw v1.2 2024/06/22\nCopyright 2024 earthjasonlin\n保留所有权利。\n本程序仅作为交流学习使用",
|
||||
text="LuckyDraw v1.1 2024/06/22\nCopyright 2024 earthjasonlin\n保留所有权利。\n本程序仅作为交流学习使用",
|
||||
font=("宋体", 10),
|
||||
justify="center",
|
||||
anchor="center",
|
||||
|
Loading…
x
Reference in New Issue
Block a user