Skip to content

Commit

Permalink
feat: 'about' dialog with version and logo
Browse files Browse the repository at this point in the history
Fixes #8
  • Loading branch information
marisademeglio authored and rdeltour committed Dec 23, 2018
1 parent 802ddf7 commit 002b927
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@daisy/ace-core": "^1.0.2",
"@material-ui/core": "^3.0.0",
"@material-ui/icons": "^3.0.0",
"about-window": "^1.12.1",
"electron-debug": "^2.0.0",
"@mrmlnc/readdir-enhanced": "^2.2.1",
"electron-redux": "^1.3.1",
Expand Down
7 changes: 5 additions & 2 deletions src/main/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from './../shared/actions/app';
import {selectTab} from './../shared/actions/reportView';
import * as FileDialogHelpers from './../shared/helpers/fileDialogs';
import * as AboutBoxHelper from './../shared/helpers/about';
export default class MenuBuilder {

constructor(mainWindow, store) {
Expand Down Expand Up @@ -201,7 +202,8 @@ export default class MenuBuilder {
submenu: [
{
label: 'About Ace',
click: () => dialog.showMessageBox({"message": "Ace Beta", "detail": "DAISY Consortium 2018"})
id: 'about',
click: () => AboutBoxHelper.showAbout()
},
{
type: 'separator'
Expand Down Expand Up @@ -270,7 +272,8 @@ export default class MenuBuilder {
},
{
label: 'About Ace',
click: () => dialog.showMessageBox({"message": "Ace Beta", "detail": "DAISY Consortium 2018"})
id: 'about',
click: () => AboutBoxHelper.showAbout()
}
);
}
Expand Down
16 changes: 16 additions & 0 deletions src/shared/helpers/about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const electron = require('electron');
const dialog = electron.dialog || electron.remote.dialog;
const BrowserWindow = electron.BrowserWindow || electron.remote.BrowserWindow;
const openAboutWindow = require('about-window').default;
const join = require('path').join;

module.exports = {
showAbout: callback => {
return openAboutWindow({
icon_path: join(__dirname, 'logo.svg'),
copyright: 'Copyright (c) 2018 DAISY Consortium',
package_json_dir: __dirname,
open_devtools: process.env.NODE_ENV !== 'production',
});
},
};

0 comments on commit 002b927

Please sign in to comment.