MCPcopy Index your code
hub / github.com/reactide/reactide / menuTemplate

Function menuTemplate

main/menus/mainMenu.js:11–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9let splash = null;
10
11const menuTemplate = windowObj => [
12 {},
13 {
14 label: 'Main',
15 submenu: [
16 { role: 'about' },
17 { type: 'separator' },
18 { role: 'hide' },
19 { role: 'hideothers' },
20 { role: 'unhide' },
21 { type: 'separator' },
22 { role: 'quit' }
23 ]
24 },
25 {
26 label: 'File',
27 submenu: [
28 {
29 label: 'New Project',
30 click: () => {
31 // warn user of unsaved changes before below
32 global.newProj = true;
33 const save = dialog.showSaveDialog();
34 //Run cra with 'save' variable as destination path
35 if (save) {
36 cra(path.join(path.dirname(save), path.basename(save).toLowerCase()));
37 splash = new BrowserWindow({
38 width: 600,
39 height: 400,
40 minWidth: 604,
41 minHeight: 283,
42 webPreferences: {
43 devTools: false
44 }
45 })
46
47 splash.setAlwaysOnTop(true);
48 splash.loadFile(path.join(__dirname, "../../renderer/splash/public/index.html"))
49
50 splash.once('ready-to-show', () => {
51 splash.show();
52 })
53
54 global.mainWindow.webContents.send('newProject');
55
56
57 ipcMain.on('closeSplash', () => {
58 splash.close()
59 })
60
61 ipcMain.on('closed', () => {
62 splash = null
63 })
64
65 //garbage collect loader page
66 splash.on('closeSplash', () => {
67 splash.close()
68 splash = null

Callers 1

main.jsFile · 0.85

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected