mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-05-31 23:59:38 +03:00
[2203] Simplify Duplicate Running Message
This commit is contained in:
parent
770c0ed3a5
commit
8b116516a2
@ -338,29 +338,14 @@ if __name__ == '__main__': # noqa: C901
|
|||||||
|
|
||||||
def already_running_popup():
|
def already_running_popup():
|
||||||
"""Create the "already running" popup."""
|
"""Create the "already running" popup."""
|
||||||
import tkinter as tk
|
from tkinter import messagebox
|
||||||
from tkinter import ttk
|
|
||||||
# Check for CL arg that suppresses this popup.
|
# Check for CL arg that suppresses this popup.
|
||||||
if args.suppress_dupe_process_popup:
|
if args.suppress_dupe_process_popup:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
root = tk.Tk(className=appname.lower())
|
already_running_msg = "An EDMarketConnector process was already running, exiting."
|
||||||
|
messagebox.showerror(title=appname, message=already_running_msg)
|
||||||
frame = tk.Frame(root)
|
sys.exit(0)
|
||||||
frame.grid(row=1, column=0, sticky=tk.NSEW)
|
|
||||||
|
|
||||||
label = tk.Label(frame, text='An EDMarketConnector.exe process was already running, exiting.')
|
|
||||||
label.grid(row=1, column=0, sticky=tk.NSEW)
|
|
||||||
|
|
||||||
button = ttk.Button(frame, text='OK', command=lambda: sys.exit(0))
|
|
||||||
button.grid(row=2, column=0, sticky=tk.S)
|
|
||||||
|
|
||||||
try:
|
|
||||||
root.mainloop()
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
logger.info("Ctrl+C Detected, Attempting Clean Shutdown")
|
|
||||||
sys.exit()
|
|
||||||
logger.info('Exiting')
|
|
||||||
|
|
||||||
journal_lock = JournalLock()
|
journal_lock = JournalLock()
|
||||||
locked = journal_lock.obtain_lock()
|
locked = journal_lock.obtain_lock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user