2018-01-22 23:38:06 +00:00
|
|
|
import { MenuItemConstructorOptions, shell } from 'electron';
|
2018-02-07 04:28:28 +00:00
|
|
|
import { APP_TITLE, REPOSITORY } from '../constants';
|
2018-05-09 03:06:35 +00:00
|
|
|
import packageJson from '../../package.json';
|
2018-01-22 23:38:06 +00:00
|
|
|
|
|
|
|
const MENU: MenuItemConstructorOptions[] = [
|
|
|
|
{
|
|
|
|
label: 'Edit',
|
|
|
|
submenu: [
|
|
|
|
{ role: 'undo' },
|
|
|
|
{ role: 'redo' },
|
|
|
|
{ type: 'separator' },
|
|
|
|
{ role: 'cut' },
|
|
|
|
{ role: 'copy' },
|
|
|
|
{ role: 'paste' },
|
|
|
|
{ role: 'pasteandmatchstyle' },
|
|
|
|
{ role: 'delete' },
|
|
|
|
{ role: 'selectall' }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'View',
|
|
|
|
submenu: [
|
|
|
|
{ role: 'reload' },
|
|
|
|
{ role: 'forcereload' },
|
|
|
|
{ type: 'separator' },
|
|
|
|
{ role: 'resetzoom' },
|
|
|
|
{ role: 'zoomin' },
|
|
|
|
{ role: 'zoomout' },
|
|
|
|
{ role: 'togglefullscreen' },
|
|
|
|
{ type: 'separator' },
|
|
|
|
{ role: 'toggledevtools' }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2018-05-09 03:06:35 +00:00
|
|
|
const HELP_MENU: MenuItemConstructorOptions = {
|
2018-01-22 23:38:06 +00:00
|
|
|
role: 'help',
|
|
|
|
submenu: [
|
2018-05-09 03:06:35 +00:00
|
|
|
{
|
2018-05-14 17:06:04 +00:00
|
|
|
label: `v${packageJson['electron-version']}`,
|
2018-05-09 03:06:35 +00:00
|
|
|
enabled: false
|
|
|
|
},
|
|
|
|
{ type: 'separator' },
|
2018-01-22 23:38:06 +00:00
|
|
|
{
|
|
|
|
label: 'Help / FAQ',
|
|
|
|
click() {
|
2018-02-12 20:43:07 +00:00
|
|
|
shell.openExternal('https://support.mycrypto.com/');
|
2018-01-22 23:38:06 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Report a Bug',
|
|
|
|
click() {
|
2018-02-07 04:28:28 +00:00
|
|
|
shell.openExternal(`${REPOSITORY}/issues/new`);
|
2018-01-22 23:38:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
if (process.platform === 'darwin') {
|
|
|
|
MENU.unshift({
|
2018-02-07 04:28:28 +00:00
|
|
|
label: APP_TITLE,
|
2018-01-22 23:38:06 +00:00
|
|
|
submenu: [
|
|
|
|
{ role: 'about' },
|
|
|
|
{ type: 'separator' },
|
|
|
|
{ role: 'hide' },
|
|
|
|
{ role: 'hideothers' },
|
|
|
|
{ role: 'unhide' },
|
|
|
|
{ type: 'separator' },
|
|
|
|
{ role: 'quit' }
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
|
|
|
// Modified help menu
|
|
|
|
MENU.push({
|
|
|
|
...HELP_MENU,
|
|
|
|
submenu: [
|
2018-05-09 03:06:35 +00:00
|
|
|
...(HELP_MENU.submenu as MenuItemConstructorOptions[]),
|
2018-01-22 23:38:06 +00:00
|
|
|
{
|
|
|
|
label: 'Speech',
|
|
|
|
submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
MENU.push(HELP_MENU);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default MENU;
|