Skip to content
Permalink
Browse files

feat(ui): add Preferences system menu item

  • Loading branch information...
mrfelton committed May 29, 2019
1 parent 8349353 commit 4d56239e0d5700c2ee3cb61909852dc067dcd038
Showing with 23 additions and 1 deletion.
  1. +12 −0 electron/menuBuilder.js
  2. +8 −0 renderer/reducers/app.js
  3. +3 −1 renderer/reducers/ipc.js
@@ -92,6 +92,12 @@ export default class ZapMenuBuilder {
submenu: [
buildAboutMenu(),
{ type: 'separator' },
{
label: 'Preferences...',
accelerator: 'Command+,',
click: () => this.mainWindow.webContents.send('openPreferences'),
},
{ type: 'separator' },
{ label: 'Hide Zap', accelerator: 'Command+H', selector: 'hide:' },
{
label: 'Hide Others',
@@ -226,6 +232,12 @@ export default class ZapMenuBuilder {
this.mainWindow.close()
},
},
{ type: 'separator' },
{
label: '&Preferences...',
accelerator: 'Ctrl+,',
click: () => this.mainWindow.webContents.send('openPreferences'),
},
],
},
{
@@ -7,6 +7,7 @@ import { tickerSelectors } from './ticker'
import { setIsWalletOpen, walletSelectors } from './wallet'
import { setTheme, themeSelectors } from './theme'
import { stopLnd } from './lnd'
import { openModal } from './modal'

// ------------------------------------
// Initial State
@@ -105,6 +106,13 @@ export const terminateApp = () => async dispatch => {
dispatch(send('terminateAppSuccess'))
}

/**
* openPreferences - IPC handler for 'openPreferences' message.
*/
export const openPreferences = () => dispatch => {
dispatch(openModal('SETTINGS'))
}

// ------------------------------------
// Action Handlers
// ------------------------------------
@@ -1,7 +1,8 @@
import createIpc from 'redux-electron-ipc'
import { initApp, terminateApp } from './app'
import { initApp, terminateApp, openPreferences } from './app'
import { killNeutrino } from './neutrino'
import { receiveLocale } from './locale'

import { bitcoinPaymentUri, lightningPaymentUri } from './pay'
import { lndconnectUri } from './onboarding'
import { backupTokensUpdated, saveBackupSuccess, backupServiceInitialized } from './backup'
@@ -11,6 +12,7 @@ const ipc = createIpc({
terminateApp,
killNeutrino,
receiveLocale,
openPreferences,
bitcoinPaymentUri,
lightningPaymentUri,
lndconnectUri,

0 comments on commit 4d56239

Please sign in to comment.
You can’t perform that action at this time.