Skip to content
This repository was archived by the owner on Jun 3, 2020. It is now read-only.

Commit 8e8de21

Browse files
vsvipulakashnimare
authored andcommitted
menu: Reorder file menu and add option to Add Organization.
Reorder the File Menu. Also, adds a new option to add a new organization to the file menu.
1 parent 0e0d7e7 commit 8e8de21

File tree

2 files changed

+46
-18
lines changed

2 files changed

+46
-18
lines changed

app/main/menu.js

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,21 @@ class AppMenu {
259259
return [{
260260
label: `${app.getName()}`,
261261
submenu: [{
262+
label: 'Add Organization',
263+
accelerator: 'Cmd+Shift+N',
264+
click(item, focusedWindow) {
265+
if (focusedWindow) {
266+
AppMenu.sendAction('new-server');
267+
}
268+
}
269+
}, {
270+
label: 'Toggle Do Not Disturb',
271+
accelerator: 'Cmd+Shift+M',
272+
click() {
273+
const dndUtil = DNDUtil.toggle();
274+
AppMenu.sendAction('toggle-dnd', dndUtil.dnd, dndUtil.newSettings);
275+
}
276+
}, {
262277
label: 'Desktop Settings',
263278
accelerator: 'Cmd+,',
264279
click(item, focusedWindow) {
@@ -277,13 +292,6 @@ class AppMenu {
277292
}
278293
}, {
279294
type: 'separator'
280-
}, {
281-
label: 'Toggle Do Not Disturb',
282-
accelerator: 'Command+Shift+M',
283-
click() {
284-
const dndUtil = DNDUtil.toggle();
285-
AppMenu.sendAction('toggle-dnd', dndUtil.dnd, dndUtil.newSettings);
286-
}
287295
}, {
288296
label: 'Copy Zulip URL',
289297
accelerator: 'Cmd+Shift+C',
@@ -293,7 +301,7 @@ class AppMenu {
293301
}
294302
}
295303
}, {
296-
label: 'Log Out',
304+
label: 'Log Out of Organization',
297305
accelerator: 'Cmd+L',
298306
enabled: enableMenu,
299307
click(item, focusedWindow) {
@@ -316,6 +324,10 @@ class AppMenu {
316324
role: 'unhide'
317325
}, {
318326
type: 'separator'
327+
}, {
328+
role: 'minimize'
329+
}, {
330+
role: 'close'
319331
}, {
320332
role: 'quit'
321333
}]
@@ -362,15 +374,30 @@ class AppMenu {
362374
return [{
363375
label: '&File',
364376
submenu: [{
377+
label: 'Add Organization',
378+
accelerator: 'Ctrl+Shift+N',
379+
click(item, focusedWindow) {
380+
if (focusedWindow) {
381+
AppMenu.sendAction('new-server');
382+
}
383+
}
384+
}, {
385+
type: 'separator'
386+
}, {
387+
label: 'Toggle Do Not Disturb',
388+
accelerator: 'Ctrl+Shift+M',
389+
click() {
390+
const dndUtil = DNDUtil.toggle();
391+
AppMenu.sendAction('toggle-dnd', dndUtil.dnd, dndUtil.newSettings);
392+
}
393+
}, {
365394
label: 'Desktop Settings',
366395
accelerator: 'Ctrl+,',
367396
click(item, focusedWindow) {
368397
if (focusedWindow) {
369398
AppMenu.sendAction('open-settings');
370399
}
371400
}
372-
}, {
373-
type: 'separator'
374401
}, {
375402
label: 'Keyboard Shortcuts',
376403
accelerator: 'Ctrl+Shift+K',
@@ -382,13 +409,6 @@ class AppMenu {
382409
}
383410
}, {
384411
type: 'separator'
385-
}, {
386-
label: 'Toggle Do Not Disturb',
387-
accelerator: 'Ctrl+Shift+M',
388-
click() {
389-
const dndUtil = DNDUtil.toggle();
390-
AppMenu.sendAction('toggle-dnd', dndUtil.dnd, dndUtil.newSettings);
391-
}
392412
}, {
393413
label: 'Copy Zulip URL',
394414
accelerator: 'Ctrl+Shift+C',
@@ -398,7 +418,7 @@ class AppMenu {
398418
}
399419
}
400420
}, {
401-
label: 'Log Out',
421+
label: 'Log Out of Organization',
402422
accelerator: 'Ctrl+L',
403423
enabled: enableMenu,
404424
click(item, focusedWindow) {
@@ -408,6 +428,10 @@ class AppMenu {
408428
}
409429
}, {
410430
type: 'separator'
431+
}, {
432+
role: 'minimize'
433+
}, {
434+
role: 'close'
411435
}, {
412436
role: 'quit',
413437
accelerator: 'Ctrl+Q'

app/renderer/js/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,10 @@ class ServerManagerView {
734734
ipcRenderer.on('copy-zulip-url', () => {
735735
clipboard.writeText(DomainUtil.getDomain(this.activeTabIndex).url);
736736
});
737+
738+
ipcRenderer.on('new-server', () => {
739+
this.openSettings('AddServer');
740+
});
737741
}
738742
}
739743

0 commit comments

Comments
 (0)