Jelajahi Sumber

Removes AutoSave Dialog at start of program

Fixes closing Dialog
TomTroppmann 3 tahun lalu
induk
melakukan
22601656a7

+ 2 - 0
src/holeg/ui/controller/CanvasController.java

@@ -22,6 +22,8 @@ import holeg.utility.math.vector.Vec2i;
  * 
  * @author Gruppe14
  */
+//TODO remove CanvasController and merge with NodeController
+@Deprecated
 public class CanvasController {
 
 	private Model model;

+ 1 - 38
src/holeg/ui/view/main/GUI.java

@@ -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.
 	 *