|
19 | 19 |
|
20 | 20 | import org.idaesbasic.controllers.todolist.TodolistController; |
21 | 21 |
|
22 | | -import com.github.cliftonlabs.json_simple.JsonException; |
23 | | -import com.github.cliftonlabs.json_simple.JsonObject; |
24 | | -import com.github.cliftonlabs.json_simple.Jsoner; |
25 | | - |
26 | 22 | import javafx.application.Platform; |
27 | 23 | import javafx.event.ActionEvent; |
28 | 24 | import javafx.fxml.FXML; |
@@ -67,12 +63,12 @@ public class MainController { |
67 | 63 |
|
68 | 64 | @FXML |
69 | 65 | void initialize() { |
70 | | - try { |
71 | | - loadProjectList(); |
72 | | - } catch (IOException | JsonException e1) { |
73 | | - // TODO Auto-generated catch block |
74 | | - e1.printStackTrace(); |
75 | | - } |
| 66 | +// try { |
| 67 | +// loadProjectList(); |
| 68 | +// } catch (IOException | JsonException e1) { |
| 69 | +// // TODO Auto-generated catch block |
| 70 | +// e1.printStackTrace(); |
| 71 | +// } |
76 | 72 | // Set date from date button |
77 | 73 | dateButton.setText(LocalDate.now().toString()); |
78 | 74 | Timer timer = new Timer(); |
@@ -372,36 +368,36 @@ void addViewToCurrentTab(Node view) { |
372 | 368 | } |
373 | 369 |
|
374 | 370 | void saveProjectList() throws IOException { |
375 | | - //Saves the registered projects in an json file |
376 | | - //Create json |
377 | | - JsonObject json = new JsonObject(); |
378 | | - json.put("registeredProjects", registered_projects); |
379 | | - //Write json to file |
380 | | - String userDirectoryPath = System.getProperty("user.home") + "/.ideasbasic"; |
381 | | - Path userDirectory = Paths.get(userDirectoryPath); |
382 | | - if (!Files.exists(userDirectory)) { |
383 | | - Files.createDirectory(userDirectory); |
384 | | - } |
385 | | - Path file = Paths.get(userDirectoryPath + "/config.json"); |
386 | | - if (!Files.exists(file)) { |
387 | | - Files.createFile(file); |
388 | | - } |
389 | | - Files.writeString(file, json.toJson()); |
| 371 | +// //Saves the registered projects in an json file |
| 372 | +// //Create json |
| 373 | +// JsonObject json = new JsonObject(); |
| 374 | +// json.put("registeredProjects", registered_projects); |
| 375 | +// //Write json to file |
| 376 | +// String userDirectoryPath = System.getProperty("user.home") + "/.ideasbasic"; |
| 377 | +// Path userDirectory = Paths.get(userDirectoryPath); |
| 378 | +// if (!Files.exists(userDirectory)) { |
| 379 | +// Files.createDirectory(userDirectory); |
| 380 | +// } |
| 381 | +// Path file = Paths.get(userDirectoryPath + "/config.json"); |
| 382 | +// if (!Files.exists(file)) { |
| 383 | +// Files.createFile(file); |
| 384 | +// } |
| 385 | +// Files.writeString(file, json.toJson()); |
390 | 386 | } |
391 | 387 |
|
392 | | - void loadProjectList() throws IOException, JsonException { |
| 388 | + void loadProjectList() throws IOException { |
393 | 389 | //Read the config.json file |
394 | | - String userDirectoryPath = System.getProperty("user.home") + "/.ideasbasic"; |
395 | | - Path userDirectory = Paths.get(userDirectoryPath); |
396 | | - if(Files.exists(userDirectory)) { |
397 | | - Reader reader = Files.newBufferedReader(Paths.get(userDirectoryPath + "/config.json")); |
398 | | - JsonObject parser = (JsonObject) Jsoner.deserialize(reader); |
399 | | - //Get the registered projects from parser |
400 | | - registered_projects = (List<String>) parser.get("registeredProjects"); |
401 | | - //Create the listmenu |
402 | | - createProjectList(); |
403 | | - } |
404 | | - |
| 390 | +// String userDirectoryPath = System.getProperty("user.home") + "/.ideasbasic"; |
| 391 | +// Path userDirectory = Paths.get(userDirectoryPath); |
| 392 | +// if(Files.exists(userDirectory)) { |
| 393 | +// Reader reader = Files.newBufferedReader(Paths.get(userDirectoryPath + "/config.json")); |
| 394 | +// JsonObject parser = (JsonObject) Jsoner.deserialize(reader); |
| 395 | +// //Get the registered projects from parser |
| 396 | +// registered_projects = (List<String>) parser.get("registeredProjects"); |
| 397 | +// //Create the listmenu |
| 398 | +// createProjectList(); |
| 399 | +// } |
| 400 | +// |
405 | 401 | } |
406 | 402 |
|
407 | 403 | Tab get_current_tab() { |
|
0 commit comments