1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-30 18:24:27 +01:00

Merge branch 'main' into temporary-release

This commit is contained in:
NayamAmarshe 2022-08-23 18:08:57 +05:30 committed by GitHub
commit 8fafe81f77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 41 deletions

View File

View File

@ -29,10 +29,11 @@ app.on("ready", async () => {
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 1100, width: 1100,
height: 700, height: 850,
minHeight: 500, minHeight: 500,
minWidth: 500, minWidth: 500,
webPreferences: { webPreferences: {
devTools: isDev,
autoHideMenuBar: true, autoHideMenuBar: true,
nodeIntegration: true, nodeIntegration: true,
webSecurity: false, webSecurity: false,
@ -58,7 +59,7 @@ app.on("ready", async () => {
if (!isDev) { if (!isDev) {
autoUpdater.checkForUpdates(); autoUpdater.checkForUpdates();
}; }
}); });
// Quit the app once all windows are closed // Quit the app once all windows are closed
@ -154,26 +155,25 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
autoUpdater.on("update-available", (_event, releaseNotes, releaseName) => { autoUpdater.on("update-available", (_event, releaseNotes, releaseName) => {
const dialogOpts = { const dialogOpts = {
type: 'info', type: "info",
buttons: ['Ok'], buttons: ["Ok"],
title: 'Application Update', title: "Application Update",
message: process.platform === 'win32' ? releaseNotes : releaseName, message: process.platform === "win32" ? releaseNotes : releaseName,
detail: 'A new version is being downloaded.' detail: "A new version is being downloaded.",
} };
dialog.showMessageBox(dialogOpts, (response) => { dialog.showMessageBox(dialogOpts, (response) => {});
});
});
})
autoUpdater.on("update-downloaded", (_event, releaseNotes, releaseName) => { autoUpdater.on("update-downloaded", (_event, releaseNotes, releaseName) => {
const dialogOpts = { const dialogOpts = {
type: 'info', type: "info",
buttons: ['Restart', 'Later'], buttons: ["Restart", "Later"],
title: 'Application Update', title: "Application Update",
message: process.platform === 'win32' ? releaseNotes : releaseName, message: process.platform === "win32" ? releaseNotes : releaseName,
detail: 'A new version has been downloaded. Restart the application to apply the updates.' detail:
"A new version has been downloaded. Restart the application to apply the updates.",
}; };
dialog.showMessageBox(dialogOpts).then((returnValue) => { dialog.showMessageBox(dialogOpts).then((returnValue) => {
if (returnValue.response === 0) autoUpdater.quitAndInstall() if (returnValue.response === 0) autoUpdater.quitAndInstall();
}) });
}); });

View File

@ -48,9 +48,6 @@
"**/node_modules/sharp/**" "**/node_modules/sharp/**"
] ]
}, },
"snap": {
"confinement": "classic"
},
"files": [ "files": [
"main", "main",
"renderer/out" "renderer/out"

View File

@ -43,14 +43,9 @@ const Home = () => {
} }
}; };
const handleCheck = (e) => { const handleModelChange = (e) => {
if (e.target.checked) { setModel(e.target.value);
setModel("realesrgan-x4plus-anime") };
}
else {
setModel("realesrgan-x4plus")
}
}
const outputHandler = async () => { const outputHandler = async () => {
var path = await window.electron.invoke(commands.SELECT_FOLDER); var path = await window.electron.invoke(commands.SELECT_FOLDER);
@ -71,10 +66,6 @@ const Home = () => {
}); });
}; };
useEffect(() => {
console.log(progress);
}, [progress]);
return ( return (
<div className="flex h-screen w-screen flex-row overflow-hidden bg-neutral-900"> <div className="flex h-screen w-screen flex-row overflow-hidden bg-neutral-900">
<div className="flex h-screen w-96 flex-col bg-neutral-800"> <div className="flex h-screen w-96 flex-col bg-neutral-800">
@ -96,12 +87,26 @@ const Home = () => {
Select Image Select Image
</button> </button>
</div> </div>
<input className="appearance-none h-4 w-4 border border-gray-300 rounded-sm bg-white checked:bg-blue-600 checked:border-blue-600 focus:outline-none transition duration-200 mt-1 align-top bg-no-repeat bg-center bg-contain float-left mr-2 cursor-pointer" type="checkbox" onChange={handleCheck}/>
<label className="text-neutral-100" >Anime</label>
{/* STEP 2 */} {/* STEP 2 */}
<div className="mt-10"> <div className="mt-10">
<p className="font-medium text-neutral-100">Step 2</p> <p className="font-medium text-neutral-100">Step 2</p>
<p className="mb-2 text-sm text-neutral-400">
Select Upscaling Type
</p>
<select
name="select-model"
className="rounded-lg bg-slate-300 p-3"
onChange={handleModelChange}
>
<option value="realesrgan-x4plus">General Image</option>
<option value="realesrgan-x4plus-anime">Digital Image</option>
</select>
</div>
{/* STEP 3 */}
<div className="mt-10">
<p className="font-medium text-neutral-100">Step 3</p>
<p className="mb-2 text-sm text-neutral-400">Select Scale Factor</p> <p className="mb-2 text-sm text-neutral-400">Select Scale Factor</p>
<div className="animate flex flex-row gap-2"> <div className="animate flex flex-row gap-2">
<button <button
@ -124,16 +129,16 @@ const Home = () => {
className={`h-12 w-12 rounded-lg ${ className={`h-12 w-12 rounded-lg ${
scaleFactor === 4 ? "bg-yellow-400" : "bg-neutral-400" scaleFactor === 4 ? "bg-yellow-400" : "bg-neutral-400"
}`} }`}
onClick={() => setScaleFactor(6)} onClick={() => setScaleFactor(4)}
> >
4x 4x
</button> </button>
</div> </div>
</div> </div>
{/* STEP 3 */} {/* STEP 4 */}
<div className="mt-10"> <div className="mt-10">
<p className="font-medium text-neutral-100">Step 3</p> <p className="font-medium text-neutral-100">Step 4</p>
<p className="mb-2 text-sm text-neutral-400"> <p className="mb-2 text-sm text-neutral-400">
Defaults to Image's path Defaults to Image's path
</p> </p>
@ -145,9 +150,9 @@ const Home = () => {
</button> </button>
</div> </div>
{/* STEP 4 */} {/* STEP 5 */}
<div className="mt-10"> <div className="mt-10">
<p className="mb-2 font-medium text-neutral-100">Step 4</p> <p className="mb-2 font-medium text-neutral-100">Step 5</p>
<button <button
className="rounded-lg bg-sky-400 p-3" className="rounded-lg bg-sky-400 p-3"
onClick={upscaylHandler} onClick={upscaylHandler}