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();
|
||||
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();
|
||||
@@ -144,17 +144,22 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
addWindowListener(new WindowAdapter() {
|
||||
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e) {
|
||||
public void windowClosed(WindowEvent e) {
|
||||
if (presenter.allowFileAction()) {
|
||||
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false);
|
||||
dispose();
|
||||
presenter.dispose();
|
||||
presenter.dispose();
|
||||
LOG.info("Closing the app");
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@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()) {
|
||||
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false);
|
||||
dispose();
|
||||
@@ -444,7 +449,7 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
}
|
||||
}
|
||||
};
|
||||
worker.execute();
|
||||
worker.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user