forked from signalapp/Signal-Desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove reload options, new file/help menus, tools/log at bottom * Further menus refactor: install handlers at template creation * WIP: Further tune menus, add custom about window * New About window, new help menu items, menu labels now i18n * Default device name on registration is now computer hostname The OS of the device makes sense for those of us testing across a lot of different OSes. And maybe for a user with just one desktop device. But most users with multiple desktop devices are using the same OS for both. * About window: Only show window when content is ready * Fix typo in app/menu.js
- Loading branch information
1 parent
61a2a1a
commit 75cece3
Showing
7 changed files
with
288 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<html> | ||
<head> | ||
<link href="stylesheets/manifest.css" rel="stylesheet" type="text/css" /> | ||
<style> | ||
|
||
body { | ||
text-align: center; | ||
background-color: #2090EA; | ||
color: white; | ||
font-size: 14px; | ||
} | ||
|
||
img { | ||
margin-top: 2em; | ||
margin-bottom: 1em; | ||
} | ||
|
||
a { | ||
color: white; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
|
||
<img src='images/icon_250.png'> | ||
|
||
<div> | ||
<script> | ||
document.write('v', window.config.version); | ||
</script> | ||
</div> | ||
<div> | ||
<a href="https://signal.org">signal.org</a> | ||
</div> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,159 +1,212 @@ | ||
const {Menu} = require('electron') | ||
function createTemplate(options, messages) { | ||
const showDebugLog = options.showDebugLog; | ||
const showAbout = options.showAbout; | ||
const openReleaseNotes = options.openReleaseNotes; | ||
const openNewBugForm = options.openNewBugForm; | ||
const openSupportPage = options.openSupportPage; | ||
const openForums = options.openForums; | ||
|
||
const template = [ | ||
let template = [{ | ||
label: 'File', | ||
submenu: [ | ||
{ | ||
role: 'quit', | ||
}, | ||
] | ||
}, | ||
{ | ||
label: 'Edit', | ||
submenu: [ | ||
{ | ||
role: 'undo' | ||
role: 'undo', | ||
}, | ||
{ | ||
role: 'redo' | ||
role: 'redo', | ||
}, | ||
{ | ||
type: 'separator' | ||
type: 'separator', | ||
}, | ||
{ | ||
role: 'cut' | ||
role: 'cut', | ||
}, | ||
{ | ||
role: 'copy' | ||
role: 'copy', | ||
}, | ||
{ | ||
role: 'paste' | ||
role: 'paste', | ||
}, | ||
{ | ||
role: 'pasteandmatchstyle' | ||
role: 'pasteandmatchstyle', | ||
}, | ||
{ | ||
role: 'delete' | ||
role: 'delete', | ||
}, | ||
{ | ||
role: 'selectall' | ||
role: 'selectall', | ||
} | ||
] | ||
}, | ||
{ | ||
label: 'View', | ||
submenu: [ | ||
{ | ||
label: 'Debug Log' | ||
role: 'resetzoom', | ||
}, | ||
{ | ||
type: 'separator' | ||
role: 'zoomin', | ||
}, | ||
{ | ||
role: 'reload' | ||
role: 'zoomout', | ||
}, | ||
{ | ||
role: 'forcereload' | ||
type: 'separator', | ||
}, | ||
{ | ||
role: 'toggledevtools' | ||
role: 'togglefullscreen', | ||
}, | ||
{ | ||
type: 'separator' | ||
type: 'separator', | ||
}, | ||
{ | ||
role: 'resetzoom' | ||
label: messages.debugLog.message, | ||
click: showDebugLog, | ||
}, | ||
{ | ||
role: 'zoomin' | ||
type: 'separator', | ||
}, | ||
{ | ||
role: 'zoomout' | ||
role: 'toggledevtools', | ||
}, | ||
] | ||
}, | ||
{ | ||
role: 'window', | ||
submenu: [ | ||
{ | ||
type: 'separator' | ||
role: 'minimize', | ||
}, | ||
{ | ||
role: 'togglefullscreen' | ||
} | ||
] | ||
}, | ||
{ | ||
role: 'window', | ||
role: 'help', | ||
submenu: [ | ||
{ | ||
role: 'minimize' | ||
label: messages.goToReleaseNotes.message, | ||
click: openReleaseNotes, | ||
}, | ||
{ | ||
role: 'close' | ||
} | ||
type: 'separator', | ||
}, | ||
{ | ||
label: messages.goToForums.message, | ||
click: openForums, | ||
}, | ||
{ | ||
label: messages.goToSupportPage.message, | ||
click: openSupportPage, | ||
}, | ||
{ | ||
label: messages.fileABug.message, | ||
click: openNewBugForm, | ||
}, | ||
{ | ||
type: 'separator', | ||
}, | ||
{ | ||
label: messages.aboutSignalDesktop.message, | ||
click: showAbout, | ||
}, | ||
] | ||
}]; | ||
|
||
if (process.platform === 'darwin') { | ||
return updateForMac(template, messages, options); | ||
} | ||
] | ||
|
||
if (process.platform === 'darwin') { | ||
return template; | ||
} | ||
|
||
function updateForMac(template, messages, options) { | ||
const showWindow = options.showWindow; | ||
const showAbout = options.showAbout; | ||
|
||
// Remove About item and separator from Help menu, since it's on the first menu | ||
template[4].submenu.pop(); | ||
template[4].submenu.pop(); | ||
|
||
// Replace File menu | ||
template.shift(); | ||
template.unshift({ | ||
submenu: [ | ||
{ | ||
role: 'about' | ||
label: messages.aboutSignalDesktop.message, | ||
click: showAbout, | ||
}, | ||
{ | ||
type: 'separator' | ||
type: 'separator', | ||
}, | ||
{ | ||
role: 'hide' | ||
role: 'hide', | ||
}, | ||
{ | ||
role: 'hideothers' | ||
role: 'hideothers', | ||
}, | ||
{ | ||
role: 'unhide' | ||
role: 'unhide', | ||
}, | ||
{ | ||
type: 'separator' | ||
type: 'separator', | ||
}, | ||
{ | ||
role: 'quit' | ||
} | ||
role: 'quit', | ||
}, | ||
] | ||
}) | ||
// Edit menu. | ||
}); | ||
|
||
// Add to Edit menu | ||
template[1].submenu.push( | ||
{ | ||
type: 'separator' | ||
}, | ||
{ | ||
label: 'Speech', | ||
label: messages.speech.message, | ||
submenu: [ | ||
{ | ||
role: 'startspeaking' | ||
role: 'startspeaking', | ||
}, | ||
{ | ||
role: 'stopspeaking' | ||
} | ||
role: 'stopspeaking', | ||
}, | ||
] | ||
} | ||
) | ||
// Window menu. | ||
); | ||
|
||
// Add to Window menu | ||
template[3].submenu = [ | ||
{ | ||
label: 'Close', | ||
accelerator: 'CmdOrCtrl+W', | ||
role: 'close' | ||
role: 'close', | ||
}, | ||
{ | ||
label: 'Minimize', | ||
accelerator: 'CmdOrCtrl+M', | ||
role: 'minimize' | ||
role: 'minimize', | ||
}, | ||
{ | ||
label: 'Zoom', | ||
role: 'zoom' | ||
role: 'zoom', | ||
}, | ||
{ | ||
label: 'Show', | ||
label: messages.show.message, | ||
click: showWindow, | ||
}, | ||
{ | ||
type: 'separator' | ||
type: 'separator', | ||
}, | ||
{ | ||
label: 'Bring All to Front', | ||
role: 'front' | ||
} | ||
] | ||
role: 'front', | ||
}, | ||
]; | ||
|
||
return template; | ||
} | ||
|
||
module.exports = template; | ||
module.exports = createTemplate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.