From e0c6bfbf516f3697be39cb41a10d598284f69278 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Wed, 23 Oct 2019 06:01:21 +0100 Subject: [PATCH] show the clsoing window if tray is disabled --- .../views/com/muwire/gui/MainFrameView.groovy | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy index 9985d60b..76d6ffe4 100644 --- a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy @@ -28,6 +28,7 @@ import javax.swing.tree.TreeNode import javax.swing.tree.TreePath import com.muwire.core.Constants +import com.muwire.core.Core import com.muwire.core.MuWireSettings import com.muwire.core.SharedFile import com.muwire.core.download.Downloader @@ -442,7 +443,15 @@ class MainFrameView { if (!application.getContext().get("tray-icon")) { mainFrame.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { - application.shutdown() + application.getWindowManager().findWindow("shutdown-window").setVisible(true) + Core core = application.getContext().get("core") + if (core != null) { + Thread t = new Thread({ + core.shutdown() + application.shutdown() + }as Runnable) + t.start() + } } }) }