From 19afc4a57aeadffee290e12477e977ce64bbe655 Mon Sep 17 00:00:00 2001 From: suti7yk5032 Date: Wed, 21 Aug 2024 12:59:45 +0900 Subject: [PATCH] =?UTF-8?q?issue=20#7=20=E3=81=AE=E8=A7=A3=E6=B1=BA?= =?UTF-8?q?=E6=A1=88(=E3=83=9C=E3=82=BF=E3=83=B3=E7=84=A1=E5=8A=B9?= =?UTF-8?q?=E5=8C=96)=E3=82=92=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dislocker_client.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/dislocker_client.py b/dislocker_client.py index 64dc01e..ac495d5 100644 --- a/dislocker_client.py +++ b/dislocker_client.py @@ -214,11 +214,11 @@ class Lock(customtkinter.CTkToplevel): self.signin_button = customtkinter.CTkButton(self.button_frame, text='サインイン', command=self.auth_start, font=self.button_font) self.signin_button.grid(row=0, column=2, padx=10, sticky="e") - self.logout_button = customtkinter.CTkButton(self.button_frame, text='サインアウト', command=self.logout, font=self.button_font) - self.logout_button.grid(row=0, column=1, padx=10, sticky="e") + self.signout_button = customtkinter.CTkButton(self.button_frame, text='サインアウト', command=self.signout, font=self.button_font) + self.signout_button.grid(row=0, column=1, padx=10, sticky="e") - self.signin_button = customtkinter.CTkButton(self.button_frame, text='ヘルプ', command=self.help_dummy, font=self.button_font) - self.signin_button.grid(row=0, column=0, padx=10, sticky="w") + self.help_button = customtkinter.CTkButton(self.button_frame, text='ヘルプ', command=self.help_dummy, font=self.button_font) + self.help_button.grid(row=0, column=0, padx=10, sticky="w") self.keyboard_listener_thread = threading.Thread(target=self.keyboard_listener) self.keyboard_listener_thread.daemon = True @@ -246,6 +246,9 @@ class Lock(customtkinter.CTkToplevel): def auth(self): + self.help_button.configure(state="disabled", fg_color="gray") + self.signin_button.configure(state="disabled", fg_color="gray") + self.signout_button.configure(state="disabled", fg_color="gray") password = str(self.password_entry.get()) if len(password) == 10: print("マスターパスワードで認証を試行します。") @@ -255,6 +258,9 @@ class Lock(customtkinter.CTkToplevel): self.exit() else: print("マスターパスワードで認証できませんでした。") + self.help_button.configure(state="normal", fg_color="blue") + self.signin_button.configure(state="normal", fg_color="blue") + self.signout_button.configure(state="normal", fg_color="blue") print("認証サーバーにアクセスします。") @@ -273,9 +279,10 @@ class Lock(customtkinter.CTkToplevel): self.withdraw() msgbox = tkinter.messagebox.showinfo(title=f"{app_name} | 誤ったパスワード", message=f"パスワードが間違っています!") self.msg_subtitle_1.configure(text='パスワードが間違っています! ') + self.help_button.configure(state="normal", fg_color="blue") + self.signin_button.configure(state="normal", fg_color="blue") + self.signout_button.configure(state="normal", fg_color="blue") self.deiconify() - - except: print("認証サーバーにアクセスできません。マスターパスワードで認証を試行します。") master_password_hash = self.hash_genarate(str(self.password_entry.get())) @@ -287,13 +294,16 @@ class Lock(customtkinter.CTkToplevel): self.withdraw() msgbox = tkinter.messagebox.showinfo(title=f"{app_name} | ネットワークエラー", message=f"認証サーバーにアクセスできませんでした。\n続行するには、マスターパスワードを入力してください。") self.msg_subtitle_1.configure(text='ネットワークエラーが発生しています。\n続行するには、マスターパスワードを入力して下さい。 ') + self.help_button.configure(state="normal", fg_color="blue") + self.signin_button.configure(state="normal", fg_color="blue") + self.signout_button.configure(state="normal", fg_color="blue") self.deiconify() - def logout(self): + def signout(self): app.unlock_taskmgr() self.destroy() - logout_command = subprocess.run(['shutdown', '/l', '/f']) - print(logout_command) + signout_command = subprocess.run(['shutdown', '/l', '/f']) + print(signout_command) def handler_close(self): @@ -365,7 +375,7 @@ class Monitor(): self.shutdown() def shutdown(self): - logout_command = subprocess.run(['shutdown', '/s', '/t', '1']) + shutdown_command = subprocess.run(['shutdown', '/s', '/t', '1']) def run(self):