(self)
| 93 | self.editor_gui.title("ArtGUI Definition Editior "+self.sessionfile) |
| 94 | |
| 95 | def LoadFromFile(self): |
| 96 | file_path = filedialog.askopenfilename(filetypes=[(self.fileext+" files", "*."+self.fileext), ("All files", "*.*")]) |
| 97 | |
| 98 | if file_path: |
| 99 | try: |
| 100 | with open(file_path, 'r') as file: |
| 101 | self.data = json.load(file) |
| 102 | self.clear_all() |
| 103 | self.insert_json("", self.data) |
| 104 | |
| 105 | self.sessionfile = file_path |
| 106 | self.editor_gui.title("ArtGUI Definition Editior "+self.sessionfile) |
| 107 | |
| 108 | except Exception as e: |
| 109 | tk.messagebox.showerror("Error", f"Failed to load JSON file:\n{e}") |
| 110 | |
| 111 | |
| 112 |
nothing calls this directly
no test coverage detected