Load Default Test Project at Startup
All checks were successful
E2E Testing / test (push) Successful in 1m29s
All checks were successful
E2E Testing / test (push) Successful in 1m29s
This commit is contained in:
parent
b68d2a812c
commit
87368f4e65
26
app/main.ts
26
app/main.ts
@ -126,6 +126,11 @@ function createWindow(): BrowserWindow {
|
||||
]
|
||||
const menu = Menu.buildFromTemplate(menuTemplate);
|
||||
Menu.setApplicationMenu(menu)
|
||||
loadDevProjectAtStart()
|
||||
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
loadDevProjectAtStart()
|
||||
})
|
||||
|
||||
return win;
|
||||
}
|
||||
@ -160,6 +165,10 @@ try {
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (e) {
|
||||
// Catch Error
|
||||
// throw e;
|
||||
@ -179,13 +188,22 @@ function openProject() {
|
||||
})
|
||||
|
||||
if(selectedPaths != undefined) {
|
||||
projectDirectory = selectedPaths[0];
|
||||
console.log("Open Project-Directory: ", projectDirectory)
|
||||
const loadedProject = SaveProject.loadProject(projectDirectory)
|
||||
win!.webContents.send("open-project", loadedProject)
|
||||
openProjectFromFile(selectedPaths[0])
|
||||
}
|
||||
}
|
||||
|
||||
function loadDevProjectAtStart() {
|
||||
const projectDir = path.join(process.cwd(), "testModel/")
|
||||
openProjectFromFile(projectDir)
|
||||
}
|
||||
|
||||
function openProjectFromFile(openProjectDir: string) {
|
||||
projectDirectory = openProjectDir
|
||||
console.log("Open Project-Directory: ", openProjectDir)
|
||||
const loadedProject = SaveProject.loadProject(openProjectDir)
|
||||
win!.webContents.send("open-project", loadedProject)
|
||||
}
|
||||
|
||||
function saveProject() {
|
||||
win!.webContents.send('get-project-data')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user