From b6bbefbcbe96f1052dfce290f9e2bd600e4cf70b Mon Sep 17 00:00:00 2001 From: suti7yk5032 Date: Tue, 1 Oct 2024 16:18:50 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6=E3=83=88?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=81=E6=96=87=E8=A8=80=E3=81=AE?= =?UTF-8?q?=E7=B7=A8=E9=9B=86=E3=80=81guitest=E3=83=A2=E3=83=BC=E3=83=89?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dislocker_client.py | 48 ++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/dislocker_client.py b/dislocker_client.py index 7568f33..07b30c7 100644 --- a/dislocker_client.py +++ b/dislocker_client.py @@ -178,13 +178,13 @@ class App(customtkinter.CTk): self.attributes('-fullscreen', True) self.attributes('-topmost', True) - if client_config["hard_lock"] == True: - exit_explorer = subprocess.run('taskkill /f /im explorer.exe', startupinfo=sp_startupinfo, stdout=subprocess.PIPE, text=True) - if exit_explorer.returncode == 0: - pass - else: - signout_session = subprocess.run('shutdown /l /f /t 3', startupinfo=sp_startupinfo, stdout=subprocess.PIPE, text=True) - error_msgbox = tkinter.messagebox.showerror(title=f"{app_name} | 初回処理のエラー", message=f"初回処理の実行にエラーが発生しました。\n自動的にサインアウトされます。") + if client_config["hard_lock"] == True: + exit_explorer = subprocess.run('taskkill /f /im explorer.exe', startupinfo=sp_startupinfo, stdout=subprocess.PIPE, text=True) + if exit_explorer.returncode == 0: + pass + else: + signout_session = subprocess.run('shutdown /l /f /t 3', startupinfo=sp_startupinfo, stdout=subprocess.PIPE, text=True) + error_msgbox = tkinter.messagebox.showerror(title=f"{app_name} | 初回処理のエラー", message=f"初回処理の実行にエラーが発生しました。\n自動的にサインアウトされます。") self.title(f"{app_name} | ロック中") self.iconbitmap(default=resource_path + '\\icon\\dislocker.ico') @@ -267,11 +267,14 @@ class Lock(customtkinter.CTkToplevel): self.cover_img = customtkinter.CTkImage(light_image=Image.open(resource_path + '\\cover\\dislocker_light.png'), dark_image=Image.open(resource_path + '\\cover\\dislocker_dark.png'), size=(160, 320)) + self.grid_columnconfigure(0, weight=1) + self.grid_columnconfigure(1, weight=6) + self.cover_frame = customtkinter.CTkFrame(self, corner_radius=0, fg_color='transparent') - self.cover_frame.grid(row=0, column=0, padx=0, pady=0) + self.cover_frame.grid(row=0, column=0, padx=0, pady=0, sticky="nsew", rowspan=4) self.cover_img_label = customtkinter.CTkLabel(self.cover_frame, image=self.cover_img, text="") - self.cover_img_label.grid(row=0, column=0, padx=0, pady=0) + self.cover_img_label.grid(row=0, column=0, padx=0, pady=0, sticky="w") self.msg_title_frame = customtkinter.CTkFrame(self, corner_radius=0, fg_color='transparent') self.msg_title_frame.grid(row=0, column=1, padx=10, pady=10, sticky="nsew") @@ -279,24 +282,27 @@ class Lock(customtkinter.CTkToplevel): #self.icon_title_1 = customtkinter.CTkLabel(self.msg_title_frame, text='😎', font=self.emoji_font, justify="left") #self.icon_title_1.grid(row=0, column=0, padx=10, sticky="w") - self.msg_title_1 = customtkinter.CTkLabel(self.msg_title_frame, text=f'ちょっと待って!! PC番号 | {client_config["pc_number"]}', font=self.title_font, justify="left") - self.msg_title_1.grid(row=0, column=1, padx=10, sticky="w") + self.msg_title_1 = customtkinter.CTkLabel(self.msg_title_frame, text=f'ちょっと待って!! ', font=self.title_font, justify="left") + self.msg_title_1.grid(row=0, column=0, padx=10, sticky="we") + + self.pc_number_title_1 = customtkinter.CTkLabel(self.msg_title_frame, text=f'PC番号 | {client_config["pc_number"]}', font=self.title_font, justify="right") + self.pc_number_title_1.grid(row=0, column=1, padx=10, sticky="e") self.msg_title_2 = customtkinter.CTkLabel(self.msg_title_frame, text="本当にあなたですか?", font=self.title_small_font, justify="left") - self.msg_title_2.grid(row=1, column=1, padx=10, sticky="w") + self.msg_title_2.grid(row=1, column=0, padx=10, columnspan=2, sticky="w") self.msg_subtitle_frame = customtkinter.CTkFrame(self, corner_radius=0, fg_color='transparent') - self.msg_subtitle_frame.grid(row=1, column=0, padx=10, pady=10, sticky="nsew") + self.msg_subtitle_frame.grid(row=1, column=1, padx=10, pady=0, sticky="nsew") self.msg_subtitle_frame.grid_columnconfigure(0, weight=1) - self.msg_subtitle_1 = customtkinter.CTkLabel(self.msg_subtitle_frame, text='サインインするには、Discordのダイレクトメッセージに送信された\nパスワードを入力してください。', font=self.general_font, justify="left") - self.msg_subtitle_1.grid(row=0, column=0, padx=10, sticky="ew") + self.msg_subtitle_1 = customtkinter.CTkLabel(self.msg_subtitle_frame, text='サインインするには、Discordを開き、Dislockerから送信された\nパスワードを入力してください。', font=self.general_font, justify="left") + self.msg_subtitle_1.grid(row=0, column=0, padx=10, sticky="w") - self.msg_subtitle_2 = customtkinter.CTkLabel(self.msg_subtitle_frame, text='※ パスワードの有効期限は発行から5分間です。', font=self.general_small_font, justify="left") + self.msg_subtitle_2 = customtkinter.CTkLabel(self.msg_subtitle_frame, text='※ パスワードの有効期限は発行から5分間です。期限が切れた場合は、もう一度発行してください。', font=self.general_small_font, justify="left") self.msg_subtitle_2.grid(row=1, column=0, padx=10, sticky="w") self.input_frame = customtkinter.CTkFrame(self, corner_radius=0, fg_color='transparent') - self.input_frame.grid(row=2, column=0, padx=10, pady=10, sticky="nsew") + self.input_frame.grid(row=2, column=1, padx=10, pady=0, sticky="nsew") self.input_frame.columnconfigure(0, weight=1) self.password_entry = customtkinter.CTkEntry(self.input_frame, placeholder_text='パスワード', show='*', font=self.textbox_font) @@ -304,7 +310,7 @@ class Lock(customtkinter.CTkToplevel): self.password_entry.bind("", self.auth_start_ev) self.button_frame = customtkinter.CTkFrame(self, corner_radius=0, fg_color='transparent') - self.button_frame.grid(row=3, column=0, padx=10, pady=10, sticky="nsew") + self.button_frame.grid(row=3, column=1, padx=10, pady=10, sticky="nsew") self.button_frame.columnconfigure(0, weight=3) self.button_frame.columnconfigure(1, weight=1) self.button_frame.columnconfigure(2, weight=1) @@ -630,6 +636,12 @@ if __name__ == '__main__': else: print("エラーが発生しました。") + elif args[1] == "guitest": + init_result = init() + client_config["testing"] = True + app = App() + app.mainloop() + else: print("引数エラー。") else: