終了処理を簡略化
This commit is contained in:
parent
e4b99a85ff
commit
6bcb570b10
1 changed files with 1 additions and 12 deletions
|
@ -454,14 +454,6 @@ class Stop():
|
||||||
def run(self):
|
def run(self):
|
||||||
stop_thread = threading.Thread(target=self.stop)
|
stop_thread = threading.Thread(target=self.stop)
|
||||||
stop_thread.run()
|
stop_thread.run()
|
||||||
run_notify = Notification(
|
|
||||||
app_id='Dislocker',
|
|
||||||
title='終了処理を実行中',
|
|
||||||
msg='終了処理を実行しています。\nPCがシャットダウンするまで、そのままでお待ち下さい。',
|
|
||||||
icon=resource_path + r'\success.png'
|
|
||||||
)
|
|
||||||
run_notify.set_audio(audio.Default, loop=False)
|
|
||||||
run_notify.show()
|
|
||||||
|
|
||||||
def delete_appdata(self, **kwargs):
|
def delete_appdata(self, **kwargs):
|
||||||
process_name = kwargs["process_name"]
|
process_name = kwargs["process_name"]
|
||||||
|
@ -533,13 +525,10 @@ class Stop():
|
||||||
print("停止処理は成功しました。")
|
print("停止処理は成功しました。")
|
||||||
elif responce.status_code == 401:
|
elif responce.status_code == 401:
|
||||||
print("認証に失敗しました。")
|
print("認証に失敗しました。")
|
||||||
tkinter.messagebox.showwarning(title=f"{app_name} | エラー", message=f"認証に失敗しました。\nDiscordサーバーの指示に従って、停止処理を自身で行ってください。")
|
|
||||||
else:
|
else:
|
||||||
print("内部エラーにより停止処理に失敗しました。")
|
print("内部エラーにより停止処理に失敗しました。")
|
||||||
result_msgbox = tkinter.messagebox.showwarning(title=f"{app_name} | エラー", message=f"内部エラーにより停止処理に失敗しました。\nDiscordサーバーの指示に従って、停止処理を自身で行ってください。")
|
|
||||||
except:
|
except:
|
||||||
print("ネットワークエラーにより停止処理に失敗しました。")
|
print("ネットワークエラーにより停止処理に失敗しました。")
|
||||||
result_msgbox = tkinter.messagebox.showwarning(title=f"{app_name} | エラー", message=f"ネットワークエラーにより停止処理に失敗しました。\nDiscordサーバーの指示に従って、停止処理を自身で行ってください。")
|
|
||||||
finally:
|
finally:
|
||||||
self.shutdown()
|
self.shutdown()
|
||||||
|
|
||||||
|
@ -550,7 +539,7 @@ if __name__ == '__main__':
|
||||||
if args[1] == "stop":
|
if args[1] == "stop":
|
||||||
init_result = init()
|
init_result = init()
|
||||||
if init_result == 1:
|
if init_result == 1:
|
||||||
warning_msgbox = tkinter.messagebox.showwarning(title=f"{app_name} | 多重起動エラー", message=f"もう終了処理を行っています。\nPCがシャットダウンするまで、もう少しお待ちください。")
|
print("多重起動を検出。")
|
||||||
elif init_result == 2:
|
elif init_result == 2:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue