Skip to content

Commit e8cefdb

Browse files
committed
- Inform users about deleting .aws/credentials: now the system makes a backup and inform you
- New Application Menu for MAC Users preventing hard refresh - Removed undefined from proxy input in profile page - Added temporary credentials for plain in order to NOT save the plain ones
1 parent b65c5ea commit e8cefdb

File tree

8 files changed

+102
-34
lines changed

8 files changed

+102
-34
lines changed

electron/dist/electron/main.js

Lines changed: 25 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

electron/dist/electron/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

electron/main.ts

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import {initialConfiguration} from '../src/app/core/initial-configuration';
55
import {machineIdSync} from 'node-machine-id';
66
import {Workspace} from '../src/app/models/workspace';
77

8-
const {app, BrowserWindow} = require('electron');
8+
const {app, BrowserWindow, globalShortcut, Menu, dialog} = require('electron');
99
const url = require('url');
10-
const copydir = require('copy-dir');
1110
const fs = require('fs');
1211
const os = require('os');
1312
const log = require('electron-log');
@@ -55,9 +54,9 @@ const setupWorkspace = () => {
5554
} finally {
5655
try {
5756

58-
// If it is the first time, let's backup the file
57+
// If it is the first time and there's a file, let's backup the file
5958
if (!fs.existsSync(workspacePath) && fs.existsSync(awsCredentialsPath)) {
60-
fs.renameSync(awsCredentialsPath, awsCredentialsPath + '.bkp');
59+
fs.renameSync(awsCredentialsPath, awsCredentialsPath + '.leapp.bkp');
6160
}
6261

6362
// Write workspace file
@@ -82,7 +81,6 @@ const generateMainWindow = () => {
8281
let forceQuit = false;
8382

8483
const createWindow = () => {
85-
8684
// Generate the App Window
8785
win = new BrowserWindow({...windowDefaultConfig.browserWindow});
8886
win.setMenuBarVisibility(false); // Hide Window Menu to make it compliant with MacOSX
@@ -110,6 +108,20 @@ const generateMainWindow = () => {
110108
win.destroy();
111109
app.quit();
112110
});
111+
112+
app.on('browser-window-focus', () => {
113+
globalShortcut.register('CommandOrControl+R', () => {
114+
console.log('CommandOrControl+R is pressed: Shortcut Disabled');
115+
});
116+
globalShortcut.register('F5', () => {
117+
console.log('F5 is pressed: Shortcut Disabled');
118+
});
119+
});
120+
121+
app.on('browser-window-blur', () => {
122+
globalShortcut.unregister('CommandOrControl+R');
123+
globalShortcut.unregister('F5');
124+
});
113125
};
114126

115127
app.on('activate', () => {
@@ -148,6 +160,17 @@ const generateMainWindow = () => {
148160
// Prepare and generate the main window if everything is setupped correctly
149161
const initWorkspace = () => {
150162

163+
// Remove unused voices from contextual menu
164+
Menu.setApplicationMenu(Menu.buildFromTemplate([
165+
{
166+
label: 'Leapp',
167+
submenu: [
168+
{ label: 'About', role: 'about' },
169+
{ label: 'Quit', role: 'quit' }
170+
]
171+
}
172+
]));
173+
151174
if (process.platform === 'linux' && ['Pantheon', 'Unity:Unity7'].indexOf(process.env.XDG_CURRENT_DESKTOP) !== -1) {
152175
process.env.XDG_CURRENT_DESKTOP = 'Unity';
153176
}

0 commit comments

Comments
 (0)