mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Prevent the app from closing while running background operations, like
saving and exporting files
This commit is contained in:
@@ -144,7 +144,11 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
addWindowListener(new WindowAdapter() {
|
||||
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e) {
|
||||
public void windowClosed(WindowEvent e) {
|
||||
if (getGlassPane().isVisible()) {
|
||||
LOG.info("Prevented the app from closing because a running task is detected");
|
||||
return;
|
||||
}
|
||||
if (presenter.allowFileAction()) {
|
||||
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false);
|
||||
dispose();
|
||||
|
||||
Reference in New Issue
Block a user