|
|
@ -8,6 +8,7 @@ import {
|
|
|
|
BrowserWindow,
|
|
|
|
BrowserWindow,
|
|
|
|
ipcMain,
|
|
|
|
ipcMain,
|
|
|
|
dialog,
|
|
|
|
dialog,
|
|
|
|
|
|
|
|
Tray,
|
|
|
|
globalShortcut,
|
|
|
|
globalShortcut,
|
|
|
|
} from "electron";
|
|
|
|
} from "electron";
|
|
|
|
import { createProtocol } from "vue-cli-plugin-electron-builder/lib";
|
|
|
|
import { createProtocol } from "vue-cli-plugin-electron-builder/lib";
|
|
|
@ -25,20 +26,26 @@ let win;
|
|
|
|
protocol.registerSchemesAsPrivileged([
|
|
|
|
protocol.registerSchemesAsPrivileged([
|
|
|
|
{ scheme: "app", privileges: { secure: true, standard: true } },
|
|
|
|
{ scheme: "app", privileges: { secure: true, standard: true } },
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
const iconString = path.join(__static, "img/icons/apple-touch-icon.png")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let bounceId = app.dock.bounce()
|
|
|
|
|
|
|
|
// app.dock.setBadge('Yes Play Music')
|
|
|
|
|
|
|
|
app.dock.setIcon(iconString)
|
|
|
|
function createWindow() {
|
|
|
|
function createWindow() {
|
|
|
|
require('./electron/services')
|
|
|
|
require('./electron/services')
|
|
|
|
|
|
|
|
// TODO Set the tray icon, need a white icon
|
|
|
|
|
|
|
|
// const trayIcon = path.join(__static, "img/icons/32x32.png")
|
|
|
|
|
|
|
|
// const tray = new Tray(trayIcon)
|
|
|
|
// Create the browser window.
|
|
|
|
// Create the browser window.
|
|
|
|
win = new BrowserWindow({
|
|
|
|
win = new BrowserWindow({
|
|
|
|
width: 1440,
|
|
|
|
width: 1440,
|
|
|
|
height: 768,
|
|
|
|
height: 768,
|
|
|
|
|
|
|
|
icon: iconString,
|
|
|
|
webPreferences: {
|
|
|
|
webPreferences: {
|
|
|
|
webSecurity: false,
|
|
|
|
webSecurity: false,
|
|
|
|
// See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
|
|
|
|
// See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
|
|
|
|
nodeIntegration: true,
|
|
|
|
nodeIntegration: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
icon: path.join(__static, "./img/icons/android-chrome-512x512.png"),
|
|
|
|
|
|
|
|
preload: path.join(__dirname, "./electron/preload.js"),
|
|
|
|
preload: path.join(__dirname, "./electron/preload.js"),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -50,6 +57,8 @@ function createWindow() {
|
|
|
|
createProtocol("app");
|
|
|
|
createProtocol("app");
|
|
|
|
// Load the index.html when not in development
|
|
|
|
// Load the index.html when not in development
|
|
|
|
win.loadURL("app://./index.html");
|
|
|
|
win.loadURL("app://./index.html");
|
|
|
|
|
|
|
|
app.dock.cancelBounce(bounceId)
|
|
|
|
|
|
|
|
|
|
|
|
// autoUpdater.checkForUpdatesAndNotify()
|
|
|
|
// autoUpdater.checkForUpdatesAndNotify()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -58,6 +67,8 @@ function createWindow() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Quit when all windows are closed.
|
|
|
|
// Quit when all windows are closed.
|
|
|
|
app.on("window-all-closed", () => {
|
|
|
|
app.on("window-all-closed", () => {
|
|
|
|
// On macOS it is common for applications and their menu bar
|
|
|
|
// On macOS it is common for applications and their menu bar
|
|
|
|