Skip to content

Commit

Permalink
#852: basic framework for controlling toggle.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mulholland committed Jun 25, 2019
1 parent 8726377 commit 44d812d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/main/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,18 @@ class AppMenu {
}
}, {
type: 'separator'
}, {
label: 'Lock Column Properties',
accelerator: 'Shift+CmdOrCtrl+L',
type: 'checkbox',
checked: false,
click (menuItem) {
// revert 'checked' toggle so only controlled by event
menuItem.checked = !menuItem.checked
webContents().send('toggleLockColumnProperties')
}
}, {
type: 'separator'
}, {
label: 'Export Data Package...',
accelerator: 'Shift+CmdOrCtrl+X',
Expand All @@ -280,8 +292,7 @@ class AppMenu {
}
}
]
},
{
}, {
label: 'Window',
submenu: [
{
Expand Down Expand Up @@ -382,7 +393,7 @@ class AppMenu {
}, {
label: 'Preferences',
accelerator: 'CmdOrCtrl+,',
click: function() {
click: function () {
webContents().send('showSidePanel', 'preferences')
}
}, {
Expand Down Expand Up @@ -426,7 +437,7 @@ class AppMenu {
}, {
label: 'Settings',
accelerator: 'CmdOrCtrl+,',
click: function() {
click: function () {
webContents().send('showSidePanel', 'preferences', 'settings')
}
})
Expand Down
6 changes: 6 additions & 0 deletions src/main/rendererToMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ ipc.on('hasHeaderRow', (event, arg) => {
subMenu.checked = arg
})

ipc.on('hasLockedColumns', (event, arg) => {
console.log('received')
let subMenu = getSubMenuFromMenu('Tools', 'Lock Column Properties')
subMenu.checked = arg
})

ipc.on('showErrorsWindow', (event, arg) => {
showErrors()
})
Expand Down

0 comments on commit 44d812d

Please sign in to comment.