mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Open share tab if filenames are passed; and when detecting existing onionshare-gui processes, ignore zombies
This commit is contained in:
parent
7e06872a39
commit
e316af0e11
@ -131,7 +131,7 @@ def main():
|
||||
if proc.info["pid"] == os.getpid():
|
||||
continue
|
||||
|
||||
if proc.info["name"] == "onionshare-gui":
|
||||
if proc.info["name"] == "onionshare-gui" and proc.status() != "zombie":
|
||||
existing_pid = proc.info["pid"]
|
||||
break
|
||||
else:
|
||||
@ -140,6 +140,7 @@ def main():
|
||||
if (
|
||||
os.path.basename(proc.info["cmdline"][0]).lower() == "python"
|
||||
and os.path.basename(proc.info["cmdline"][1]) == "onionshare-gui"
|
||||
and proc.status() != "zombie"
|
||||
):
|
||||
existing_pid = proc.info["pid"]
|
||||
break
|
||||
@ -161,6 +162,10 @@ def main():
|
||||
# Launch the gui
|
||||
main_window = MainWindow(common, filenames)
|
||||
|
||||
# If filenames were passed in, open them in a tab
|
||||
if filenames:
|
||||
main_window.tabs.new_share_tab(filenames)
|
||||
|
||||
# Clean up when app quits
|
||||
def shutdown():
|
||||
main_window.cleanup()
|
||||
|
Loading…
Reference in New Issue
Block a user