From 107395dee80dcde0c382d34e4bc08164d81f4bac Mon Sep 17 00:00:00 2001 From: Ramiro Saenz Date: Mon, 10 Apr 2017 16:41:44 -0300 Subject: [PATCH] Added Preferences to Menu Fixes #590 --- app.js | 3 +++ electron/menu.js | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/app.js b/app.js index c2c0e48b..902591d8 100644 --- a/app.js +++ b/app.js @@ -15,6 +15,9 @@ const ipc = require('electron').ipcRenderer; ipc.on('showAbout', function(event, message) { !Ext.cq1('about') ? Ext.create('Rambox.view.main.About') : ''; }); +ipc.on('showPreferences', function(event, message) { + !Ext.cq1('preferences') ? Ext.create('Rambox.view.preferences.Preferences').show() : ''; +}); ipc.on('autoUpdater:check-update', function() { Rambox.app.checkUpdate(); }); diff --git a/electron/menu.js b/electron/menu.js index 63faaa32..cc703ec5 100644 --- a/electron/menu.js +++ b/electron/menu.js @@ -204,6 +204,12 @@ if (process.platform === 'darwin') { tpl.unshift({ label: appName, submenu: [ + { + label: 'Preferences', + click() { + sendAction('showPreferences') + } + }, { label: `Check for updates...`, click(item, win) { @@ -255,6 +261,15 @@ if (process.platform === 'darwin') { tpl.unshift({ label: '&File', submenu: [ + { + label: 'Preferences', + click() { + sendAction('showPreferences') + } + }, + { + type: 'separator' + }, { role: 'quit' }