Do not set overlay icons when downloading
This commit is contained in:
28
app/main.js
28
app/main.js
@@ -67,12 +67,6 @@ function createWindow() {
|
|||||||
ElectronDl({
|
ElectronDl({
|
||||||
dlPath: "./downloads",
|
dlPath: "./downloads",
|
||||||
onStarted: (item) => {
|
onStarted: (item) => {
|
||||||
BrowserWindow.getAllWindows().forEach((window) => {
|
|
||||||
window.setOverlayIcon(
|
|
||||||
__dirname + "/assets/icons/download.png",
|
|
||||||
"Downloading"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
dialog.showMessageBox({
|
dialog.showMessageBox({
|
||||||
type: "info",
|
type: "info",
|
||||||
title: "Downloading File",
|
title: "Downloading File",
|
||||||
@@ -81,23 +75,12 @@ ElectronDl({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onCompleted: () => {
|
onCompleted: () => {
|
||||||
BrowserWindow.getAllWindows().forEach((window) => {
|
|
||||||
window.setOverlayIcon(
|
|
||||||
__dirname + "/assets/icons/download-success.png",
|
|
||||||
"Download Successful"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
dialog.showMessageBox({
|
dialog.showMessageBox({
|
||||||
type: "info",
|
type: "info",
|
||||||
title: "Download Completed",
|
title: "Download Completed",
|
||||||
message: `Downloading Completed! Please check your "Downloads" folder.`,
|
message: `Downloading Completed! Please check your "Downloads" folder.`,
|
||||||
buttons: ["OK"],
|
buttons: ["OK"],
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
|
||||||
BrowserWindow.getAllWindows().forEach((window) => {
|
|
||||||
window.setOverlayIcon(null, "");
|
|
||||||
});
|
|
||||||
}, 7000);
|
|
||||||
},
|
},
|
||||||
onError: (item) => {
|
onError: (item) => {
|
||||||
dialog.showMessageBox({
|
dialog.showMessageBox({
|
||||||
@@ -106,17 +89,6 @@ ElectronDl({
|
|||||||
message: `Downloading "${item.getFilename()}" failed :(`,
|
message: `Downloading "${item.getFilename()}" failed :(`,
|
||||||
buttons: ["OK"],
|
buttons: ["OK"],
|
||||||
});
|
});
|
||||||
BrowserWindow.getAllWindows().forEach((window) => {
|
|
||||||
window.setOverlayIcon(
|
|
||||||
__dirname + "/download-fail.png",
|
|
||||||
"Download Failed"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
BrowserWindow.getAllWindows().forEach((window) => {
|
|
||||||
window.setOverlayIcon(null, "");
|
|
||||||
});
|
|
||||||
}, 7000);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.2 KiB |
Reference in New Issue
Block a user