From 8046c0882ac3527d7d5040e9fab58338eb983b28 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Tue, 17 Apr 2018 22:34:09 +0900 Subject: [PATCH] refs #235 Add about window for linux and windows --- package-lock.json | 5 +++++ package.json | 1 + src/main/index.js | 13 +++++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 39728cdd..32007b26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,6 +62,11 @@ "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", "dev": true }, + "about-window": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/about-window/-/about-window-1.11.0.tgz", + "integrity": "sha512-L8bNfM/EBSrEntLqAXFLJbu9uV0TIb6di3BEgwo4KjFzMkEk25r987Vz6gj5CvELb5JR5wrlcoz8xouLGiVFwg==" + }, "accepts": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", diff --git a/package.json b/package.json index 2182f837..c914c047 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ } }, "dependencies": { + "about-window": "^1.11.0", "axios": "^0.18.0", "electron-json-storage": "^4.0.2", "electron-log": "^2.2.14", diff --git a/src/main/index.js b/src/main/index.js index b3f0da66..0cbaa849 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -7,6 +7,7 @@ import log from 'electron-log' import windowStateKeeper from 'electron-window-state' import simplayer from 'simplayer' import path from 'path' +import openAboutWindow from 'about-window' import Authentication from './auth' import Account from './account' @@ -84,7 +85,15 @@ function createWindow () { submenu: [ { label: 'About Whalebird', - role: 'about' + role: 'about', + click: () => { + openAboutWindow({ + icon_path: path.resolve(__dirname, '../../build/icons/256x256.png'), + copyright: 'Copyright (c) 2018 AkiraFukushima', + package_json_dir: path.resolve(__dirname, '../../'), + open_devtools: process.env.NODE_ENV !== 'production' + }) + } }, { type: 'separator' @@ -203,7 +212,7 @@ function createWindow () { width: mainWindowState.width, height: mainWindowState.height, useContentSize: true, - icon: path.join(__dirname, '../../build/icons/256x256.png') + icon: path.resolve(__dirname, '../../build/icons/256x256.png') }) mainWindowState.manage(mainWindow)