Add File > Quit for Linux users with broken system trays

Works around #303
This commit is contained in:
DC
2016-04-06 01:31:19 -07:00
parent 85b6ca0639
commit 3ad815cec4

View File

@@ -155,10 +155,7 @@ function showOpenTorrentAddress () {
} }
function getAppMenuTemplate () { function getAppMenuTemplate () {
var template = [ var fileMenu = [
{
label: 'File',
submenu: [
{ {
label: 'Create New Torrent...', label: 'Create New Torrent...',
accelerator: 'CmdOrCtrl+N', accelerator: 'CmdOrCtrl+N',
@@ -178,13 +175,24 @@ function getAppMenuTemplate () {
type: 'separator' type: 'separator'
}, },
{ {
label: process.platform === 'darwin' label: process.platform === 'windows' ? 'Close' : 'Close Window',
? 'Close Window'
: 'Close',
accelerator: 'CmdOrCtrl+W', accelerator: 'CmdOrCtrl+W',
role: 'close' role: 'close'
} }
] ]
// File > Quit for Linux users with distros where the system tray is broken
if (process.platform === 'linux') {
fileMenu.push({
label: 'Quit',
click: () => app.quit()
})
}
var template = [
{
label: 'File',
submenu: fileMenu
}, },
{ {
label: 'Edit', label: 'Edit',