2022-11-23 10:00:00 +01:00
|
|
|
const electron = require('electron');
|
2023-02-18 16:11:17 +01:00
|
|
|
const { t } = require('i18next');
|
2016-10-30 11:57:12 +01:00
|
|
|
|
2023-02-06 07:33:02 +01:00
|
|
|
// menu-safe i18n.t:
|
|
|
|
// https://github.com/mifi/lossless-cut/issues/1456
|
2023-02-18 16:11:17 +01:00
|
|
|
const esc = (val) => val.replace(/&/g, '&&');
|
2023-02-06 07:33:02 +01:00
|
|
|
|
2018-09-30 22:08:36 +02:00
|
|
|
const { Menu } = electron;
|
2016-10-30 11:57:12 +01:00
|
|
|
|
2021-12-01 18:19:37 +01:00
|
|
|
const { homepage, getReleaseUrl, licensesPage } = require('./constants');
|
2016-10-30 11:57:12 +01:00
|
|
|
|
2023-02-15 06:59:48 +01:00
|
|
|
module.exports = ({ app, mainWindow, newVersion, isStoreBuild }) => {
|
2020-03-26 12:04:36 +01:00
|
|
|
const menu = [
|
|
|
|
...(process.platform === 'darwin' ? [{ role: 'appMenu' }] : []),
|
2016-10-30 11:57:12 +01:00
|
|
|
|
2020-03-26 12:04:36 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('File')),
|
2020-03-26 12:04:36 +01:00
|
|
|
submenu: [
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Open')),
|
2020-03-26 12:04:36 +01:00
|
|
|
accelerator: 'CmdOrCtrl+O',
|
|
|
|
async click() {
|
2022-06-08 04:41:00 +02:00
|
|
|
mainWindow.webContents.send('openFilesDialog');
|
2020-03-26 12:04:36 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Close')),
|
2020-03-26 12:04:36 +01:00
|
|
|
accelerator: 'CmdOrCtrl+W',
|
|
|
|
async click() {
|
2022-02-23 12:43:19 +01:00
|
|
|
mainWindow.webContents.send('closeCurrentFile');
|
2020-03-26 12:04:36 +01:00
|
|
|
},
|
|
|
|
},
|
2021-08-28 16:47:43 +02:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Close batch')),
|
2021-08-28 16:47:43 +02:00
|
|
|
async click() {
|
2022-02-23 12:43:19 +01:00
|
|
|
mainWindow.webContents.send('closeBatchFiles');
|
2021-08-28 16:47:43 +02:00
|
|
|
},
|
|
|
|
},
|
2020-03-26 12:04:36 +01:00
|
|
|
{ type: 'separator' },
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Import project (LLC)...')),
|
2020-03-26 12:04:36 +01:00
|
|
|
click() {
|
2021-08-24 11:21:26 +02:00
|
|
|
mainWindow.webContents.send('importEdlFile', 'llc');
|
2020-03-26 12:04:36 +01:00
|
|
|
},
|
|
|
|
},
|
2020-12-11 16:15:35 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Export project (LLC)...')),
|
2020-12-11 16:15:35 +01:00
|
|
|
click() {
|
2021-08-24 11:21:26 +02:00
|
|
|
mainWindow.webContents.send('exportEdlFile', 'llc');
|
2020-12-11 16:15:35 +01:00
|
|
|
},
|
|
|
|
},
|
2020-11-18 21:24:20 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Import project')),
|
2020-11-18 21:24:20 +01:00
|
|
|
submenu: [
|
2021-08-24 11:21:26 +02:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Times in seconds (CSV)')),
|
2021-08-24 11:21:26 +02:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('importEdlFile', 'csv');
|
|
|
|
},
|
|
|
|
},
|
2022-02-14 05:08:57 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Frame numbers (CSV)')),
|
2022-02-14 05:08:57 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('importEdlFile', 'csv-frames');
|
|
|
|
},
|
|
|
|
},
|
2021-02-21 19:12:25 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('EDL (MPlayer)')),
|
2021-02-21 19:12:25 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('importEdlFile', 'mplayer');
|
|
|
|
},
|
|
|
|
},
|
2020-11-19 22:51:17 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Text chapters / YouTube')),
|
2020-11-19 22:51:17 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('importEdlFile', 'youtube');
|
|
|
|
},
|
|
|
|
},
|
2020-11-18 21:24:20 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('DaVinci Resolve / Final Cut Pro XML')),
|
2020-11-18 21:24:20 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('importEdlFile', 'xmeml');
|
|
|
|
},
|
|
|
|
},
|
2022-07-17 23:36:57 +02:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Final Cut Pro FCPX / FCPXML')),
|
2022-07-17 23:36:57 +02:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('importEdlFile', 'fcpxml');
|
|
|
|
},
|
|
|
|
},
|
2020-11-19 22:51:17 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('CUE sheet file')),
|
2020-11-19 22:51:17 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('importEdlFile', 'cue');
|
|
|
|
},
|
|
|
|
},
|
2020-12-08 17:10:31 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('PotPlayer Bookmarks (.pbf)')),
|
2020-12-08 17:10:31 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('importEdlFile', 'pbf');
|
|
|
|
},
|
|
|
|
},
|
2020-11-18 21:24:20 +01:00
|
|
|
],
|
|
|
|
},
|
2020-12-14 17:29:07 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Export project')),
|
2020-12-14 17:29:07 +01:00
|
|
|
submenu: [
|
2021-08-24 11:21:26 +02:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Times in seconds (CSV)')),
|
2021-08-24 11:21:26 +02:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('exportEdlFile', 'csv');
|
|
|
|
},
|
|
|
|
},
|
2020-12-14 17:29:07 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Timestamps (CSV)')),
|
2020-12-14 17:29:07 +01:00
|
|
|
click() {
|
2020-12-15 00:49:08 +01:00
|
|
|
mainWindow.webContents.send('exportEdlFile', 'csv-human');
|
|
|
|
},
|
|
|
|
},
|
2022-01-14 10:55:56 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Frame numbers (CSV)')),
|
2022-01-14 10:55:56 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('exportEdlFile', 'csv-frames');
|
|
|
|
},
|
|
|
|
},
|
2020-12-15 00:49:08 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Timestamps (TSV/TXT)')),
|
2020-12-15 00:49:08 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('exportEdlFile', 'tsv-human');
|
2020-12-14 17:29:07 +01:00
|
|
|
},
|
|
|
|
},
|
2021-02-19 13:46:08 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Start times as YouTube Chapters')),
|
2021-02-19 13:46:08 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('exportEdlYouTube');
|
|
|
|
},
|
|
|
|
},
|
2020-12-14 17:29:07 +01:00
|
|
|
],
|
|
|
|
},
|
2020-03-26 12:04:36 +01:00
|
|
|
{ type: 'separator' },
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Convert to supported format')),
|
2020-03-26 12:04:36 +01:00
|
|
|
click() {
|
2020-04-07 16:03:33 +02:00
|
|
|
mainWindow.webContents.send('html5ify');
|
2020-03-26 12:04:36 +01:00
|
|
|
},
|
|
|
|
},
|
2020-11-22 23:53:04 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Fix incorrect duration')),
|
2020-11-22 23:53:04 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('fixInvalidDuration');
|
|
|
|
},
|
|
|
|
},
|
2020-03-26 12:04:36 +01:00
|
|
|
{ type: 'separator' },
|
2020-12-11 16:15:35 +01:00
|
|
|
|
2020-03-26 12:04:36 +01:00
|
|
|
{ type: 'separator' },
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Settings')),
|
2021-04-18 13:04:53 +02:00
|
|
|
accelerator: 'CmdOrCtrl+,',
|
2020-03-26 12:04:36 +01:00
|
|
|
click() {
|
2022-02-23 12:43:19 +01:00
|
|
|
mainWindow.webContents.send('toggleSettings');
|
2020-03-26 12:04:36 +01:00
|
|
|
},
|
|
|
|
},
|
2022-08-12 11:37:39 +02:00
|
|
|
// Due to Apple Review Guidelines, we cannot include an Exit menu item here
|
|
|
|
// Apple has their own Quit from the app menu
|
|
|
|
...(process.platform !== 'darwin' ? [
|
|
|
|
{ type: 'separator' },
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Exit')),
|
2022-08-12 11:37:39 +02:00
|
|
|
click() {
|
|
|
|
app.quit();
|
|
|
|
},
|
2020-03-26 12:04:36 +01:00
|
|
|
},
|
2022-08-12 11:37:39 +02:00
|
|
|
] : []),
|
2020-03-26 12:04:36 +01:00
|
|
|
],
|
2020-02-20 11:41:01 +01:00
|
|
|
},
|
|
|
|
|
2020-03-26 12:04:36 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Edit')),
|
2020-03-26 12:04:36 +01:00
|
|
|
submenu: [
|
2022-06-08 03:44:05 +02:00
|
|
|
// https://github.com/mifi/lossless-cut/issues/610
|
|
|
|
// https://github.com/mifi/lossless-cut/issues/1183
|
2023-02-18 16:11:17 +01:00
|
|
|
{ role: 'undo', label: esc(t('Undo')) },
|
|
|
|
{ role: 'redo', label: esc(t('Redo')) },
|
2020-03-26 12:04:36 +01:00
|
|
|
{ type: 'separator' },
|
2023-02-18 16:11:17 +01:00
|
|
|
{ role: 'cut', label: esc(t('Cut')) },
|
|
|
|
{ role: 'copy', label: esc(t('Copy')) },
|
|
|
|
{ role: 'paste', label: esc(t('Paste')) },
|
|
|
|
{ role: 'selectall', label: esc(t('Select All')) },
|
2020-11-21 00:04:08 +01:00
|
|
|
{ type: 'separator' },
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Segments')),
|
2020-11-21 00:04:08 +01:00
|
|
|
submenu: [
|
2020-12-14 12:29:17 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Clear all segments')),
|
2020-12-14 12:29:17 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('clearSegments');
|
|
|
|
},
|
|
|
|
},
|
2020-11-25 22:42:10 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Reorder segments by start time')),
|
2020-11-25 22:42:10 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('reorderSegsByStartTime');
|
|
|
|
},
|
|
|
|
},
|
2020-11-21 00:04:08 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Create num segments')),
|
2020-11-21 00:04:08 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('createNumSegments');
|
|
|
|
},
|
|
|
|
},
|
2020-11-21 00:30:53 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Create fixed duration segments')),
|
2020-11-21 00:30:53 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('createFixedDurationSegments');
|
|
|
|
},
|
|
|
|
},
|
2022-05-24 07:31:48 +02:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Create random segments')),
|
2022-05-24 07:31:48 +02:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('createRandomSegments');
|
|
|
|
},
|
|
|
|
},
|
2021-08-25 08:36:04 +02:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Invert all segments on timeline')),
|
2021-08-25 08:36:04 +02:00
|
|
|
click() {
|
2022-03-06 14:52:48 +01:00
|
|
|
mainWindow.webContents.send('invertAllSegments');
|
2021-08-25 08:36:04 +02:00
|
|
|
},
|
|
|
|
},
|
2022-03-06 09:54:12 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Fill gaps between segments')),
|
2022-03-06 09:54:12 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('fillSegmentsGaps');
|
|
|
|
},
|
|
|
|
},
|
2022-12-30 09:15:22 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Combine overlapping segments')),
|
2022-12-30 09:15:22 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('combineOverlappingSegments');
|
|
|
|
},
|
|
|
|
},
|
2023-04-04 14:43:10 +02:00
|
|
|
{
|
|
|
|
label: esc(t('Combine selected segments')),
|
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('combineSelectedSegments');
|
|
|
|
},
|
|
|
|
},
|
2022-02-18 07:34:20 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Shuffle segments order')),
|
2022-02-18 07:34:20 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('shuffleSegments');
|
|
|
|
},
|
|
|
|
},
|
2022-03-01 16:10:25 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Shift all segments on timeline')),
|
2022-03-01 16:10:25 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('shiftAllSegmentTimes');
|
|
|
|
},
|
|
|
|
},
|
2023-02-05 12:08:28 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Align segment times to keyframes')),
|
2023-02-05 12:08:28 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('alignSegmentTimesToKeyframes');
|
|
|
|
},
|
|
|
|
},
|
2020-11-21 00:04:08 +01:00
|
|
|
],
|
|
|
|
},
|
2020-12-11 16:15:35 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Tracks')),
|
2020-12-11 16:15:35 +01:00
|
|
|
submenu: [
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Extract all tracks')),
|
2020-12-11 16:15:35 +01:00
|
|
|
click() {
|
2022-02-23 12:43:19 +01:00
|
|
|
mainWindow.webContents.send('extractAllStreams');
|
2020-12-11 16:15:35 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Edit tracks / metadata tags')),
|
2020-12-11 16:15:35 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('showStreamsSelector');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-03-26 12:04:36 +01:00
|
|
|
],
|
2020-02-20 11:41:01 +01:00
|
|
|
},
|
|
|
|
|
2020-03-26 12:04:36 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('View')),
|
2020-03-26 12:04:36 +01:00
|
|
|
submenu: [
|
2023-02-18 16:11:17 +01:00
|
|
|
{ role: 'togglefullscreen', label: esc(t('Toggle Full Screen')) },
|
2020-03-26 12:04:36 +01:00
|
|
|
],
|
|
|
|
},
|
2020-02-20 11:41:01 +01:00
|
|
|
|
2020-03-26 14:31:11 +01:00
|
|
|
// On Windows the windowMenu has a close Ctrl+W which clashes with File->Close shortcut
|
|
|
|
...(process.platform === 'darwin'
|
2023-02-18 16:11:17 +01:00
|
|
|
? [{ role: 'windowMenu', label: esc(t('Window')) }]
|
2020-03-26 14:31:11 +01:00
|
|
|
: [{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Window')),
|
|
|
|
submenu: [{ role: 'minimize', label: esc(t('Minimize')) }],
|
2020-03-26 14:31:11 +01:00
|
|
|
}]
|
|
|
|
),
|
2016-10-30 11:57:12 +01:00
|
|
|
|
2020-03-26 12:04:36 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Tools')),
|
2019-01-28 02:25:31 +01:00
|
|
|
submenu: [
|
2022-02-23 14:16:02 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Merge/concatenate files')),
|
2022-02-23 14:16:02 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('concatCurrentBatch');
|
|
|
|
},
|
|
|
|
},
|
2020-02-20 18:57:14 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Set custom start offset/timecode')),
|
2020-02-20 18:57:14 +01:00
|
|
|
click() {
|
2022-02-23 14:16:02 +01:00
|
|
|
mainWindow.webContents.send('askSetStartTimeOffset');
|
2020-02-20 18:57:14 +01:00
|
|
|
},
|
|
|
|
},
|
2022-03-18 10:51:24 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Detect black scenes')),
|
2022-03-18 10:51:24 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('detectBlackScenes');
|
|
|
|
},
|
|
|
|
},
|
2022-12-28 16:55:41 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Detect silent scenes')),
|
2022-12-28 16:55:41 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('detectSilentScenes');
|
|
|
|
},
|
|
|
|
},
|
2022-12-29 11:22:24 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Detect scene changes')),
|
2022-12-29 11:22:24 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('detectSceneChanges');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Create segments from keyframes')),
|
2022-12-29 11:22:24 +01:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('createSegmentsFromKeyframes');
|
|
|
|
},
|
|
|
|
},
|
2022-10-19 17:27:48 +02:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Last ffmpeg commands')),
|
2022-10-19 17:27:48 +02:00
|
|
|
click() { mainWindow.webContents.send('toggleLastCommands'); },
|
|
|
|
},
|
2022-03-18 10:51:24 +01:00
|
|
|
{ type: 'separator' },
|
2023-02-18 16:11:17 +01:00
|
|
|
{ role: 'toggleDevTools', label: esc(t('Toggle Developer Tools')) },
|
2019-01-28 02:25:31 +01:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2016-11-05 21:22:31 +01:00
|
|
|
role: 'help',
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Help')),
|
2016-11-05 21:22:31 +01:00
|
|
|
submenu: [
|
2020-02-22 16:44:21 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('How to use')),
|
2022-10-19 17:27:48 +02:00
|
|
|
click() { electron.shell.openExternal('https://mifi.no/losslesscut/usage'); },
|
2020-02-22 16:44:21 +01:00
|
|
|
},
|
2020-03-26 12:04:36 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('FAQ')),
|
2022-10-19 17:27:48 +02:00
|
|
|
click() { electron.shell.openExternal('https://mifi.no/losslesscut/faq'); },
|
2020-03-26 12:04:36 +01:00
|
|
|
},
|
2021-11-15 08:32:27 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Troubleshooting')),
|
2022-10-19 17:27:48 +02:00
|
|
|
click() { electron.shell.openExternal('https://mifi.no/losslesscut/troubleshooting'); },
|
2021-11-15 08:32:27 +01:00
|
|
|
},
|
2016-11-05 21:22:31 +01:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Learn More')),
|
2016-11-05 21:22:31 +01:00
|
|
|
click() { electron.shell.openExternal(homepage); },
|
|
|
|
},
|
2022-10-19 17:27:48 +02:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Licenses')),
|
2022-10-19 17:27:48 +02:00
|
|
|
click() { electron.shell.openExternal(licensesPage); },
|
|
|
|
},
|
|
|
|
{ type: 'separator' },
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Keyboard & mouse shortcuts')),
|
2022-10-19 17:27:48 +02:00
|
|
|
click() {
|
|
|
|
mainWindow.webContents.send('toggleKeyboardShortcuts');
|
|
|
|
},
|
|
|
|
},
|
2020-04-10 12:54:51 +02:00
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Report an error')),
|
2020-04-10 12:54:51 +02:00
|
|
|
click() { mainWindow.webContents.send('openSendReportDialog'); },
|
|
|
|
},
|
2023-04-05 15:37:38 +02:00
|
|
|
...(process.platform !== 'darwin' ? [{ role: 'about', label: esc(t('About LosslessCut')) }] : []),
|
2016-11-05 21:22:31 +01:00
|
|
|
],
|
2020-03-26 12:04:36 +01:00
|
|
|
},
|
|
|
|
];
|
2016-10-30 11:57:12 +01:00
|
|
|
|
2023-02-15 06:59:48 +01:00
|
|
|
if (!isStoreBuild && newVersion) {
|
2018-02-17 15:15:30 +01:00
|
|
|
menu.push({
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('New version!')),
|
2018-02-17 15:15:30 +01:00
|
|
|
submenu: [
|
|
|
|
{
|
2023-02-18 16:11:17 +01:00
|
|
|
label: esc(t('Download {{version}}', { version: newVersion })),
|
2021-12-01 18:19:37 +01:00
|
|
|
click() { electron.shell.openExternal(getReleaseUrl(newVersion)); },
|
2018-02-17 15:15:30 +01:00
|
|
|
},
|
|
|
|
],
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2016-10-30 11:57:12 +01:00
|
|
|
Menu.setApplicationMenu(Menu.buildFromTemplate(menu));
|
|
|
|
};
|