mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-24 07:30:19 +01:00
added progress bar
This commit is contained in:
parent
30d69c8a63
commit
53518927e2
@ -490,6 +490,9 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
|
|||||||
|
|
||||||
const onData = (data: string) => {
|
const onData = (data: string) => {
|
||||||
logit("image upscayl: ", data.toString());
|
logit("image upscayl: ", data.toString());
|
||||||
|
|
||||||
|
mainWindow.setProgressBar(parseFloat(data.slice(0, data.length)) / 100);
|
||||||
|
|
||||||
data = data.toString();
|
data = data.toString();
|
||||||
mainWindow.webContents.send(commands.UPSCAYL_PROGRESS, data.toString());
|
mainWindow.webContents.send(commands.UPSCAYL_PROGRESS, data.toString());
|
||||||
if (data.includes("invalid gpu") || data.includes("failed")) {
|
if (data.includes("invalid gpu") || data.includes("failed")) {
|
||||||
@ -508,6 +511,7 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
|
|||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
if (failed !== true) {
|
if (failed !== true) {
|
||||||
logit("Done upscaling");
|
logit("Done upscaling");
|
||||||
|
mainWindow.setProgressBar(-1);
|
||||||
mainWindow.webContents.send(
|
mainWindow.webContents.send(
|
||||||
commands.UPSCAYL_DONE,
|
commands.UPSCAYL_DONE,
|
||||||
isAlpha ? outFile + ".png" : outFile
|
isAlpha ? outFile + ".png" : outFile
|
||||||
|
Loading…
Reference in New Issue
Block a user