show the clsoing window if tray is disabled
This commit is contained in:
@@ -28,6 +28,7 @@ import javax.swing.tree.TreeNode
|
|||||||
import javax.swing.tree.TreePath
|
import javax.swing.tree.TreePath
|
||||||
|
|
||||||
import com.muwire.core.Constants
|
import com.muwire.core.Constants
|
||||||
|
import com.muwire.core.Core
|
||||||
import com.muwire.core.MuWireSettings
|
import com.muwire.core.MuWireSettings
|
||||||
import com.muwire.core.SharedFile
|
import com.muwire.core.SharedFile
|
||||||
import com.muwire.core.download.Downloader
|
import com.muwire.core.download.Downloader
|
||||||
@@ -442,7 +443,15 @@ class MainFrameView {
|
|||||||
if (!application.getContext().get("tray-icon")) {
|
if (!application.getContext().get("tray-icon")) {
|
||||||
mainFrame.addWindowListener(new WindowAdapter(){
|
mainFrame.addWindowListener(new WindowAdapter(){
|
||||||
public void windowClosing(WindowEvent e) {
|
public void windowClosing(WindowEvent e) {
|
||||||
|
application.getWindowManager().findWindow("shutdown-window").setVisible(true)
|
||||||
|
Core core = application.getContext().get("core")
|
||||||
|
if (core != null) {
|
||||||
|
Thread t = new Thread({
|
||||||
|
core.shutdown()
|
||||||
application.shutdown()
|
application.shutdown()
|
||||||
|
}as Runnable)
|
||||||
|
t.start()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user