mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 17:31:36 -06:00
fix: SDA-1859 & SDA-1857 (Add cloud config installer changes for MacOS & fix ZoomIn shortcut menu item) (#917)
* SDA-1859 & SDA-1857 - Add cloud config changes for macOS and fix zoomIn shortcut issue * SDA-1859 & SDA-1857 - escape quot * SDA-1859 & SDA-1857 - add quot for the values * SDA-1859 & SDA-1857 - remove unwanted log
This commit is contained in:
parent
91b3cd8aa9
commit
2ba5046f0c
@ -19,21 +19,13 @@ if [ "$pod_url" == "" ]; then
|
|||||||
pod_url="https://my.symphony.com"
|
pod_url="https://my.symphony.com"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$minimize_on_close" == "" ]; then
|
if [ "$minimize_on_close" == "" ] || [ "$minimize_on_close" == 'true' ]; then minimize_on_close='ENABLED'; else minimize_on_close='DISABLED'; fi
|
||||||
minimize_on_close=true;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$launch_on_startup" == "" ]; then
|
if [ "$launch_on_startup" == "" ] || [ "$launch_on_startup" == 'true' ]; then launch_on_startup='ENABLED'; else launch_on_startup='DISABLED'; fi
|
||||||
launch_on_startup=true;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$always_on_top" == "" ]; then
|
if [ "$always_on_top" == "" ] || [ "$always_on_top" == 'false' ]; then always_on_top='DISABLED'; else always_on_top='ENABLED'; fi
|
||||||
always_on_top=false;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$bring_to_front" == "" ]; then
|
if [ "$bring_to_front" == "" ] || [ "$bring_to_front" == 'false' ]; then bring_to_front='DISABLED'; else bring_to_front='ENABLED'; fi
|
||||||
bring_to_front=false;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$dev_tools_enabled" == "" ]; then
|
if [ "$dev_tools_enabled" == "" ]; then
|
||||||
dev_tools_enabled=true;
|
dev_tools_enabled=true;
|
||||||
@ -43,10 +35,10 @@ pod_url_escaped=$(sed 's#[&/\]#\\&#g' <<<"$pod_url")
|
|||||||
|
|
||||||
## Replace the default settings with the user selected settings ##
|
## Replace the default settings with the user selected settings ##
|
||||||
sed -i "" -E "s#\"url\" ?: ?\".*\"#\"url\"\: \"$pod_url_escaped\"#g" ${newPath}
|
sed -i "" -E "s#\"url\" ?: ?\".*\"#\"url\"\: \"$pod_url_escaped\"#g" ${newPath}
|
||||||
sed -i "" -E "s#\"minimizeOnClose\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"minimizeOnClose\":\ $minimize_on_close#g" ${newPath}
|
sed -i "" -E "s#\"minimizeOnClose\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"minimizeOnClose\":\ \"$minimize_on_close\"#g" ${newPath}
|
||||||
sed -i "" -E "s#\"alwaysOnTop\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"alwaysOnTop\":\ $always_on_top#g" ${newPath}
|
sed -i "" -E "s#\"alwaysOnTop\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"alwaysOnTop\":\ \"$always_on_top\"#g" ${newPath}
|
||||||
sed -i "" -E "s#\"launchOnStartup\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"launchOnStartup\":\ $launch_on_startup#g" ${newPath}
|
sed -i "" -E "s#\"launchOnStartup\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"launchOnStartup\":\ \"$launch_on_startup\"#g" ${newPath}
|
||||||
sed -i "" -E "s#\"bringToFront\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"bringToFront\":\ $bring_to_front#g" ${newPath}
|
sed -i "" -E "s#\"bringToFront\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"bringToFront\":\ \"$bring_to_front\"#g" ${newPath}
|
||||||
sed -i "" -E "s#\"devToolsEnabled\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"devToolsEnabled\":\ $dev_tools_enabled#g" ${newPath}
|
sed -i "" -E "s#\"devToolsEnabled\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"devToolsEnabled\":\ $dev_tools_enabled#g" ${newPath}
|
||||||
|
|
||||||
## Remove the temp settings file created ##
|
## Remove the temp settings file created ##
|
||||||
@ -100,4 +92,4 @@ sed -i "" -E "s#\"openExternal\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"o
|
|||||||
|
|
||||||
|
|
||||||
## Remove the temp permissions file created ##
|
## Remove the temp permissions file created ##
|
||||||
rm -f ${permissionsFilePath}
|
rm -f ${permissionsFilePath}
|
||||||
|
@ -42,7 +42,7 @@ const windowsAccelerator = Object.assign({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const macAccelerator = Object.assign({
|
const macAccelerator = Object.assign({
|
||||||
zoomIn: 'CommandOrControl+=',
|
zoomIn: 'CommandOrControl+Plus',
|
||||||
});
|
});
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
@ -966,14 +966,27 @@ export class WindowHandler {
|
|||||||
globalShortcut.register(isMac ? 'Cmd+Alt+I' : 'Ctrl+Shift+I', this.onRegisterDevtools);
|
globalShortcut.register(isMac ? 'Cmd+Alt+I' : 'Ctrl+Shift+I', this.onRegisterDevtools);
|
||||||
globalShortcut.register('CmdOrCtrl+R', this.onReload);
|
globalShortcut.register('CmdOrCtrl+R', this.onReload);
|
||||||
|
|
||||||
|
if (isMac) {
|
||||||
|
globalShortcut.register('CmdOrCtrl+Plus', this.onZoomIn);
|
||||||
|
globalShortcut.register('CmdOrCtrl+=', this.onZoomIn);
|
||||||
|
}
|
||||||
|
|
||||||
app.on('browser-window-focus', () => {
|
app.on('browser-window-focus', () => {
|
||||||
globalShortcut.register(isMac ? 'Cmd+Alt+I' : 'Ctrl+Shift+I', this.onRegisterDevtools);
|
globalShortcut.register(isMac ? 'Cmd+Alt+I' : 'Ctrl+Shift+I', this.onRegisterDevtools);
|
||||||
globalShortcut.register('CmdOrCtrl+R', this.onReload);
|
globalShortcut.register('CmdOrCtrl+R', this.onReload);
|
||||||
|
if (isMac) {
|
||||||
|
globalShortcut.register('CmdOrCtrl+Plus', this.onZoomIn);
|
||||||
|
globalShortcut.register('CmdOrCtrl+=', this.onZoomIn);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on('browser-window-blur', () => {
|
app.on('browser-window-blur', () => {
|
||||||
globalShortcut.unregister(isMac ? 'Cmd+Alt+I' : 'Ctrl+Shift+I');
|
globalShortcut.unregister(isMac ? 'Cmd+Alt+I' : 'Ctrl+Shift+I');
|
||||||
globalShortcut.unregister('CmdOrCtrl+R');
|
globalShortcut.unregister('CmdOrCtrl+R');
|
||||||
|
if (isMac) {
|
||||||
|
globalShortcut.unregister('CmdOrCtrl+Plus');
|
||||||
|
globalShortcut.unregister('CmdOrCtrl+=');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1006,6 +1019,21 @@ export class WindowHandler {
|
|||||||
reloadWindow(focusedWindow as ICustomBrowserWindow);
|
reloadWindow(focusedWindow as ICustomBrowserWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a workarround untill we have a
|
||||||
|
* fix on the electron framework
|
||||||
|
* https://github.com/electron/electron/issues/15496
|
||||||
|
*/
|
||||||
|
private onZoomIn(): void {
|
||||||
|
const focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
|
if (!focusedWindow || !windowExists(focusedWindow)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// electron/lib/browser/api/menu-item-roles.js row 159
|
||||||
|
const currentZoomLevel = focusedWindow.webContents.getZoomLevel();
|
||||||
|
focusedWindow.webContents.setZoomLevel(currentZoomLevel + 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cleans up reference
|
* Cleans up reference
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user