mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +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();
|
super();
|
||||||
this.plugInPort = plugInPort;
|
this.plugInPort = plugInPort;
|
||||||
this.drawingProvider = drawingProvider;
|
this.drawingProvider = drawingProvider;
|
||||||
this.drawingProvider = drawingProvider;
|
|
||||||
this.swingUI = swingUI;
|
this.swingUI = swingUI;
|
||||||
this.defaultSuffix = defaultSuffix;
|
this.defaultSuffix = defaultSuffix;
|
||||||
putValue(AbstractAction.NAME, "Export to PNG");
|
putValue(AbstractAction.NAME, "Export to PNG");
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class MainFrame extends JFrame implements ISwingUI {
|
|||||||
private CanvasPlugin canvasPlugin;
|
private CanvasPlugin canvasPlugin;
|
||||||
|
|
||||||
public MainFrame() {
|
public MainFrame() {
|
||||||
super("DIYLC 3");
|
super("DIYLC 4");
|
||||||
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||||
setPreferredSize(new Dimension(1024, 700));
|
setPreferredSize(new Dimension(1024, 700));
|
||||||
createBasePanels();
|
createBasePanels();
|
||||||
@@ -149,12 +149,17 @@ public class MainFrame extends JFrame implements ISwingUI {
|
|||||||
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false);
|
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false);
|
||||||
dispose();
|
dispose();
|
||||||
presenter.dispose();
|
presenter.dispose();
|
||||||
|
LOG.info("Closing the app");
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void windowClosing(WindowEvent e) {
|
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()) {
|
if (presenter.allowFileAction()) {
|
||||||
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false);
|
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false);
|
||||||
dispose();
|
dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user