@@ -3,147 +3,149 @@ var Menu = require('menu');
33var debug = require ( 'debug' ) ( 'scout-electron:menu' ) ;
44
55function getTemplate ( _window ) {
6- return [
7- {
8- label : 'MongoDB Compass' ,
9- submenu : [
10- {
11- label : 'About Compass' ,
12- selector : 'orderFrontStandardAboutPanel:'
13- } ,
14- {
15- type : 'separator'
16- } ,
17- {
18- label : 'Hide' ,
19- accelerator : 'Command+H' ,
20- selector : 'hide:'
21- } ,
22- {
23- label : 'Hide Others' ,
24- accelerator : 'Command+Shift+H' ,
25- selector : 'hideOtherApplications:'
26- } ,
27- {
28- label : 'Show All' ,
29- selector : 'unhideAllApplications:'
30- } ,
31- {
32- type : 'separator'
33- } ,
34- {
35- label : 'Quit' ,
36- accelerator : 'Command+Q' ,
37- click : function ( ) {
38- app . quit ( ) ;
6+ if ( process . platform === 'darwin' ) {
7+ return [
8+ {
9+ label : 'MongoDB Compass' ,
10+ submenu : [
11+ {
12+ label : 'About Compass' ,
13+ selector : 'orderFrontStandardAboutPanel:'
14+ } ,
15+ {
16+ type : 'separator'
17+ } ,
18+ {
19+ label : 'Hide' ,
20+ accelerator : 'Command+H' ,
21+ selector : 'hide:'
22+ } ,
23+ {
24+ label : 'Hide Others' ,
25+ accelerator : 'Command+Shift+H' ,
26+ selector : 'hideOtherApplications:'
27+ } ,
28+ {
29+ label : 'Show All' ,
30+ selector : 'unhideAllApplications:'
31+ } ,
32+ {
33+ type : 'separator'
34+ } ,
35+ {
36+ label : 'Quit' ,
37+ accelerator : 'Command+Q' ,
38+ click : function ( ) {
39+ app . quit ( ) ;
40+ }
3941 }
40- }
41- ]
42- } ,
43- {
44- label : 'Connect' ,
45- submenu : [
46- {
47- label : 'Connect to... ' ,
48- accelerator : 'Command+N' ,
49- click : function ( ) {
50- app . emit ( 'show connect dialog' ) ;
42+ ]
43+ } ,
44+ {
45+ label : 'Connect' ,
46+ submenu : [
47+ {
48+ label : 'Connect to...' ,
49+ accelerator : 'Command+N ' ,
50+ click : function ( ) {
51+ app . emit ( 'show connect dialog' ) ;
52+ }
5153 }
52- }
53- ]
54- } ,
55- {
56- label : 'Edit' ,
57- submenu : [
58- {
59- label : 'Undo' ,
60- accelerator : 'Command+Z' ,
61- role : 'undo'
62- } ,
63- {
64- label : 'Redo' ,
65- accelerator : 'Shift+Command+Z' ,
66- role : 'redo'
67- } ,
68- {
69- type : 'separator'
70- } ,
71- {
72- label : 'Cut' ,
73- accelerator : 'Command+X' ,
74- role : 'cut'
75- } ,
76- {
77- label : 'Copy' ,
78- accelerator : 'Command+C' ,
79- role : 'copy'
80- } ,
81- {
82- label : 'Paste' ,
83- accelerator : 'Command+V' ,
84- role : 'paste'
85- } ,
86- {
87- label : 'Select All' ,
88- accelerator : 'Command+A' ,
89- role : 'selectall'
90- }
91- ]
92- } ,
93- {
94- label : 'View' ,
95- submenu : [
96- {
97- label : 'Reload' ,
98- accelerator : 'Command+R' ,
99- click : function ( ) {
100- _window . restart ( ) ;
54+ ]
55+ } ,
56+ {
57+ label : 'Edit' ,
58+ submenu : [
59+ {
60+ label : 'Undo' ,
61+ accelerator : 'Command+Z' ,
62+ role : 'undo'
63+ } ,
64+ {
65+ label : 'Redo' ,
66+ accelerator : 'Shift+Command+Z' ,
67+ role : 'redo'
68+ } ,
69+ {
70+ type : 'separator'
71+ } ,
72+ {
73+ label : 'Cut' ,
74+ accelerator : 'Command+X' ,
75+ role : 'cut'
76+ } ,
77+ {
78+ label : 'Copy' ,
79+ accelerator : 'Command+C' ,
80+ role : 'copy'
81+ } ,
82+ {
83+ label : 'Paste' ,
84+ accelerator : 'Command+V' ,
85+ role : 'paste'
86+ } ,
87+ {
88+ label : 'Select All' ,
89+ accelerator : 'Command+A' ,
90+ role : 'selectall'
10191 }
102- } ,
103- {
104- label : 'Toggle DevTools' ,
105- accelerator : 'Alt+Command+I' ,
106- click : function ( ) {
107- _window . toggleDevTools ( ) ;
92+ ]
93+ } ,
94+ {
95+ label : 'View' ,
96+ submenu : [
97+ {
98+ label : 'Reload' ,
99+ accelerator : 'Command+R' ,
100+ click : function ( ) {
101+ _window . restart ( ) ;
102+ }
103+ } ,
104+ {
105+ label : 'Toggle DevTools' ,
106+ accelerator : 'Alt+Command+I' ,
107+ click : function ( ) {
108+ _window . toggleDevTools ( ) ;
109+ }
108110 }
109- }
110- ]
111- } ,
112- {
113- label : 'Share' ,
114- submenu : [
115- {
116- label : 'Share Schema as JSON ',
117- accelerator : 'Alt+Command+S' ,
118- click : function ( ) {
119- _window . webContents . send ( 'message' , 'menu-share-schema-json' ) ;
111+ ]
112+ } ,
113+ {
114+ label : 'Share' ,
115+ submenu : [
116+ {
117+ label : 'Share Schema as JSON' ,
118+ accelerator : 'Alt+Command+S ',
119+ click : function ( ) {
120+ _window . webContents . send ( 'message' , 'menu-share-schema-json' ) ;
121+ }
120122 }
121- }
122- ]
123- } ,
124- {
125- label : 'Window' ,
126- submenu : [
127- {
128- label : 'Minimize ' ,
129- accelerator : 'Command+M' ,
130- role : 'minimize'
131- } ,
132- {
133- label : 'Close ' ,
134- accelerator : 'Command+W' ,
135- role : 'close'
136- } ,
137- {
138- type : 'separator'
139- } ,
140- {
141- label : 'Bring All to Front' ,
142- selector : 'arrangeInFront:'
143- }
144- ]
145- }
146- ] ;
123+ ]
124+ } ,
125+ {
126+ label : 'Window' ,
127+ submenu : [
128+ {
129+ label : 'Minimize' ,
130+ accelerator : 'Command+M ' ,
131+ role : 'minimize'
132+ } ,
133+ {
134+ label : 'Close' ,
135+ accelerator : 'Command+W ' ,
136+ role : 'close'
137+ } ,
138+ {
139+ type : 'separator'
140+ } ,
141+ {
142+ label : 'Bring All to Front' ,
143+ selector : 'arrangeInFront:'
144+ }
145+ ]
146+ }
147+ ] ;
148+ }
147149
148150 return [
149151 {
0 commit comments