2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2017-2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-06-18 17:04:27 +00:00
|
|
|
import { isString } from 'lodash';
|
|
|
|
import { MenuItemConstructorOptions } from 'electron';
|
2018-03-02 20:59:39 +00:00
|
|
|
|
2021-06-18 17:04:27 +00:00
|
|
|
import { LocaleMessagesType } from '../ts/types/I18N';
|
|
|
|
|
|
|
|
export type MenuListType = Array<MenuItemConstructorOptions>;
|
|
|
|
|
|
|
|
type OptionsType = {
|
|
|
|
// options
|
|
|
|
development: boolean;
|
|
|
|
devTools: boolean;
|
|
|
|
includeSetup: boolean;
|
|
|
|
isBeta: (version: string) => boolean;
|
|
|
|
platform: string;
|
|
|
|
|
|
|
|
// actions
|
|
|
|
openContactUs: () => unknown;
|
|
|
|
openForums: () => unknown;
|
|
|
|
openJoinTheBeta: () => unknown;
|
|
|
|
openReleaseNotes: () => unknown;
|
|
|
|
openSupportPage: () => unknown;
|
|
|
|
setupAsNewDevice: () => unknown;
|
|
|
|
setupAsStandalone: () => unknown;
|
2021-06-30 21:27:18 +00:00
|
|
|
forceUpdate: () => unknown;
|
2021-06-18 17:04:27 +00:00
|
|
|
showAbout: () => unknown;
|
|
|
|
showDebugLog: () => unknown;
|
|
|
|
showKeyboardShortcuts: () => unknown;
|
|
|
|
showSettings: () => unknown;
|
|
|
|
showStickerCreator: () => unknown;
|
|
|
|
showWindow: () => unknown;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const createTemplate = (
|
|
|
|
options: OptionsType,
|
|
|
|
messages: LocaleMessagesType
|
|
|
|
): MenuListType => {
|
2018-03-02 20:59:39 +00:00
|
|
|
if (!isString(options.platform)) {
|
|
|
|
throw new TypeError('`options.platform` must be a string');
|
|
|
|
}
|
|
|
|
|
2018-01-08 21:19:25 +00:00
|
|
|
const {
|
2020-06-10 16:56:10 +00:00
|
|
|
isBeta,
|
2021-03-03 19:13:35 +00:00
|
|
|
devTools,
|
2018-03-02 20:59:39 +00:00
|
|
|
includeSetup,
|
2020-06-10 16:56:10 +00:00
|
|
|
openContactUs,
|
2018-03-02 20:54:15 +00:00
|
|
|
openForums,
|
2020-06-10 16:56:10 +00:00
|
|
|
openJoinTheBeta,
|
2018-03-02 20:54:15 +00:00
|
|
|
openReleaseNotes,
|
2018-01-08 21:19:25 +00:00
|
|
|
openSupportPage,
|
2018-03-02 20:59:39 +00:00
|
|
|
platform,
|
New design for import/install, 'light' import (#2053)
- A new design for the import flow. It features:
- Icons at the top of every screen
- Gray background, blue buttons, thinner text
- Simpler copy
- A new design for the install flow. It features:
- Immediate entry into the QR code screen
- Animated dots to show that we're loading the QR code from the server
- Fewer screens: 1) QR 2) device name 3) sync-in-progress
- When not set up, the app opens directly into the install screen, which has been streamlined. The `--import` command-line argument will cause the app to open directly into the import flow.
- Support for two different flavors of builds - the normal build will open into the standard registration flow, and the import flavor will be exactly the same except during setup it will open directly into the import flow.
- A new design for the (dev-only) standalone registration view
- When these install sequences are active, the OS File menu has entries to allow you to switch the method of setup you'd like to use. These go away as soon as the first step is taken in any of these flows.
- The device name (chosen on initial setup) is now shown in the settings panel
- At the end of a light import, we hand off to the normal device link screen, starting at the QR code. On a full import, we remove the sensitive encryption information in the export to prevent conflicts on multiple imports.
- `Whisper.Backup.exportToDirectory()` takes an options object so you can tell it to do a light export.
- `Whisper.Backup.importFromDirectory()` takes an options object so you can force it to load only the light components found on disk. It also returns an object so you can tell whether a given import was a full import or light import.
- On start of import, we build a list of all the ids present in the messages, conversations, and groups stores in IndexedDB. This can take some time if a lot of data is in the database already, but it makes the subsequent deduplicated import very fast.
- Disappearing messages are now excluded when exporting
- Remove some TODOs in the tests
2018-02-22 18:40:32 +00:00
|
|
|
setupAsNewDevice,
|
|
|
|
setupAsStandalone,
|
2021-06-30 21:27:18 +00:00
|
|
|
forceUpdate,
|
2018-03-02 20:54:15 +00:00
|
|
|
showAbout,
|
|
|
|
showDebugLog,
|
2019-11-07 21:36:16 +00:00
|
|
|
showKeyboardShortcuts,
|
2018-03-02 20:59:39 +00:00
|
|
|
showSettings,
|
2019-12-17 20:25:57 +00:00
|
|
|
showStickerCreator,
|
2018-01-08 21:19:25 +00:00
|
|
|
} = options;
|
2017-04-05 18:29:43 +00:00
|
|
|
|
2021-06-18 17:04:27 +00:00
|
|
|
const template: MenuListType = [
|
2018-05-02 01:54:43 +00:00
|
|
|
{
|
|
|
|
label: messages.mainMenuFile.message,
|
|
|
|
submenu: [
|
2019-12-17 20:25:57 +00:00
|
|
|
{
|
|
|
|
label: messages.mainMenuCreateStickers.message,
|
|
|
|
click: showStickerCreator,
|
|
|
|
},
|
2018-05-02 01:54:43 +00:00
|
|
|
{
|
|
|
|
label: messages.mainMenuSettings.message,
|
2019-11-19 23:03:00 +00:00
|
|
|
accelerator: 'CommandOrControl+,',
|
2018-05-02 01:54:43 +00:00
|
|
|
click: showSettings,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'quit',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.appMenuQuit.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: messages.mainMenuEdit.message,
|
|
|
|
submenu: [
|
|
|
|
{
|
|
|
|
role: 'undo',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.editMenuUndo.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'redo',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.editMenuRedo.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'cut',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.editMenuCut.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'copy',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.editMenuCopy.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'paste',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.editMenuPaste.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'pasteAndMatchStyle',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.editMenuPasteAndMatchStyle.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'delete',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.editMenuDelete.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'selectAll',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.editMenuSelectAll.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: messages.mainMenuView.message,
|
|
|
|
submenu: [
|
|
|
|
{
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'resetZoom',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.viewMenuResetZoom.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
2019-11-15 02:37:25 +00:00
|
|
|
accelerator: platform === 'darwin' ? 'Command+=' : 'Control+=',
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'zoomIn',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.viewMenuZoomIn.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'zoomOut',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.viewMenuZoomOut.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'togglefullscreen',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.viewMenuToggleFullScreen.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: messages.debugLog.message,
|
|
|
|
click: showDebugLog,
|
|
|
|
},
|
2021-03-03 19:13:35 +00:00
|
|
|
...(devTools
|
|
|
|
? [
|
|
|
|
{
|
2021-06-18 17:04:27 +00:00
|
|
|
type: 'separator' as const,
|
2021-03-03 19:13:35 +00:00
|
|
|
},
|
|
|
|
{
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'toggleDevTools' as const,
|
2021-03-03 19:13:35 +00:00
|
|
|
label: messages.viewMenuToggleDevTools.message,
|
|
|
|
},
|
|
|
|
]
|
|
|
|
: []),
|
2021-06-30 21:27:18 +00:00
|
|
|
...(devTools && platform !== 'linux'
|
|
|
|
? [
|
|
|
|
{
|
|
|
|
label: messages.forceUpdate.message,
|
|
|
|
click: forceUpdate,
|
|
|
|
},
|
|
|
|
]
|
|
|
|
: []),
|
2018-05-02 01:54:43 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: messages.mainMenuWindow.message,
|
|
|
|
role: 'window',
|
|
|
|
submenu: [
|
|
|
|
{
|
|
|
|
role: 'minimize',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.windowMenuMinimize.message,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: messages.mainMenuHelp.message,
|
|
|
|
role: 'help',
|
|
|
|
submenu: [
|
|
|
|
{
|
2019-11-07 21:36:16 +00:00
|
|
|
label: messages.helpMenuShowKeyboardShortcuts.message,
|
|
|
|
accelerator: 'CmdOrCtrl+/',
|
|
|
|
click: showKeyboardShortcuts,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
2020-06-10 16:56:10 +00:00
|
|
|
{
|
|
|
|
label: messages.contactUs.message,
|
|
|
|
click: openContactUs,
|
|
|
|
},
|
2019-11-07 21:36:16 +00:00
|
|
|
{
|
|
|
|
label: messages.goToReleaseNotes.message,
|
|
|
|
click: openReleaseNotes,
|
|
|
|
},
|
2018-05-02 01:54:43 +00:00
|
|
|
{
|
|
|
|
label: messages.goToForums.message,
|
|
|
|
click: openForums,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: messages.goToSupportPage.message,
|
|
|
|
click: openSupportPage,
|
|
|
|
},
|
2020-07-15 18:31:03 +00:00
|
|
|
...(!isBeta
|
2020-06-10 16:56:10 +00:00
|
|
|
? [
|
|
|
|
{
|
|
|
|
label: messages.joinTheBeta.message,
|
|
|
|
click: openJoinTheBeta,
|
|
|
|
},
|
|
|
|
]
|
|
|
|
: []),
|
2018-05-02 01:54:43 +00:00
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: messages.aboutSignalDesktop.message,
|
|
|
|
click: showAbout,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
2017-10-13 23:49:16 +00:00
|
|
|
|
2018-03-02 20:59:39 +00:00
|
|
|
if (includeSetup) {
|
New design for import/install, 'light' import (#2053)
- A new design for the import flow. It features:
- Icons at the top of every screen
- Gray background, blue buttons, thinner text
- Simpler copy
- A new design for the install flow. It features:
- Immediate entry into the QR code screen
- Animated dots to show that we're loading the QR code from the server
- Fewer screens: 1) QR 2) device name 3) sync-in-progress
- When not set up, the app opens directly into the install screen, which has been streamlined. The `--import` command-line argument will cause the app to open directly into the import flow.
- Support for two different flavors of builds - the normal build will open into the standard registration flow, and the import flavor will be exactly the same except during setup it will open directly into the import flow.
- A new design for the (dev-only) standalone registration view
- When these install sequences are active, the OS File menu has entries to allow you to switch the method of setup you'd like to use. These go away as soon as the first step is taken in any of these flows.
- The device name (chosen on initial setup) is now shown in the settings panel
- At the end of a light import, we hand off to the normal device link screen, starting at the QR code. On a full import, we remove the sensitive encryption information in the export to prevent conflicts on multiple imports.
- `Whisper.Backup.exportToDirectory()` takes an options object so you can tell it to do a light export.
- `Whisper.Backup.importFromDirectory()` takes an options object so you can force it to load only the light components found on disk. It also returns an object so you can tell whether a given import was a full import or light import.
- On start of import, we build a list of all the ids present in the messages, conversations, and groups stores in IndexedDB. This can take some time if a lot of data is in the database already, but it makes the subsequent deduplicated import very fast.
- Disappearing messages are now excluded when exporting
- Remove some TODOs in the tests
2018-02-22 18:40:32 +00:00
|
|
|
const fileMenu = template[0];
|
|
|
|
|
2021-06-18 17:04:27 +00:00
|
|
|
if (Array.isArray(fileMenu.submenu)) {
|
|
|
|
// These are in reverse order, since we're prepending them one at a time
|
|
|
|
if (options.development) {
|
|
|
|
fileMenu.submenu.unshift({
|
|
|
|
label: messages.menuSetupAsStandalone.message,
|
|
|
|
click: setupAsStandalone,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
New design for import/install, 'light' import (#2053)
- A new design for the import flow. It features:
- Icons at the top of every screen
- Gray background, blue buttons, thinner text
- Simpler copy
- A new design for the install flow. It features:
- Immediate entry into the QR code screen
- Animated dots to show that we're loading the QR code from the server
- Fewer screens: 1) QR 2) device name 3) sync-in-progress
- When not set up, the app opens directly into the install screen, which has been streamlined. The `--import` command-line argument will cause the app to open directly into the import flow.
- Support for two different flavors of builds - the normal build will open into the standard registration flow, and the import flavor will be exactly the same except during setup it will open directly into the import flow.
- A new design for the (dev-only) standalone registration view
- When these install sequences are active, the OS File menu has entries to allow you to switch the method of setup you'd like to use. These go away as soon as the first step is taken in any of these flows.
- The device name (chosen on initial setup) is now shown in the settings panel
- At the end of a light import, we hand off to the normal device link screen, starting at the QR code. On a full import, we remove the sensitive encryption information in the export to prevent conflicts on multiple imports.
- `Whisper.Backup.exportToDirectory()` takes an options object so you can tell it to do a light export.
- `Whisper.Backup.importFromDirectory()` takes an options object so you can force it to load only the light components found on disk. It also returns an object so you can tell whether a given import was a full import or light import.
- On start of import, we build a list of all the ids present in the messages, conversations, and groups stores in IndexedDB. This can take some time if a lot of data is in the database already, but it makes the subsequent deduplicated import very fast.
- Disappearing messages are now excluded when exporting
- Remove some TODOs in the tests
2018-02-22 18:40:32 +00:00
|
|
|
fileMenu.submenu.unshift({
|
2021-06-18 17:04:27 +00:00
|
|
|
type: 'separator',
|
New design for import/install, 'light' import (#2053)
- A new design for the import flow. It features:
- Icons at the top of every screen
- Gray background, blue buttons, thinner text
- Simpler copy
- A new design for the install flow. It features:
- Immediate entry into the QR code screen
- Animated dots to show that we're loading the QR code from the server
- Fewer screens: 1) QR 2) device name 3) sync-in-progress
- When not set up, the app opens directly into the install screen, which has been streamlined. The `--import` command-line argument will cause the app to open directly into the import flow.
- Support for two different flavors of builds - the normal build will open into the standard registration flow, and the import flavor will be exactly the same except during setup it will open directly into the import flow.
- A new design for the (dev-only) standalone registration view
- When these install sequences are active, the OS File menu has entries to allow you to switch the method of setup you'd like to use. These go away as soon as the first step is taken in any of these flows.
- The device name (chosen on initial setup) is now shown in the settings panel
- At the end of a light import, we hand off to the normal device link screen, starting at the QR code. On a full import, we remove the sensitive encryption information in the export to prevent conflicts on multiple imports.
- `Whisper.Backup.exportToDirectory()` takes an options object so you can tell it to do a light export.
- `Whisper.Backup.importFromDirectory()` takes an options object so you can force it to load only the light components found on disk. It also returns an object so you can tell whether a given import was a full import or light import.
- On start of import, we build a list of all the ids present in the messages, conversations, and groups stores in IndexedDB. This can take some time if a lot of data is in the database already, but it makes the subsequent deduplicated import very fast.
- Disappearing messages are now excluded when exporting
- Remove some TODOs in the tests
2018-02-22 18:40:32 +00:00
|
|
|
});
|
2021-06-18 17:04:27 +00:00
|
|
|
fileMenu.submenu.unshift({
|
|
|
|
label: messages.menuSetupAsNewDevice.message,
|
|
|
|
click: setupAsNewDevice,
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
throw new Error('createTemplate: fileMenu.submenu was not an array!');
|
New design for import/install, 'light' import (#2053)
- A new design for the import flow. It features:
- Icons at the top of every screen
- Gray background, blue buttons, thinner text
- Simpler copy
- A new design for the install flow. It features:
- Immediate entry into the QR code screen
- Animated dots to show that we're loading the QR code from the server
- Fewer screens: 1) QR 2) device name 3) sync-in-progress
- When not set up, the app opens directly into the install screen, which has been streamlined. The `--import` command-line argument will cause the app to open directly into the import flow.
- Support for two different flavors of builds - the normal build will open into the standard registration flow, and the import flavor will be exactly the same except during setup it will open directly into the import flow.
- A new design for the (dev-only) standalone registration view
- When these install sequences are active, the OS File menu has entries to allow you to switch the method of setup you'd like to use. These go away as soon as the first step is taken in any of these flows.
- The device name (chosen on initial setup) is now shown in the settings panel
- At the end of a light import, we hand off to the normal device link screen, starting at the QR code. On a full import, we remove the sensitive encryption information in the export to prevent conflicts on multiple imports.
- `Whisper.Backup.exportToDirectory()` takes an options object so you can tell it to do a light export.
- `Whisper.Backup.importFromDirectory()` takes an options object so you can force it to load only the light components found on disk. It also returns an object so you can tell whether a given import was a full import or light import.
- On start of import, we build a list of all the ids present in the messages, conversations, and groups stores in IndexedDB. This can take some time if a lot of data is in the database already, but it makes the subsequent deduplicated import very fast.
- Disappearing messages are now excluded when exporting
- Remove some TODOs in the tests
2018-02-22 18:40:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-02 20:59:39 +00:00
|
|
|
if (platform === 'darwin') {
|
2017-10-13 23:49:16 +00:00
|
|
|
return updateForMac(template, messages, options);
|
2017-04-05 18:29:43 +00:00
|
|
|
}
|
|
|
|
|
2017-10-13 23:49:16 +00:00
|
|
|
return template;
|
2018-03-02 20:59:39 +00:00
|
|
|
};
|
2017-10-13 23:49:16 +00:00
|
|
|
|
2021-06-18 17:04:27 +00:00
|
|
|
function updateForMac(
|
|
|
|
template: MenuListType,
|
|
|
|
messages: LocaleMessagesType,
|
|
|
|
options: OptionsType
|
|
|
|
): MenuListType {
|
2019-12-17 20:25:57 +00:00
|
|
|
const { showAbout, showSettings, showWindow } = options;
|
2017-10-13 23:49:16 +00:00
|
|
|
|
2019-12-17 20:25:57 +00:00
|
|
|
// Remove About item and separator from Help menu, since they're in the app menu
|
2021-06-18 17:04:27 +00:00
|
|
|
const aboutMenu = template[4];
|
|
|
|
if (Array.isArray(aboutMenu.submenu)) {
|
|
|
|
aboutMenu.submenu.pop();
|
|
|
|
aboutMenu.submenu.pop();
|
|
|
|
} else {
|
|
|
|
throw new Error('updateForMac: help.submenu was not an array!');
|
|
|
|
}
|
2017-10-13 23:49:16 +00:00
|
|
|
|
2019-12-17 20:25:57 +00:00
|
|
|
// Remove preferences, separator, and quit from the File menu, since they're
|
|
|
|
// in the app menu
|
|
|
|
const fileMenu = template[0];
|
2021-06-18 17:04:27 +00:00
|
|
|
if (Array.isArray(fileMenu.submenu)) {
|
|
|
|
fileMenu.submenu.pop();
|
|
|
|
fileMenu.submenu.pop();
|
|
|
|
fileMenu.submenu.pop();
|
|
|
|
// And insert "close".
|
|
|
|
fileMenu.submenu.push(
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: messages.windowMenuClose.message,
|
|
|
|
accelerator: 'CmdOrCtrl+W',
|
|
|
|
role: 'close',
|
|
|
|
}
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
throw new Error('updateForMac: fileMenu.submenu was not an array!');
|
|
|
|
}
|
New design for import/install, 'light' import (#2053)
- A new design for the import flow. It features:
- Icons at the top of every screen
- Gray background, blue buttons, thinner text
- Simpler copy
- A new design for the install flow. It features:
- Immediate entry into the QR code screen
- Animated dots to show that we're loading the QR code from the server
- Fewer screens: 1) QR 2) device name 3) sync-in-progress
- When not set up, the app opens directly into the install screen, which has been streamlined. The `--import` command-line argument will cause the app to open directly into the import flow.
- Support for two different flavors of builds - the normal build will open into the standard registration flow, and the import flavor will be exactly the same except during setup it will open directly into the import flow.
- A new design for the (dev-only) standalone registration view
- When these install sequences are active, the OS File menu has entries to allow you to switch the method of setup you'd like to use. These go away as soon as the first step is taken in any of these flows.
- The device name (chosen on initial setup) is now shown in the settings panel
- At the end of a light import, we hand off to the normal device link screen, starting at the QR code. On a full import, we remove the sensitive encryption information in the export to prevent conflicts on multiple imports.
- `Whisper.Backup.exportToDirectory()` takes an options object so you can tell it to do a light export.
- `Whisper.Backup.importFromDirectory()` takes an options object so you can force it to load only the light components found on disk. It also returns an object so you can tell whether a given import was a full import or light import.
- On start of import, we build a list of all the ids present in the messages, conversations, and groups stores in IndexedDB. This can take some time if a lot of data is in the database already, but it makes the subsequent deduplicated import very fast.
- Disappearing messages are now excluded when exporting
- Remove some TODOs in the tests
2018-02-22 18:40:32 +00:00
|
|
|
|
|
|
|
// Add the OSX-specific Signal Desktop menu at the far left
|
2017-04-05 18:29:43 +00:00
|
|
|
template.unshift({
|
2019-02-21 22:41:17 +00:00
|
|
|
label: messages.signalDesktop.message,
|
2017-04-05 18:29:43 +00:00
|
|
|
submenu: [
|
|
|
|
{
|
2017-10-13 23:49:16 +00:00
|
|
|
label: messages.aboutSignalDesktop.message,
|
|
|
|
click: showAbout,
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
|
|
|
{
|
2017-10-13 23:49:16 +00:00
|
|
|
type: 'separator',
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
2018-03-02 20:59:39 +00:00
|
|
|
{
|
|
|
|
label: messages.mainMenuSettings.message,
|
|
|
|
accelerator: 'CommandOrControl+,',
|
|
|
|
click: showSettings,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
2021-06-14 19:01:49 +00:00
|
|
|
{
|
|
|
|
label: messages.appMenuServices.message,
|
|
|
|
role: 'services',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
2017-04-05 18:29:43 +00:00
|
|
|
{
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.appMenuHide.message,
|
2017-10-13 23:49:16 +00:00
|
|
|
role: 'hide',
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
|
|
|
{
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.appMenuHideOthers.message,
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'hideOthers',
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
|
|
|
{
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.appMenuUnhide.message,
|
2017-10-13 23:49:16 +00:00
|
|
|
role: 'unhide',
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
|
|
|
{
|
2017-10-13 23:49:16 +00:00
|
|
|
type: 'separator',
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
|
|
|
{
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.appMenuQuit.message,
|
2017-10-13 23:49:16 +00:00
|
|
|
role: 'quit',
|
|
|
|
},
|
2018-01-08 21:19:25 +00:00
|
|
|
],
|
2017-10-13 23:49:16 +00:00
|
|
|
});
|
|
|
|
|
2021-06-18 17:04:27 +00:00
|
|
|
const editMenu = template[2];
|
|
|
|
if (Array.isArray(editMenu.submenu)) {
|
|
|
|
editMenu.submenu.push(
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: messages.speech.message,
|
|
|
|
submenu: [
|
|
|
|
{
|
|
|
|
role: 'startSpeaking',
|
|
|
|
label: messages.editMenuStartSpeaking.message,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'stopSpeaking',
|
|
|
|
label: messages.editMenuStopSpeaking.message,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
throw new Error('updateForMac: edit.submenu was not an array!');
|
|
|
|
}
|
2017-10-13 23:49:16 +00:00
|
|
|
|
2018-01-08 21:19:25 +00:00
|
|
|
// Replace Window menu
|
|
|
|
// eslint-disable-next-line no-param-reassign
|
2019-12-17 20:25:57 +00:00
|
|
|
template[4].submenu = [
|
2017-04-05 18:29:43 +00:00
|
|
|
{
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.windowMenuMinimize.message,
|
2017-04-05 18:29:43 +00:00
|
|
|
accelerator: 'CmdOrCtrl+M',
|
2017-10-13 23:49:16 +00:00
|
|
|
role: 'minimize',
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
|
|
|
{
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.windowMenuZoom.message,
|
2017-10-13 23:49:16 +00:00
|
|
|
role: 'zoom',
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
2017-04-27 18:47:08 +00:00
|
|
|
{
|
2017-10-13 23:49:16 +00:00
|
|
|
label: messages.show.message,
|
2020-11-11 00:30:56 +00:00
|
|
|
accelerator: 'CmdOrCtrl+Shift+0',
|
2017-10-13 23:49:16 +00:00
|
|
|
click: showWindow,
|
2017-04-27 18:47:08 +00:00
|
|
|
},
|
2017-04-05 18:29:43 +00:00
|
|
|
{
|
2017-10-13 23:49:16 +00:00
|
|
|
type: 'separator',
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
|
|
|
{
|
2017-10-13 23:49:16 +00:00
|
|
|
role: 'front',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.windowMenuBringAllToFront.message,
|
2017-10-13 23:49:16 +00:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
return template;
|
2017-04-05 18:29:43 +00:00
|
|
|
}
|