Prevent the app from closing while running background operations, like

saving and exporting files
This commit is contained in:
bancika
2020-04-10 10:53:25 +02:00
parent c2007f62b1
commit b1929e538b
2 changed files with 9 additions and 1 deletions
@@ -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();