From 3270d8bd0ed46b62262575f5d59fca2414aaf8c7 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 8 May 2018 09:40:12 -0400 Subject: [PATCH] adjust base menu --- src/electron/baseMenu.ts | 54 ++++------------------------------------ 1 file changed, 5 insertions(+), 49 deletions(-) diff --git a/src/electron/baseMenu.ts b/src/electron/baseMenu.ts index 77a9aff3bd..4cd043866d 100644 --- a/src/electron/baseMenu.ts +++ b/src/electron/baseMenu.ts @@ -12,59 +12,15 @@ import { WindowMain } from './window.main'; import { isMacAppStore } from './utils'; export class BaseMenu { - protected logOutMenuItemOptions: MenuItemConstructorOptions; - protected aboutMenuItemOptions: MenuItemConstructorOptions; protected editMenuItemOptions: MenuItemConstructorOptions; protected viewSubMenuItemOptions: MenuItemConstructorOptions[]; protected windowMenuItemOptions: MenuItemConstructorOptions; protected macAppMenuItemOptions: MenuItemConstructorOptions[]; protected macWindowSubmenuOptions: MenuItemConstructorOptions[]; - constructor(protected i18nService: I18nService, protected windowMain: WindowMain, - protected appName: string, private onLogOut: () => void) { } + constructor(protected i18nService: I18nService, protected windowMain: WindowMain) { } protected initProperties() { - this.logOutMenuItemOptions = { - label: this.i18nService.t('logOut'), - id: 'logOut', - click: () => { - const result = dialog.showMessageBox(this.windowMain.win, { - title: this.i18nService.t('logOut'), - message: this.i18nService.t('logOut'), - detail: this.i18nService.t('logOutConfirmation'), - buttons: [this.i18nService.t('logOut'), this.i18nService.t('cancel')], - cancelId: 1, - defaultId: 0, - noLink: true, - }); - if (result === 0) { - this.onLogOut(); - } - }, - }; - - this.aboutMenuItemOptions = { - label: this.i18nService.t('aboutBitwarden'), - click: () => { - const aboutInformation = this.i18nService.t('version', app.getVersion()) + - '\nShell ' + process.versions.electron + - '\nRenderer ' + process.versions.chrome + - '\nNode ' + process.versions.node + - '\nArchitecture ' + process.arch; - const result = dialog.showMessageBox(this.windowMain.win, { - title: this.appName, - message: this.appName, - detail: aboutInformation, - type: 'info', - noLink: true, - buttons: [this.i18nService.t('ok'), this.i18nService.t('copy')], - }); - if (result === 1) { - clipboard.writeText(aboutInformation); - } - }, - }; - this.editMenuItemOptions = { label: this.i18nService.t('edit'), submenu: [ @@ -169,10 +125,6 @@ export class BaseMenu { ]; this.macWindowSubmenuOptions = [ - { - label: this.i18nService.t('close'), - role: isMacAppStore() ? 'quit' : 'close', - }, { label: this.i18nService.t('minimize'), role: 'minimize', @@ -186,6 +138,10 @@ export class BaseMenu { label: this.i18nService.t('bringAllToFront'), role: 'front', }, + { + label: this.i18nService.t('close'), + role: isMacAppStore() ? 'quit' : 'close', + }, ]; } }