mirror of
https://github.com/LinoSchmidt/StickExporterTX.git
synced 2026-03-21 01:51:15 +01:00
Added warning message on exit while rendering
This commit is contained in:
@@ -7,6 +7,7 @@ import {imageLoading, imageLoaded} from "./ui/settingsSide";
|
|||||||
import { settingList } from "./settings";
|
import { settingList } from "./settings";
|
||||||
import isValid from "is-valid-path";
|
import isValid from "is-valid-path";
|
||||||
import { sideSetRendering } from "../renderer";
|
import { sideSetRendering } from "../renderer";
|
||||||
|
import { ipcRenderer } from "electron";
|
||||||
|
|
||||||
const blenderStartString = [
|
const blenderStartString = [
|
||||||
templatePath,
|
templatePath,
|
||||||
@@ -155,6 +156,14 @@ function blender(command:blenderCmd) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ipcRenderer.on("isRenderActiveClose", () => {
|
||||||
|
if(renderingPicture || renderingVideo) {
|
||||||
|
ipcRenderer.send("renderActiveClose");
|
||||||
|
} else {
|
||||||
|
ipcRenderer.send("renderInactiveClose");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export {
|
export {
|
||||||
blender,
|
blender,
|
||||||
blenderCmd,
|
blenderCmd,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ const logger = {
|
|||||||
|
|
||||||
dialog.showMessageBox({
|
dialog.showMessageBox({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
noLink: true,
|
||||||
buttons: ['Open Log', 'OK'],
|
buttons: ['Open Log', 'OK'],
|
||||||
defaultId: 1,
|
defaultId: 1,
|
||||||
title: 'Something went wrong!',
|
title: 'Something went wrong!',
|
||||||
|
|||||||
25
src/index.ts
25
src/index.ts
@@ -76,12 +76,35 @@ const createWindow = () => {
|
|||||||
mainWindow.loadFile(path.join(__dirname, 'index.html'));
|
mainWindow.loadFile(path.join(__dirname, 'index.html'));
|
||||||
|
|
||||||
ipcMain.on('closeApp', () => {
|
ipcMain.on('closeApp', () => {
|
||||||
app.quit();
|
mainWindow.webContents.send('isRenderActiveClose');
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on('minimize', () => {
|
ipcMain.on('minimize', () => {
|
||||||
mainWindow.minimize();
|
mainWindow.minimize();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcMain.on('renderInactiveClose', () => {
|
||||||
|
app.quit();
|
||||||
|
});
|
||||||
|
ipcMain.on('renderActiveClose', async () => {
|
||||||
|
const response = await dialog.showMessageBox({
|
||||||
|
type: 'warning',
|
||||||
|
noLink: true,
|
||||||
|
buttons: ['Cancel', 'Exit'],
|
||||||
|
defaultId: 0,
|
||||||
|
title: 'Close',
|
||||||
|
message: 'A video is still being renderd!',
|
||||||
|
detail:
|
||||||
|
'If you close the application, the progress will be lost!',
|
||||||
|
});
|
||||||
|
if (response.response === 1) {
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mainWindow.on('close', () => {
|
||||||
|
mainWindow.webContents.send('closeApp');
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// This method will be called when Electron has finished
|
// This method will be called when Electron has finished
|
||||||
|
|||||||
Reference in New Issue
Block a user