1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-23 23:21:05 +01:00

added batch interface and completion button

This commit is contained in:
TGS963 2022-09-18 20:00:03 +05:30
parent 55a8389593
commit cbb2595c8f
3 changed files with 48 additions and 26 deletions

View File

@ -11,6 +11,7 @@ const commands = {
FOLDER_UPSCAYL_DONE: "Folder upscaling successful",
FOLDER_UPSCAYL_PROGRESS:
"Send Folder Upscaling Progress from Main to Renderer",
OPEN_FOLDER: "Open Folder",
};
module.exports = commands;

View File

@ -342,6 +342,11 @@ ipcMain.on(commands.FOLDER_UPSCAYL, async (event, payload) => {
});
});
ipcMain.on(commands.OPEN_FOLDER, async (event, payload) => {
console.log(payload);
shell.openPath(payload);
});
//------------------------Auto-Update Code-----------------------------//
// ! AUTO UPDATE STUFF
autoUpdater.on("update-available", (_event, releaseNotes, releaseName) => {

View File

@ -133,6 +133,9 @@ const Home = () => {
e.preventDefault();
console.log("drag over");
};
const openFolderHandler = (e) => {
window.electron.send(commands.OPEN_FOLDER, upscaledBatchFolderPath);
};
const allowedFileTypes = ["png", "jpg", "jpeg", "webp"];
@ -270,8 +273,9 @@ const Home = () => {
{imagePath.length === 0 && batchFolderPath.length === 0 ? (
<RightPaneInfo version={version} />
) : !batchMode ? (
upscaledImagePath.length === 0 ? (
) : upscaledImagePath.length === 0 &&
upscaledBatchFolderPath.length === 0 ? (
!batchMode ? (
<img
className="h-full w-full object-contain"
src={
@ -282,6 +286,11 @@ const Home = () => {
alt=""
/>
) : (
<p className="select-none font-bold text-neutral-50">
Selected folder: {batchFolderPath}
</p>
)
) : !batchMode ? (
<ReactCompareSlider
itemOne={
<ReactCompareSliderImage
@ -303,11 +312,18 @@ const Home = () => {
}
className="h-screen"
/>
)
) : (
<p className="select-none font-bold text-neutral-50">
<>
<p className="select-none py-4 font-bold text-neutral-50">
Finished Upscaling Folder!
</p>
<button
className="rounded-lg bg-blue-400 p-3 font-medium text-white/90 transition-colors"
onClick={openFolderHandler}
>
Open Upscayled Folder
</button>
</>
)}
</div>
</div>