menu: new "Add Fake Airplay" and "Add Fake Chromecast" items

Fixes #21
This commit is contained in:
Feross Aboukhadijeh
2016-03-05 14:04:33 -08:00
parent ff1d5a6bb0
commit fc68a08de7
2 changed files with 41 additions and 11 deletions

View File

@@ -49,6 +49,10 @@ function getMenuItem (label) {
}
}
function addFakeDevice (device) {
windows.main.send('addFakeDevice', device)
}
function getMenuTemplate () {
var template = [
{
@@ -143,17 +147,33 @@ function getMenuTemplate () {
type: 'separator'
},
{
label: 'Reload',
accelerator: 'CmdOrCtrl+R',
click: reloadWindow
},
{
label: 'Developer Tools',
accelerator: (function () {
if (process.platform === 'darwin') return 'Alt+Command+I'
else return 'Ctrl+Shift+I'
})(),
click: toggleDevTools
label: 'Developer',
submenu: [
{
label: 'Reload',
accelerator: 'CmdOrCtrl+R',
click: reloadWindow
},
{
label: 'Developer Tools',
accelerator: (function () {
if (process.platform === 'darwin') return 'Alt+Command+I'
else return 'Ctrl+Shift+I'
})(),
click: toggleDevTools
},
{
type: 'separator'
},
{
label: 'Add Fake Airplay',
click: () => addFakeDevice('airplay')
},
{
label: 'Add Fake Chromecast',
click: () => addFakeDevice('chromecast')
}
]
}
]
},