|
@@ -297,9 +297,8 @@ public class GUI {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- System.exit(1);
|
|
|
+ System.exit(0);
|
|
|
}
|
|
|
- System.exit(0);
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -1265,32 +1264,6 @@ public class GUI {
|
|
|
} catch (IOException e1) {
|
|
|
}
|
|
|
|
|
|
- String autoPath = System.getProperty("user.home") + "/.config/HolonGUI/Autosave/";
|
|
|
- File dest = new File(autoPath);
|
|
|
- ArrayList<File> oldAutoSaves = control.filterOldAutoSaveFiles();
|
|
|
- int nrOfOldSaves = oldAutoSaves.size();
|
|
|
-
|
|
|
- if (nrOfOldSaves > 0) {
|
|
|
- int dialogButton = JOptionPane.YES_NO_OPTION;
|
|
|
- int dialogResult = JOptionPane.showConfirmDialog(holegJFrame,
|
|
|
- "Old autosave file was found, should it be loaded?", warningText, dialogButton);
|
|
|
- if (dialogResult == JOptionPane.YES_OPTION) {
|
|
|
- if (dest.exists()) {
|
|
|
- GuiSettings.autoSaveNr = (nrOfOldSaves - 1);
|
|
|
- mntmRedo.doClick();
|
|
|
- } else {
|
|
|
- JOptionPane.showMessageDialog(holegJFrame, "Autosave could not be loaded.");
|
|
|
- setUpAutoSave(dest);
|
|
|
- }
|
|
|
- } else {
|
|
|
- setUpAutoSave(dest);
|
|
|
- }
|
|
|
-
|
|
|
- // after all: delete the obsolete/old autosave files from the
|
|
|
- // directory
|
|
|
- control.deleteObsoleteAutoSaveFiles();
|
|
|
- }
|
|
|
-
|
|
|
canvasSP.addComponentListener(new ComponentAdapter() {
|
|
|
@Override
|
|
|
public void componentResized(ComponentEvent e) {
|
|
@@ -1354,16 +1327,6 @@ public class GUI {
|
|
|
return isUpperPanelVisible;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Sets up autosave if no old one is loaded at the beginning
|
|
|
- *
|
|
|
- * @param dest path to save-folder
|
|
|
- */
|
|
|
- private void setUpAutoSave(File dest) {
|
|
|
- dest.mkdirs();
|
|
|
- control.tryAutoSave();
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* reloads the Categories from Model.
|
|
|
*
|