diff --git a/main.js b/main.js index eb7233455..f464c2820 100644 --- a/main.js +++ b/main.js @@ -1,4 +1,4 @@ -const {dialog, app, BrowserWindow, ipcMain} = require( +const {dialog, app, Menu, BrowserWindow, ipcMain} = require( 'electron'); const path = require('path'); @@ -11,6 +11,40 @@ let mainWindow = null; let academyWindow; let scrollToId; +const menuTemplate = [ + { + label: 'Window', + role: 'window', + submenu: [ + { + label: 'Minimize', + accelerator: 'CmdOrCtrl+M', + role: 'minimize' + }, + { + label: 'Reload', + accelerator: 'CmdOrCtrl+R', + click: function(item, focusedWindow) { + if (focusedWindow) { + focusedWindow.reload(); + } + } + }, + { + label: 'Toggle Developer Tools', + accelerator: + process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I', + click: function(item, focusedWindow) { + if (focusedWindow) { + focusedWindow.webContents.toggleDevTools(); + } + } + } + ] + }, + { role: 'editMenu' } +]; + function initialize() { makeSingleInstance(); @@ -41,6 +75,10 @@ function initialize() { } }); + // build menu + const menu = Menu.buildFromTemplate(menuTemplate); + Menu.setApplicationMenu(menu); + ipcMain.on('loading-status', function(event, status) { splashScreen && splashScreen.webContents.send('loading-status', status); }); diff --git a/package.json b/package.json index ba877375b..00fdf3002 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "translationstudio", "productName": "translationStudio", - "version": "12.0.0", - "build": "140", + "version": "12.0.1", + "build": "142", "description": "A utility for translating the Bible and biblical content into any language.", "keywords": [], "homepage": "https://github.com/unfoldingWord-dev/ts-desktop", diff --git a/src/js/bootstrap.js b/src/js/bootstrap.js index 4c0541692..e06c3e602 100644 --- a/src/js/bootstrap.js +++ b/src/js/bootstrap.js @@ -20,8 +20,6 @@ process.stdout.write = console.log.bind(console); try { const DATA_PATH = ipcRenderer.sendSync('main-window', 'dataPath'); - setMsg(DATA_PATH); - // stub globals let path = null; let fs = null;