2023-01-03 19:55:46 +00:00
|
|
|
// Copyright 2017 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-06-18 17:04:27 +00:00
|
|
|
import { isString } from 'lodash';
|
2018-03-02 20:59:39 +00:00
|
|
|
|
2022-09-27 21:01:06 +00:00
|
|
|
import type { LocalizerType } from '../ts/types/I18N';
|
2022-06-08 22:00:32 +00:00
|
|
|
import type {
|
|
|
|
MenuListType,
|
|
|
|
MenuOptionsType,
|
|
|
|
MenuActionsType,
|
|
|
|
} from '../ts/types/menu';
|
2021-06-18 17:04:27 +00:00
|
|
|
|
2022-06-08 22:00:32 +00:00
|
|
|
export type CreateTemplateOptionsType = MenuOptionsType & MenuActionsType;
|
2021-06-18 17:04:27 +00:00
|
|
|
|
|
|
|
export const createTemplate = (
|
2022-06-08 22:00:32 +00:00
|
|
|
options: CreateTemplateOptionsType,
|
2022-09-27 21:01:06 +00:00
|
|
|
i18n: LocalizerType
|
2021-06-18 17:04:27 +00:00
|
|
|
): 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 {
|
2021-08-06 21:21:01 +00:00
|
|
|
isProduction,
|
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,
|
2023-02-27 22:34:43 +00:00
|
|
|
openArtCreator,
|
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
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:mainMenuFile'),
|
2018-05-02 01:54:43 +00:00
|
|
|
submenu: [
|
2019-12-17 20:25:57 +00:00
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:mainMenuCreateStickers'),
|
2023-03-16 00:59:30 +00:00
|
|
|
click: openArtCreator,
|
2019-12-17 20:25:57 +00:00
|
|
|
},
|
2018-05-02 01:54:43 +00:00
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:mainMenuSettings'),
|
2019-11-19 23:03:00 +00:00
|
|
|
accelerator: 'CommandOrControl+,',
|
2018-05-02 01:54:43 +00:00
|
|
|
click: showSettings,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'quit',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:appMenuQuit'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:mainMenuEdit'),
|
2018-05-02 01:54:43 +00:00
|
|
|
submenu: [
|
|
|
|
{
|
|
|
|
role: 'undo',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:editMenuUndo'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'redo',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:editMenuRedo'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'cut',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:editMenuCut'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'copy',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:editMenuCopy'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'paste',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:editMenuPaste'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'pasteAndMatchStyle',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:editMenuPasteAndMatchStyle'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'delete',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:editMenuDelete'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'selectAll',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:editMenuSelectAll'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:mainMenuView'),
|
2018-05-02 01:54:43 +00:00
|
|
|
submenu: [
|
|
|
|
{
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'resetZoom',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:viewMenuResetZoom'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
2022-06-08 22:00:32 +00:00
|
|
|
accelerator: 'CmdOrCtrl+=',
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'zoomIn',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:viewMenuZoomIn'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'zoomOut',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:viewMenuZoomOut'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'togglefullscreen',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:viewMenuToggleFullScreen'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:debugLog'),
|
2018-05-02 01:54:43 +00:00
|
|
|
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,
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:viewMenuToggleDevTools'),
|
2021-03-03 19:13:35 +00:00
|
|
|
},
|
|
|
|
]
|
|
|
|
: []),
|
2021-06-30 21:27:18 +00:00
|
|
|
...(devTools && platform !== 'linux'
|
|
|
|
? [
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:forceUpdate'),
|
2021-06-30 21:27:18 +00:00
|
|
|
click: forceUpdate,
|
|
|
|
},
|
|
|
|
]
|
|
|
|
: []),
|
2018-05-02 01:54:43 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:mainMenuWindow'),
|
2018-05-02 01:54:43 +00:00
|
|
|
role: 'window',
|
|
|
|
submenu: [
|
|
|
|
{
|
|
|
|
role: 'minimize',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:windowMenuMinimize'),
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:mainMenuHelp'),
|
2018-05-02 01:54:43 +00:00
|
|
|
role: 'help',
|
|
|
|
submenu: [
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:helpMenuShowKeyboardShortcuts'),
|
2019-11-07 21:36:16 +00:00
|
|
|
accelerator: 'CmdOrCtrl+/',
|
|
|
|
click: showKeyboardShortcuts,
|
2018-05-02 01:54:43 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
2020-06-10 16:56:10 +00:00
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:contactUs'),
|
2020-06-10 16:56:10 +00:00
|
|
|
click: openContactUs,
|
|
|
|
},
|
2019-11-07 21:36:16 +00:00
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:goToReleaseNotes'),
|
2019-11-07 21:36:16 +00:00
|
|
|
click: openReleaseNotes,
|
|
|
|
},
|
2018-05-02 01:54:43 +00:00
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:goToForums'),
|
2018-05-02 01:54:43 +00:00
|
|
|
click: openForums,
|
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:goToSupportPage'),
|
2018-05-02 01:54:43 +00:00
|
|
|
click: openSupportPage,
|
|
|
|
},
|
2021-08-06 21:21:01 +00:00
|
|
|
...(isProduction
|
2020-06-10 16:56:10 +00:00
|
|
|
? [
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:joinTheBeta'),
|
2020-06-10 16:56:10 +00:00
|
|
|
click: openJoinTheBeta,
|
|
|
|
},
|
|
|
|
]
|
|
|
|
: []),
|
2018-05-02 01:54:43 +00:00
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:aboutSignalDesktop'),
|
2018-05-02 01:54:43 +00:00
|
|
|
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({
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:menuSetupAsStandalone'),
|
2021-06-18 17:04:27 +00:00
|
|
|
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({
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:menuSetupAsNewDevice'),
|
2021-06-18 17:04:27 +00:00
|
|
|
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') {
|
2022-09-27 21:01:06 +00:00
|
|
|
return updateForMac(template, i18n, 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,
|
2022-09-27 21:01:06 +00:00
|
|
|
i18n: LocalizerType,
|
2022-06-08 22:00:32 +00:00
|
|
|
options: CreateTemplateOptionsType
|
2021-06-18 17:04:27 +00:00
|
|
|
): 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',
|
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:windowMenuClose'),
|
2021-06-18 17:04:27 +00:00
|
|
|
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({
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:signalDesktop'),
|
2017-04-05 18:29:43 +00:00
|
|
|
submenu: [
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:aboutSignalDesktop'),
|
2017-10-13 23:49:16 +00:00
|
|
|
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
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:mainMenuSettings'),
|
2018-03-02 20:59:39 +00:00
|
|
|
accelerator: 'CommandOrControl+,',
|
|
|
|
click: showSettings,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
2021-06-14 19:01:49 +00:00
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:appMenuServices'),
|
2021-06-14 19:01:49 +00:00
|
|
|
role: 'services',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
2017-04-05 18:29:43 +00:00
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:appMenuHide'),
|
2017-10-13 23:49:16 +00:00
|
|
|
role: 'hide',
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:appMenuHideOthers'),
|
2021-06-18 17:04:27 +00:00
|
|
|
role: 'hideOthers',
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:appMenuUnhide'),
|
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
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:appMenuQuit'),
|
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',
|
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:speech'),
|
2021-06-18 17:04:27 +00:00
|
|
|
submenu: [
|
|
|
|
{
|
|
|
|
role: 'startSpeaking',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:editMenuStartSpeaking'),
|
2021-06-18 17:04:27 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'stopSpeaking',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:editMenuStopSpeaking'),
|
2021-06-18 17:04:27 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
);
|
|
|
|
} 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
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:windowMenuMinimize'),
|
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
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:windowMenuZoom'),
|
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
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:show'),
|
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',
|
2023-03-30 00:03:25 +00:00
|
|
|
label: i18n('icu:windowMenuBringAllToFront'),
|
2017-10-13 23:49:16 +00:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
return template;
|
2017-04-05 18:29:43 +00:00
|
|
|
}
|