2018-01-18 03:13:08 +01:00
|
|
|
import { app, Menu, shell } from 'electron';
|
|
|
|
|
|
|
|
export default () => {
|
|
|
|
const template = [
|
2018-03-30 20:37:30 +02:00
|
|
|
{
|
|
|
|
label: 'File',
|
|
|
|
submenu: [{ role: 'quit', accelerator: 'CmdOrCtrl+Q' }],
|
|
|
|
},
|
2018-01-18 03:13:08 +01:00
|
|
|
{
|
|
|
|
label: 'Edit',
|
|
|
|
submenu: [
|
|
|
|
{ role: 'undo' },
|
|
|
|
{ role: 'redo' },
|
|
|
|
{ type: 'separator' },
|
|
|
|
{ role: 'cut' },
|
|
|
|
{ role: 'copy' },
|
|
|
|
{ role: 'paste' },
|
2019-09-03 17:48:53 +02:00
|
|
|
{ role: 'selectAll' },
|
2018-01-18 03:13:08 +01:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'View',
|
|
|
|
submenu: [
|
|
|
|
{ role: 'reload' },
|
|
|
|
{
|
|
|
|
label: 'Developer',
|
|
|
|
submenu: [{ role: 'forcereload' }, { role: 'toggledevtools' }],
|
|
|
|
},
|
|
|
|
{ type: 'separator' },
|
|
|
|
{ role: 'togglefullscreen' },
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'window',
|
|
|
|
submenu: [{ role: 'minimize' }, { role: 'close' }],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'help',
|
|
|
|
submenu: [
|
|
|
|
{
|
|
|
|
label: 'Learn More',
|
|
|
|
click: (menuItem, browserWindow) => {
|
|
|
|
if (browserWindow) {
|
|
|
|
browserWindow.webContents.send('open-menu', '/help');
|
|
|
|
} else {
|
2019-03-20 22:43:00 +01:00
|
|
|
shell.openExternal('https://lbry.com/faq');
|
2018-01-18 03:13:08 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Frequently Asked Questions',
|
|
|
|
click: () => {
|
2019-03-20 22:43:00 +01:00
|
|
|
shell.openExternal('https://lbry.com/faq');
|
2018-01-18 03:13:08 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{ type: 'separator' },
|
|
|
|
{
|
|
|
|
label: 'Report Issue',
|
|
|
|
click: () => {
|
2018-07-12 20:39:12 +02:00
|
|
|
shell.openExternal('https://github.com/lbryio/lbry-desktop/issues/new');
|
2018-01-18 03:13:08 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{ type: 'separator' },
|
|
|
|
{
|
|
|
|
label: 'Developer API Guide',
|
|
|
|
click: () => {
|
2018-11-15 20:27:19 +01:00
|
|
|
shell.openExternal('https://lbry.tech/playground');
|
2018-01-18 03:13:08 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const darwinTemplateAddition = {
|
2020-09-07 00:46:30 +02:00
|
|
|
label: app.name,
|
2018-01-18 03:13:08 +01:00
|
|
|
submenu: [
|
|
|
|
{ role: 'about' },
|
|
|
|
{ type: 'separator' },
|
|
|
|
{ role: 'services', submenu: [] },
|
|
|
|
{ type: 'separator' },
|
|
|
|
{ role: 'hide' },
|
|
|
|
{ role: 'hideothers' },
|
|
|
|
{ type: 'separator' },
|
|
|
|
{ role: 'quit' },
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
if (process.platform === 'darwin') {
|
|
|
|
template.unshift(darwinTemplateAddition);
|
|
|
|
}
|
|
|
|
|
|
|
|
const menu = Menu.buildFromTemplate(template);
|
|
|
|
Menu.setApplicationMenu(menu);
|
|
|
|
};
|