mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Prevent the app from closing when a running task is detected
removed extra line
This commit is contained in:
@@ -643,7 +643,6 @@ public class ActionFactory {
|
||||
super();
|
||||
this.plugInPort = plugInPort;
|
||||
this.drawingProvider = drawingProvider;
|
||||
this.drawingProvider = drawingProvider;
|
||||
this.swingUI = swingUI;
|
||||
this.defaultSuffix = defaultSuffix;
|
||||
putValue(AbstractAction.NAME, "Export to PNG");
|
||||
|
||||
@@ -107,7 +107,7 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
private CanvasPlugin canvasPlugin;
|
||||
|
||||
public MainFrame() {
|
||||
super("DIYLC 3");
|
||||
super("DIYLC 4");
|
||||
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||
setPreferredSize(new Dimension(1024, 700));
|
||||
createBasePanels();
|
||||
@@ -149,12 +149,17 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false);
|
||||
dispose();
|
||||
presenter.dispose();
|
||||
LOG.info("Closing the app");
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowClosing(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