(htmlfile)
| 579 | } |
| 580 | |
| 581 | private async openZipFile(htmlfile) { |
| 582 | if (!htmlfile.name.toLowerCase().endsWith('.zip')) { |
| 583 | this.alertSystem.alert('Load project file', 'Projects can only be loaded from .zip files', {isError: true}); |
| 584 | return; |
| 585 | } |
| 586 | |
| 587 | this.multifileService.forEachFile((file: MultifileFile) => { |
| 588 | this.removeFile(file.fileId); |
| 589 | }); |
| 590 | |
| 591 | await this.multifileService.loadProjectFromFile(htmlfile, (file: MultifileFile) => { |
| 592 | this.refresh(); |
| 593 | if (file.filename === 'CMakeLists.txt') { |
| 594 | // todo: find a way to toggle on CMake checkbox... |
| 595 | this.editFile(file.fileId); |
| 596 | } |
| 597 | }); |
| 598 | } |
| 599 | |
| 600 | private async askForOverwriteAndDo(filename): Promise<void> { |
| 601 | return new Promise((resolve, reject) => { |
no test coverage detected