2018-04-02 19:08:53 +00:00
|
|
|
const { isString } = require('lodash');
|
2018-03-02 20:59:39 +00:00
|
|
|
|
|
|
|
exports.createTemplate = (options, messages) => {
|
|
|
|
if (!isString(options.platform)) {
|
|
|
|
throw new TypeError('`options.platform` must be a string');
|
|
|
|
}
|
|
|
|
|
2018-01-08 21:19:25 +00:00
|
|
|
const {
|
2018-03-02 20:59:39 +00:00
|
|
|
includeSetup,
|
2018-03-02 20:54:15 +00:00
|
|
|
openForums,
|
2018-01-08 21:19:25 +00:00
|
|
|
openNewBugForm,
|
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,
|
2018-03-02 20:54:15 +00:00
|
|
|
setupWithImport,
|
|
|
|
showAbout,
|
|
|
|
showDebugLog,
|
2019-11-07 21:36:16 +00:00
|
|
|
showKeyboardShortcuts,
|
2018-03-02 20:59:39 +00:00
|
|
|
showSettings,
|
2018-01-08 21:19:25 +00:00
|
|
|
} = options;
|
2017-04-05 18:29:43 +00:00
|
|
|
|
2018-05-02 01:54:43 +00:00
|
|
|
const template = [
|
|
|
|
{
|
|
|
|
label: messages.mainMenuFile.message,
|
|
|
|
submenu: [
|
|
|
|
{
|
|
|
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
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: [
|
|
|
|
{
|
|
|
|
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+=',
|
2018-05-02 01:54:43 +00:00
|
|
|
role: 'zoomin',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.viewMenuZoomIn.message,
|
2018-05-02 01:54:43 +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,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
role: 'toggledevtools',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.viewMenuToggleDevTools.message,
|
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',
|
|
|
|
},
|
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,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: messages.menuReportIssue.message,
|
|
|
|
click: openNewBugForm,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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];
|
|
|
|
|
|
|
|
// 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,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-03-02 20:59:39 +00:00
|
|
|
fileMenu.submenu.unshift({
|
|
|
|
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
|
|
|
fileMenu.submenu.unshift({
|
|
|
|
label: messages.menuSetupAsNewDevice.message,
|
|
|
|
click: setupAsNewDevice,
|
|
|
|
});
|
|
|
|
fileMenu.submenu.unshift({
|
|
|
|
label: messages.menuSetupWithImport.message,
|
|
|
|
click: setupWithImport,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
|
|
function updateForMac(template, messages, options) {
|
2018-01-08 21:19:25 +00:00
|
|
|
const {
|
2018-03-02 20:59:39 +00:00
|
|
|
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
|
|
|
setupAsNewDevice,
|
|
|
|
setupAsStandalone,
|
2018-03-02 20:54:15 +00:00
|
|
|
setupWithImport,
|
|
|
|
showAbout,
|
2018-03-02 20:59:39 +00:00
|
|
|
showSettings,
|
2018-03-02 20:54:15 +00:00
|
|
|
showWindow,
|
2018-01-08 21:19:25 +00:00
|
|
|
} = options;
|
2017-10-13 23:49:16 +00:00
|
|
|
|
|
|
|
// Remove About item and separator from Help menu, since it's on the first menu
|
|
|
|
template[4].submenu.pop();
|
|
|
|
template[4].submenu.pop();
|
|
|
|
|
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
|
|
|
// Remove File menu
|
2017-10-13 23:49:16 +00:00
|
|
|
template.shift();
|
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 (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
|
|
|
// Add a File menu just for these setup options. Because we're using unshift(), we add
|
|
|
|
// the file menu first, though it ends up to the right of the Signal Desktop menu.
|
|
|
|
const fileMenu = {
|
|
|
|
label: messages.mainMenuFile.message,
|
|
|
|
submenu: [
|
|
|
|
{
|
|
|
|
label: messages.menuSetupWithImport.message,
|
|
|
|
click: setupWithImport,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: messages.menuSetupAsNewDevice.message,
|
|
|
|
click: setupAsNewDevice,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
if (options.development) {
|
|
|
|
fileMenu.submenu.push({
|
|
|
|
label: messages.menuSetupAsStandalone.message,
|
|
|
|
click: setupAsStandalone,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
template.unshift(fileMenu);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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',
|
|
|
|
},
|
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,
|
2017-10-13 23:49:16 +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
|
|
|
});
|
|
|
|
|
|
|
|
// Add to Edit menu
|
2018-03-02 20:59:39 +00:00
|
|
|
const editIndex = includeSetup ? 2 : 1;
|
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
|
|
|
template[editIndex].submenu.push(
|
2017-04-05 18:29:43 +00:00
|
|
|
{
|
2018-01-08 21:19:25 +00:00
|
|
|
type: 'separator',
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
|
|
|
{
|
2017-10-13 23:49:16 +00:00
|
|
|
label: messages.speech.message,
|
2017-04-05 18:29:43 +00:00
|
|
|
submenu: [
|
|
|
|
{
|
2017-10-13 23:49:16 +00:00
|
|
|
role: 'startspeaking',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.editMenuStartSpeaking.message,
|
2017-04-05 18:29:43 +00:00
|
|
|
},
|
|
|
|
{
|
2017-10-13 23:49:16 +00:00
|
|
|
role: 'stopspeaking',
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.editMenuStopSpeaking.message,
|
2017-10-13 23:49:16 +00:00
|
|
|
},
|
2018-01-08 21:19:25 +00:00
|
|
|
],
|
2017-04-05 18:29:43 +00:00
|
|
|
}
|
2017-10-13 23:49:16 +00:00
|
|
|
);
|
|
|
|
|
2018-01-08 21:19:25 +00:00
|
|
|
// Replace Window menu
|
2018-03-02 20:59:39 +00:00
|
|
|
const windowMenuTemplateIndex = includeSetup ? 4 : 3;
|
2018-01-08 21:19:25 +00:00
|
|
|
// eslint-disable-next-line no-param-reassign
|
2018-03-02 20:59:39 +00:00
|
|
|
template[windowMenuTemplateIndex].submenu = [
|
2017-04-05 18:29:43 +00:00
|
|
|
{
|
2018-06-23 01:08:14 +00:00
|
|
|
label: messages.windowMenuClose.message,
|
2017-04-05 18:29:43 +00:00
|
|
|
accelerator: 'CmdOrCtrl+W',
|
2017-10-13 23:49:16 +00:00
|
|
|
role: 'close',
|
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,
|
|
|
|
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
|
|
|
}
|